On Sat, 8 Aug 2026 18:47:00 GMT, Marius Hanl <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/javafx/stage/PopupWindow.java line 527:
>> 
>>> 525:         for (String stylesheet : ownerScene.getStylesheets()) {
>>> 526:             if (!scene.getStylesheets().contains(stylesheet)) {
>>> 527:                 newStylesheets.add(stylesheet);
>> 
>> can a PopupWindow be reused?  if so, the stylesheets might accumulate from 
>> the earlier cycles.  is this ok?  should we keep track of the stylesheets 
>> added here and remove them on `hide()`?
>
> Does not happen as we will check with `contains`. There is also a test for 
> this scenario.

I suppose I need to spell this out.  L527 adds new stylesheets, but there is 
not removing operation.  So if you keep adding stylesheets and not removing the 
old stylesheets, they just get accumulated.

Think of a scenario when a stylesheet is not sourced from a file/resource, but 
generated programmatically via a data url.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2236#discussion_r3751737248

Reply via email to