-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mediaqueries] Spec has conflicting info on whether or not <media-query-list>
allows trailing commas
#11254
Comments
An invalid |
Ah, but passing Also, in the section on error handling it says that "a grammar mismatch does not wipe out an entire media query list, just the problematic media query" so even if passing |
The trailing whitespace in my example was unintentional, sorry. It does not make any difference: |
Without whitespace, the last item, as per my understanding of the spec, should be
Note that both Firefox and Chrome don't do it like this, so I'm either misunderstanding something or this is a spec or browser bug. Meanwhile, the railroad diagram makes it seem like |
Ah yes, this seems to be a regression introduced in 6ab5888 (related: #8834). It is not present in the last published version of the spec, linked in your initial comment. This algo is currently only used to parse a list of media queries, of selectors in Related tests:
Simple fix: - 2. [=Discard a token=] from |input|.
+ 2. If the current input code point is <<comma-token>>,
+ [=discard a token=] from |input|,
+ and repeat step 1. Possibly simpler:
|
Right, I did not read the old version of the spec closely enough. I got it now. |
It should probably be marked as non-normative. I agree. |
The railroad diagram in 2.1. Combining Media Queries does not allow a trailing comma:
But later on, in 3. Syntax, it says "To parse a
<media-query-list>
production, parse a comma-separated list of component values".And parsing a comma-separated list of component values does allow a trailing comma.
I'd assume the trailing comma is allowed, especially since the railroad diagram is called out as "informal", but from what I can tell, it is still in a normative part of the spec.
(I haven't yet checked how browsers actually implement this, so that guess is based purely on the spec.)
The text was updated successfully, but these errors were encountered: