CSS: style leaks from unrelated stylesheet

Tom Eugelink tbee at tbee.org
Thu Oct 9 14:23:06 UTC 2014


My controls in JFXtras have been overriding getUserAgentStylesheet from day 1 (or better JavaFX 2.0), AFAIK that is the way to do it. But I'm curious if this change is the cause of the CSS issues I'm seeing in 8U40.




On 9-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