CSS: style leaks from unrelated stylesheet

David Grieve david.grieve at oracle.com
Thu Oct 9 13:27:18 UTC 2014

In 8u20 and before, adding a stylesheet via 
Control.getUserAgentStylesheet will simply add the user-agent stylesheet 
to the entire scene, not just the control. This has been fixed in 8u40 
where the getUserAgentStylesheet method is now public API on Region and 
the styles added will affect only the Region and its children.

Incidentally, the code you point out from the 3rd party control 
(controlsfx) was added as a work-around for a separate issue related to 
Control.getUserAgentStylesheet(). I believe the 8u40 branch of 
controlsfx has removed this work-around and is using the 
Region#getUserAgentStylesheet method.

On 10/9/14, 8:58 AM, Werner Lehmann wrote:
> Turns out that the 3rd party control adds its stylesheet like this:
> class SomeControlSkin...
>   static {
>     StyleManager.getInstance().addUserAgentStylesheet(...)
>   }
> In this way it is not only using private API but also the stylesheet 
> is not associated with only such control nodes and therefore seems to 
> affect other nodes, too. Is this correct, and should the stylesheet 
> rather be provided by overriding Control.getUserAgentStylesheet?
> Werner
> On 09.10.2014 12:00, Werner Lehmann wrote:
>> Then a dialog stage is displayed and its scene does not use the 3rd
>> party control. However, a combobox list-cell (its button cell) is still

More information about the openjfx-dev mailing list