RFR: 8345188: Set :root pseudo-class on root node

Kevin Rushforth kcr at openjdk.org
Mon Dec 2 20:55:44 UTC 2024


On Thu, 28 Nov 2024 14:02:36 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

> The CSS Selectors specification defines the `:root` pseudo-class that matches root nodes:
> https://www.w3.org/TR/selectors-4/#the-root-pseudo
> 
> JavaFX uses the non-standard `.root` style class for the same purpose. We should also support the `:root` pseudo-class for increased compatibility of JavaFX CSS with the web specification.

This will require a change to `cssref.html` to list the `:root` pseudo-class in the list of pseudo-classes for `Parent`.

Additionally, changes will likely be needed to the two places where we say that JavaFX doesn't support structural pseudo-classes, [here](https://github.com/openjdk/jfx/blob/da6ad4b1e8c2aac59114949826db1e4b013a3bc5/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html#L542-L543) and [here](https://github.com/openjdk/jfx/blob/da6ad4b1e8c2aac59114949826db1e4b013a3bc5/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html#L872), since `:root` is a structural pseudo-class.

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

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


More information about the openjfx-dev mailing list