RFR: 8090547: Allow for transparent backgrounds in WebView [v9]

Kevin Rushforth kcr at openjdk.java.net
Sat Sep 11 15:38:54 UTC 2021

On Fri, 10 Sep 2021 18:15:21 GMT, Jose Pereda <jpereda at openjdk.org> wrote:

>> Currently, `WebPage` has already a public `setBackgroundColor()` method, but the class is not public. Therefore, public API is needed in `WebView` to allow developers access to it.
>> In line with the `fontSmoothingType` property, this PR provides public support for setting the background color of a WebPage, by adding a `pageFill` property, and a CSR is required.
>> The color for the background, that can be opaque, transparent or with any level of opacity, can be set via code or via CSS using `-fx-page-fill`.
>> Unit tests and a system test are provided.
> Jose Pereda has updated the pull request incrementally with one additional commit since the last revision:
>   Fix test to pass all 3 platforms

The test now passes on one of my Linux machines, but I still see the smearing of the text when scrolling. I took the html file from your test and used it in a simple interactive program using a transparent background that will show the problem. If you run the test program on either Mac or Linux (using the es2 pipeline) and scroll the window, you will see that the scroll area isn't cleared. I found that if the color has any alpha > 0 it works correctly. This means that something is behaving differently with fully transparent (alpha == 0) in the ES2 pipeline. It might be related to why you needed to change the initial fill color for the ES2 pipeline.



PR: https://git.openjdk.java.net/jfx/pull/563

More information about the openjfx-dev mailing list