On Tue, 18 Aug 2026 08:33:52 GMT, Marius Hanl <[email protected]> wrote:
>> 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. > > I guess this question is also about reusing `PopupWindow`? > > The problem is that the stylesheets and the user agent stylesheet are hard to > get right. > We don't want to overwrite any (user) stylesheets but still add the owner > ones. > > Even if we try to track that, we may still accidently remove a stylesheet set > from the developer. Or that was intended to stay. > Think about we add the owner stylesheets, the developer checks the > stylesheets with `contains` later and does not add a stylesheet because it is > already there - fine. We show it again, and e.g. the owner changed, the > stylesheets is removed but the developer really wanted that one stylesheet to > stay. > > I think this can't be solved perfectly, because the current magic logic is > already bad. We could only try to solve this on a best-effort basis. I buy this argument. Reuse is bad. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2236#discussion_r3807132726
