WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
235400
Implement at-rule function for use with @supports
https://bugs.webkit.org/show_bug.cgi?id=235400
Summary
Implement at-rule function for use with @supports
Bramus
Reported
2022-01-20 05:31:03 PST
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
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-01-21 08:24:55 PST
<
rdar://problem/87884897
>
Bramus
Comment 2
2024-07-03 09:45:32 PDT
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.
Kiet Ho
Comment 3
2026-07-30 18:37:01 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/70569
EWS
Comment 4
2026-08-03 12:48:17 PDT
Committed
318482@main
(2554611264c4): <
https://commits.webkit.org/318482@main
> Reviewed commits have been landed. Closing PR #70569 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug