On Wed, 8 Jan 2025 22:08:38 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:
>> I think this concern is out of proportion. Generally, nodes will not have >> such a huge number of children that simply flipping a few pseudo-classes >> will be prohibitively expensive. CSS recalculation will, in most cases, only >> happen once per pulse anyway. >> >> I don't know why we would be optimizing for pathological applications that >> register two pseudo-class listeners for each of their tens of thousands of >> children in a container, _and_ do heavy work in those listeners. > > Perhaps it is not as dire, but it may be worth a short check how this works > with say 1000 nodes with and without this new code (no need to register > listeners, I agree that that is a different problem, I was more worried about > how CSS handles this many changes). Perhaps also a case where there is also > some style change going on linked to the odd or even pseudo class (although > if that is much slower, then I guess that's what the user wanted...) A thousand of nodes scenario is possible and I think it needs to be tested, just to estimate the impact. For example, a rich text type of control: TextFlow with a thousand small Text instances all styled differently (or tied to odd/even pseudo class). Although I am struggling to see the use case for such an arrangement. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1652#discussion_r1907928338