Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upVarious issues around conditions for syntax accepted by @supports #15482
Comments
|
Spec issue has been filed in w3c/csswg-drafts#1016. |
|
Probably we should file a bug to Gecko. Could you do that? |
|
#17173 fixes the |
Stop parsing @supports rules before Delimiter::Bang Fixes #15482 Shorthand parsing uses `parse_entirely`, so we have to ask it to stop before the `!important`. An alternate fix is to not use `parse_entirely` there and ensuring that all callers of `PropertyDeclaration::parse_into()` check that the input is exhausted. Two of the three callers do that anyway because they check for `!important`. We also weren't checking for the end of the parser for `CSS.supports()`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17173) <!-- Reviewable:end -->
|
This isn't completely fixed. The unbalanced cases are still failing in test_css_supports.html. Specifically, Gecko returns false for This is related to w3c/csswg-drafts#1016, but per @SimonSapin's comment there, we probably should follow Gecko's behavior on this. |
Fix supports rule parsing issues with <any-value> This eventually fixes #15482, as well as several reftests in mozilla-central which were added for [bug 883987](https://bugzilla.mozilla.org/show_bug.cgi?id=883987). The new function should probably be moved into cssparser crate at some point. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17792) <!-- Reviewable:end -->
Fix supports rule parsing issues with <any-value> This eventually fixes #15482, as well as several reftests in mozilla-central which were added for [bug 883987](https://bugzilla.mozilla.org/show_bug.cgi?id=883987). The new function should probably be moved into cssparser crate at some point. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17792) <!-- Reviewable:end -->
Fix supports rule parsing issues with <any-value> This eventually fixes #15482, as well as several reftests in mozilla-central which were added for [bug 883987](https://bugzilla.mozilla.org/show_bug.cgi?id=883987). The new function should probably be moved into cssparser crate at some point. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17792) <!-- Reviewable:end -->
[This can be tested with
alert(CSS.supports(cond));]There are several issues:
!importantwhen the property is a shorthand. e.g.(background: none !important)returns false, but it should return true.(color: green) and (color: green) or (color: green)- correct form is((color: green) and (color: green)) or (color: green)not (color: rainbow) and not (color: iridescent)- correct form is(not (color: rainbow)) and (not (color: iridescent))(This is a Gecko issue)color: green- correct form is(color: green)Spec: https://drafts.csswg.org/css-conditional-3/#at-supports
(Servo also accepts unbalanced brackets inside the condition, which Gecko doesn't accept, but Blink accepts. This is probably a question to the spec.)