On Sun, 3 May 2026 07:08:18 GMT, Michael Strauß <[email protected]> wrote:
> `MediaQueryParser` currently parses query lists without a comma separator:
>
>
> @media (prefers-color-scheme: dark)
> (prefers-reduced-motion: reduce) {
> .foo { bar: baz; }
> }
>
>
> The correct grammar requires commas between queries.
>
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK
> Interim AI Policy](https://openjdk.org/legal/ai).
preliminary review, I'd like to test it a bit more.
modules/javafx.graphics/src/main/java/com/sun/javafx/css/media/MediaQueryParser.java
line 98:
> 96: Token comma = stream.consume();
> 97: if (expectMediaCondition || expressions.isEmpty()) {
> 98: errorHandler.accept(comma, "Unexpected token");
would it make sense to test this failure path, and also in L134 for
completeness sake?
modules/javafx.graphics/src/main/java/com/sun/javafx/css/media/MediaQueryParser.java
line 109:
> 107:
> 108: while (stream.consumeIf(NOT_COMMA) != null) {
> 109: // Skip forward to the next comma and
> replace the previous query with a
is this the case that `parserRecoversFromMissingCommaBetweenMediaQueries()`
exercise?
-------------
PR Review: https://git.openjdk.org/jfx/pull/2162#pullrequestreview-4332558216
PR Review Comment: https://git.openjdk.org/jfx/pull/2162#discussion_r3277452537
PR Review Comment: https://git.openjdk.org/jfx/pull/2162#discussion_r3277445208