[Webkit-unassigned] [Bug 235400] New: Implement at-rule function for use with @supports

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 20 05:31:03 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235400

            Bug ID: 235400
           Summary: Implement at-rule function for use with @supports
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: bramus at bram.us

As per CSS WG Decision [1]: Implement at-rule function for use with @supports

Syntax:

```css
/* Just the at-rule name, which returns whether this is a recognized at-rule name at all. */
@supports(at-rule(@foo)) {
  /* @foo is supported */
}
```

```css
/* An at-rule name accompanied by a descriptor declaration, which returns whether the at-rule is recognized, and the given descriptor successfully parses as part of that at-rule.*/
@supports(at-rule(@foo; desc: val)) {
  /* @foo with the descriptor `desc` and value `val` is supported */
}
```

Note that there's a follow-up issue [2] to extend at-rule() with a third syntax which allows passing in an entire at-rule into at-rule().

```css
/* An entire at-rule, which returns whether or not the at-rule as a whole, when parsed as the first and only content in a fresh stylesheet, is valid or dropped. If the at-rule is valid but drops some of its contents as invalid, such as an unknown descriptor, this will still return true. */
@supports(at-rule(@foo bar {baz: qux})) {
  /* The entire at-rule is supported */
}
```

It also supports 
At the moment, this third syntax is still a WIP.

^[1] https://github.com/w3c/csswg-drafts/issues/2463#issuecomment-1016720310
^[2] https://github.com/w3c/csswg-drafts/issues/6966

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220120/bfd28d39/attachment.htm>


More information about the webkit-unassigned mailing list