On Sun, 3 May 2026 06:49:40 GMT, Michael Strauß <[email protected]> wrote:
> This PR adds the `-fx-supports-conditional-feature` media query, which allows > applications to adapt their stylesheets to different platforms with varying > conditional feature support. Currently, the built-in themes use hard-coded > logic to include or exclude conditional-feature stylesheets. The new media > query allows us to potentially remove the hard-coded logic in the future, and > gives third-party themes an API to query conditional feature support. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Testing looks good. My feedback is mostly about documentation - I know it is very difficult to write docs from a new user perspective, especially since you know how the internals work in great detail. modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html line 1022: > 1020: </tr> > 1021: <tr> > 1022: <td class="value > nowrap">-fx-prefers-persistent-scrollbars</td> just noticed this: why the `-fx` prefix is here but not in all the others? modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html line 1035: > 1033: <tr> > 1034: <td class="value > nowrap">-fx-supports-conditional-feature</td> > 1035: <td class="value"> this cell looks way too busy. do you think it might be worth either extracting it into a dedicated table where each feature can be explained/described? modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html line 1044: > 1042: <span class="nowrap">input-pointer</span></td> > 1043: <td>discrete</td> > 1044: <td>Evaluates to <code>true</code> if > <code>Platform.isSupported(ConditionalFeature)</code> returns would it be better if this were a link to `Platform.isSupported(ConditionalFeature)` ? modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html line 1046: > 1044: <td>Evaluates to <code>true</code> if > <code>Platform.isSupported(ConditionalFeature)</code> returns > 1045: <code>true</code> for the specified conditional > feature.<br>This media feature cannot be > 1046: evaluated in a boolean context.</td> Could you please explain in more easily understandable terms that the "boolean context" means? Assume the reader is trying to use it for the first time. Especially confusing because `isSupported` is a boolean... modules/javafx.graphics/src/test/java/test/javafx/css/CssParser_mediaQuery_Test.java line 385: > 383: """; > 384: > 385: Stylesheet stylesheet = new > CssParserShim().parseUnmerged(stylesheetText, true); in the case of invalid conditional feature like @media (-fx-supports-conditional-feature: xxx) { .button { -fx-background-color: red; } } the CssParser writes to stderr - is that expected? if so, should it be tested? ------------- PR Review: https://git.openjdk.org/jfx/pull/2161#pullrequestreview-4339596213 PR Review Comment: https://git.openjdk.org/jfx/pull/2161#discussion_r3283455890 PR Review Comment: https://git.openjdk.org/jfx/pull/2161#discussion_r3283471760 PR Review Comment: https://git.openjdk.org/jfx/pull/2161#discussion_r3283474635 PR Review Comment: https://git.openjdk.org/jfx/pull/2161#discussion_r3283549739 PR Review Comment: https://git.openjdk.org/jfx/pull/2161#discussion_r3283508363
