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

Michel Jung github.com+1864183+micheljung at openjdk.java.net
Sun Aug 29 06:41:43 UTC 2021


On Fri, 27 Aug 2021 15:41:59 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:
> 
>   Color to int32 conversion and more changes based on feedback

modules/javafx.web/src/main/java/com/sun/webkit/WebPage.java line 629:

> 627:         try {
> 628:             log.fine("setBackgroundColor int32: " + backgroundColor +
> 629:                    " for all frames");

I don't know JavaFX's PlatformLogger but this should probably be:

Suggestion:

            log.fine("setBackgroundColor int32: {} for all frames", backgroundColor);

or:

Suggestion:

            if(log.isTraceEnabled()) {
                log.fine("setBackgroundColor int32: {} for all frames", backgroundColor);
            }


Even though this probably isn't something that's called very often :)

-------------

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


More information about the openjfx-dev mailing list