RFR: 8345188: Support tree-structural pseudo-classes [v10]

Michael Strauß mstrauss at openjdk.org
Thu Jan 9 21:54:49 UTC 2025


On Thu, 9 Jan 2025 21:41:09 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> I suspect browsers have an easy way to track the index of each child (without having to renumber them). All that would take is a different underlying list type as Nodes must be unique. A Tree structure for example can determine the index of a Node with O(log N) performance for adds/removals/find index. If browsers support advanced features like `nth-child(2n+1)` I suspect they will not be using a structure that require renumbering all items or require a full search to determine the index.

Yes, the problem will be to reconcile that with the existing API around pseudo-classes. It's obviously the case that a node will match an unlimited number of functional pseudo-classes like `nth-child()`, so we can't enumerate them like we do now.

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

PR Comment: https://git.openjdk.org/jfx/pull/1652#issuecomment-2581307009


More information about the openjfx-dev mailing list