Skip to content

Commit e0c83b3

Browse files
ddbeckcaugner
andauthored
Add behavioral subfeature data guideline (#26781)
Co-authored-by: Claas Augner <[email protected]>
1 parent ca5ecb2 commit e0c83b3

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docs/data-guidelines/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,52 @@ Do not set `deprecated` to `true` for features that are merely old or unpopular,
197197

198198
This guideline was proposed in [#15703](https://github.com/mdn/browser-compat-data/pull/15703). See [mdn/content#5549](https://github.com/mdn/content/discussions/5549) and [#10490](https://github.com/mdn/browser-compat-data/issues/10490) for further discussion on the use of "deprecated."
199199

200+
## Behavioral subfeatures
201+
202+
> ![NOTE]
203+
> This guideline was added in August 2025 and feedback is welcome.
204+
> If you have questions or concerns about how to apply it, [file an issue](https://github.com/mdn/browser-compat-data/issues/new/choose).
205+
206+
A behavioral subfeature records support for some facet, nuance, or evolution of a parent feature, where the behavior doesn't have a natural identifier (like CSS properties, API methods, or HTTP headers do).
207+
Due to the lack of a natural identifier, a behavioral subfeature must have a `description`.
208+
209+
If a more specific guideline applies, follow that guideline instead of this one. See:
210+
211+
- [`returns_promise`](./api.md#methods-returning-promises-returns_promise)
212+
- [`secure_context_required`](./api.md#secure-context-required-secure_context_required)
213+
- [`worker_support`](./api.md#web-workers-worker_support)
214+
215+
Behavioral subfeatures are rare.
216+
Do not create a subfeature when the behavioral subfeature's `support` data would be the same, across all browsers, as the parent feature.
217+
For serious bugs affecting a single engine, consider using `partial_implementation` instead. <!-- TODO: link to partial_implementation guidelines, when available -->
218+
219+
You may create a behavioral subfeature for the following types of browser behaviors:
220+
221+
- A contextual support condition that is not readily feature detectable.
222+
This type of behavioral subfeature typically describes the applicability of a feature to specific context.
223+
224+
- Behavioral evolution that is not readily feature detectable.
225+
This type of behavioral subfeature typically describes consequences of specification changes that appeared after the feature first shipped in one or more browsers or user interface changes that appeared after implementers learned more about the specification.
226+
227+
Here are some example situations:
228+
229+
- A CSS property may depend on the layout context.
230+
The CSS property `gap` has different support histories in flex and grid layouts, so it has the behavioral subfeatures of `css.properties.gap.flex_context` and `css.properties.gap.grid_context`.
231+
See [`css.properties.gap`](https://github.com/mdn/browser-compat-data/blob/main/css/properties/gap.json).
232+
233+
- An API exposure may depend on an execution context.
234+
The `setTimeout()` method has different support histories for worker support, so it has the behavioral subfeatures of `api.setTimeout.worker_support`.
235+
See the guideline for [`worker_support`](./api.md#web-workers-worker_support) for further guidance.
236+
237+
- An API's specified behavior may change after a feature ships in one or more browsers.
238+
The `play()` method of the `HTMLMediaElement` interface originally consumed a callback instead of returning a promise, so it has the behavioral subfeature of `api.HTMLMediaElement.play.returns_promise`.
239+
See the guideline for [`returns_promise`](./api.md#methods-returning-promises-returns_promise) for further guidance.
240+
241+
- User interface behavior may evolve with better understanding of a specification.
242+
The `inert` HTML attribute marks elements as non-interactive but this did not originally affect find-in-page search, so it has the behavioral subfeature of [`html.global_attributes.inert.ignores_find_in_page`](https://github.com/mdn/browser-compat-data/blob/behavioral-subfeature-guideline/html/global_attributes.json).
243+
244+
This guideline was proposed and adopted in [#26781](https://github.com/mdn/browser-compat-data/pull/26781).
245+
200246
## Parameters and parameter object features
201247

202248
Sometimes it's useful to represent support for specific parameters (also known as arguments) of a function or method, as a subfeature of the function itself. To record data about whether a specific parameter is supported by a function or method, use the following naming conventions:

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ An alphabetical index of keywords linking to relevant sections in the docs.
88

99
---
1010

11+
- **Behavioral subfeatures** - [Data guideline: Behavioral subfeatures](./data-guidelines/index.md#behavioral-subfeatures)
1112
- **Browser addition/removal**[Data guidelines for browser data](./data-guidelines/browsers.md#addition-of-browsers)
1213
- **Browser data**[Data guidelines for browser data](./data-guidelines/browsers.md)
1314
- **Browser versions**[Matching web features to browser release version numbers](./matching-browser-releases/index.md#matching-web-features-to-browser-release-version-numbers)

0 commit comments

Comments
 (0)