RFR: 8090547: Allow for transparent backgrounds in WebView

Johan Vos johan.vos at gluonhq.com
Mon Jul 5 09:42:57 UTC 2021


On Fri, Jul 2, 2021 at 2:50 PM Kevin Rushforth <kcr at openjdk.java.net> wrote:

> On Fri, 2 Jul 2021 11:01:56 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.
>
> This new API warrants a brief discussion on the mailing list prior to
> review.
>

This is one of the old issues that keeps popping up regularly, and that
many developers expressed interest in. I think the approach of having a
`pageFill` similar to the `fontSmootingType` is a good approach. The main
thing I would be very careful about is not to introduce performance
regression in case no background is set. The current PR introduces a number
of points where additional computations are requested (e.g. `repaint`) but
these are guarded by checks that only pass when the background is set.

- Johan


More information about the openjfx-dev mailing list