On Tue, 18 Aug 2026 19:11:33 GMT, Andy Goryachev <[email protected]> wrote:
>> 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. I will move this to a draft, need to think about it more. My current idea is what you also suggested, keeping track of the owner stylesheets we added. I don't like it, but that is probably the most best-effort basis fix I can think of. I had hoped this is easier to solve, but it isn't (too many possible usecases as you also mentioned). ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2236#discussion_r3807387645
