RFR: 8345188: Support tree-structural pseudo-classes [v5]
Michael Strauß
mstrauss at openjdk.org
Tue Dec 3 20:04:52 UTC 2024
On Tue, 3 Dec 2024 20:02:15 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.
>>
>> Additionally, we should also support the following child-indexed pseudo-classes:
>> `:first-child`
>> `:last-child`
>> `:only-child`
>> `:nth-child()` with arguments `even` and `odd`
>>
>> The `An+B [of S]?` microsyntax for `:nth-child()` is not supported, as this would require major changes in JavaFX CSS.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> whitespace error
I've expanded the scope of this enhancement to also include several child-indexed pseudo-classes, which are also structural pseudo-classes.
I specifically didn't include the `:empty` structual pseudo-class (matching a `Parent` with no children), as this pseudo-class is alrady being used by `ComboBoxListViewSkin`. Perhaps we should deprecate the use of standard pseudo-classes in skins?
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1652#issuecomment-2515438643
More information about the openjfx-dev
mailing list