On Wed, 30 Sep 2026 16:08:16 GMT, Marius Hanl <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/javafx/scene/CssStyleHelper.java line >> 201: >> >>> 199: final PseudoClassState triggerState = triggerStates[n]; >>> 200: >>> 201: // TODO: this means that a style like .menu-item:hover >>> won't work. Need to separate CssStyleHelper tree from scene-graph tree >> >> is this still a TODO? to be addressed in a follow-up? > > I was wondering as well but I don't know really. > The whole `Styleable` thing is weird. > > Usually, each `Styleable` is just some form of API/Contract which later > results in a `Node` with the styles you added. Since only a `Node` can be > added into the scene graph. > > Example: `Tab` is a `Styleable` but will never be observed here in the > `CssStyleHelper`. > Instead, it will be a `TabHeaderSkin` which will receive all style(classe)s > from `Tab`. > Same for `MenuItem`, which will be a `MenuItemContainer`. > > So I don't know why this `Styleable` thing exists here. And also there is > `Styleable.getStyleableNode()` since JavaFX 9, which again raises more > questions in my head. > Like, why is it not used here, why does it exists,... I think that TODO pre-dates `getStyleableNode` by a few years, so I think it can be resolved now. It is a shame that when they added `getStyleableNode` they didn't simply have `Node` implement it with a final method returning `this` (although I think we could still do that as it is unlikely anybody is relying on it not being final for `Node`s). It sounds like something for a different PR though. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2333#discussion_r4150113857
