CSS: style leaks from unrelated stylesheet

Werner Lehmann lehmann at media-interactive.de
Thu Oct 9 14:20:20 UTC 2014

Thanks, David.

This means I would always override getUserAgentStylesheet (for 8u20 on 
Control, for 8u40+ on Region). And selectors in the stylesheet should be 
sufficiently specific because only 8u40+ actually limits them to the 
declaring node.

For the record, I'm not talking about controlsfx - but that may have 
been the template for it.


On 09.10.2014 15:27, David Grieve wrote:
> 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