<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>235400</bug_id>
          
          <creation_ts>2022-01-20 05:31:03 -0800</creation_ts>
          <short_desc>Implement at-rule function for use with @supports</short_desc>
          <delta_ts>2024-07-15 21:37:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bramus">bramus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ik</cc>
    
    <cc>koivisto</cc>
    
    <cc>ryan</cc>
    
    <cc>sebastianzartner</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1832401</commentid>
    <comment_count>0</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2022-01-20 05:31:03 -0800</bug_when>
    <thetext>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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1832769</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-01-21 08:24:55 -0800</bug_when>
    <thetext>&lt;rdar://problem/87884897&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044454</commentid>
    <comment_count>2</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2024-07-03 09:45:32 -0700</bug_when>
    <thetext>FYI: I am seeing an uptick in requests for this, especially with `@property` becoming interoperable soon: authors want to detec this. Another request was to detect `@starting-style` support.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>