-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Labels
Closed Accepted by Editor DiscretionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-conditional-3
Description
According to https://drafts.csswg.org/css-conditional-3/#the-css-namespace,
-
CSS.supports(conditionText)- If
conditionText, parsed and evaluated as a<supports-condition>, would returntrue, returntrue. - Otherwise, If
conditionText, wrapped in parentheses and then parsed and evaluated as a<supports-condition>, would returntrue, returntrue. - Otherwise, return
false.
Therefore, and according to [css-conditional-3] Are there issues with !important in @supports? (Is the grammar wrong?) #5559, we should have
CSS.supports("background: green !important"); // true
as all Chromium, WebKit and Firefox already do.
- If
-
CSS.supports(property, value)- If
propertyis an ASCII case-insensitive match for any defined CSS property that the UA supports, andvaluesuccessfully parses according to that property’s grammar, returntrue. - Otherwise, if
propertyis a custom property name string, returntrue. - Otherwise, return
false.
I don't think
!importantis part of the property’s grammar, so I would expectCSS.supports("background", "green !important"); // false
However, accepting
!importantin the single argument case, but rejecting it in the 2 arguments one, can seem inconsistent.And we don't have interoperability here: Firefox and Chromium return
false, but WebKit returnstrue. - If
Metadata
Metadata
Assignees
Labels
Closed Accepted by Editor DiscretionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-conditional-3