You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adds security-privacy questionnaire
* Update AtRuleFeatureDetection/security-privacy-questionnaire.md
Co-authored-by: Kevin Babbitt <kbabbitt@microsoft.com>
* Update AtRuleFeatureDetection/security-privacy-questionnaire.md
Co-authored-by: Kevin Babbitt <kbabbitt@microsoft.com>
* Update AtRuleFeatureDetection/security-privacy-questionnaire.md
Co-authored-by: Kevin Babbitt <kbabbitt@microsoft.com>
* Rescopes at-rule down to test to just `at-rule(@foo)`
Removed use cases from the explainer. Detect whether an at-rule, with optional prelude and/or block, is supported based on this resolution: w3c/csswg-drafts#6966 (comment)
Detect whether a given declaration is supported within an at-rule block based on the proposed @supports-condition w3c/csswg-drafts#12622 (comment)
* Update explainer.md
* Addresses TAG comments
- Addresses TAG comments found [here](w3ctag/design-reviews#1176 (comment))
- moves previous capabilities to non-goals based on the new `@supports-condition` at-rule
* Update explainer.md
* Update explainer.md
---------
Co-authored-by: Kevin Babbitt <kbabbitt@microsoft.com>
@@ -55,16 +55,18 @@ There have been many scenarios described that call for feature detection of at-r
55
55
56
56
Allow authors to feature-detect newly introduced at-rules.
57
57
58
-
Allow authors to feature-detect new enhancements to existing at-rules, such as:
59
-
- New media query features and other additions to at-rule preludes
60
-
- New descriptors that may be introduced to rules such as `@font-face`
61
-
62
58
At-rule feature detection should be available in all contexts where CSS allows conditioning based on support
63
59
of a feature. This includes, but is not limited to,
64
60
`@supports`, `CSS.supports()`, `@import ... supports()`, and `@when supports()`.
65
61
66
62
### Non-goals
67
63
64
+
- Allow authors to feature-detect new enhancements to existing at-rules, such as:
65
+
- New media query features and other additions to at-rule preludes
66
+
- New descriptors that may be introduced to rules such as `@font-face`
67
+
- Detect non at-rules like `@charset`:
68
+
69
+
#### CSS `@charset`
68
70
The CSS `@charset` rule, despite its appearance, is
69
71
[not an at-rule](https://drafts.csswg.org/css-syntax/#charset-rule).
70
72
Rather, `@charset` is a marker that can appear only as the first few bytes of a stylesheet file. It signals to
@@ -82,13 +84,16 @@ CSS is to use UTF-8.
82
84
83
85
Accordingly, this explainer does not propose making `@charset` feature-detectable using `at-rule()`.
84
86
87
+
#### Context Aware feature detection
88
+
As [mentioned before](#detect-whether-an-at-rule-name-is-recognized-at-all), the `at-rule()` feature returns true if the at-rule name is recognised in any context. This introduces the risk of false positives. As per CSSWG resolutions [#12622](https://github.com/w3c/csswg-drafts/issues/12622) and [#6966](https://github.com/w3c/csswg-drafts/issues/6966#issuecomment-3205037703) the new `@supports-condition` at-rule is introduced as a way to define and name complex support queries, including the ones that need to account for context.
89
+
85
90
## Proposed Approach
86
91
87
-
The `at-rule()` function can be used for feature detection in the following ways:
92
+
The `at-rule()` function can be used for feature detection in the following way:
88
93
89
94
### Detect whether an at-rule name is recognized at all
90
95
91
-
In its simplest form, the`at-rule()` function can be passed just an at-rule name.
96
+
The`at-rule()` function can be passed just an at-rule name.
92
97
The result is true if the implementation would recognize it as an at-rule in any context, false otherwise.
93
98
This form is useful for detecting entire new features implemented as at-rules, including features such as
0 commit comments