On Tue, 6 May 2025 15:40:42 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> No, media queries are not a thing at the lexer stage. The media query 
>> grammar only comes in at a later stage.
>
> oh, the handling of the `@media` tokens is done at a different level?

`CssLexer` is responsible for converting the stylesheet text into a token 
stream. In this stream, `@media` appears as an `AT_KEYWORD` token, but no 
further syntactic processing is done (i.e. the parser doesn't care at all if 
the sequence of tokens makes any sense). This only happens in `CssParser`, 
where the actual value of the token is inspected and subsequent tokens are 
interpreted according to a specific grammar (in this case, the media query 
grammar). That's why all of the parsing tests are in 
`CssParser_mediaQuery_Test`.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2076095073

Reply via email to