Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions features/open-closed.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
name: ":open"
description: The `:open` CSS pseudo-class matches elements that have open states, like `<details>`, `<dialog>`, or `<select>`, based on their state.
spec: https://drafts.csswg.org/selectors-4/#open-state
group: selectors
compat_features:
- css.selectors.open
kind: moved
redirect_target: open-pseudo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddbeck just a thought (not blocking here): what happens if we later decide to change the ID again? Perhaps to open-pseudo-class? Would we just change this value to avoid multiple chained redirects? And if so, do we have an automated check for this kind of things (to avoid chained redirects)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddbeck just a thought (not blocking here): what happens if we later decide to change the ID again? Perhaps to open-pseudo-class? Would we just change this value to avoid multiple chained redirects?

Yes, that's correct. In the documentation, we promise to consumers that redirects aren't chained and do not create cycles.

And if so, do we have an automated check for this kind of things (to avoid chained redirects)?

Yes, we guard against this here:

/**
* Assert that a reference from one feature to another is an ordinary feature
* reference (i.e., it's defined and not some kind of redirect).
*
* @export
* @param {string} sourceId The feature that is referencing another feature
* @param {string} targetId The feature being referenced
* @param {WebFeaturesData["features"]} features Feature data
*/
export function assertValidFeatureReference(

web-features/index.ts

Lines 220 to 232 in b9d34ba

case "feature":
for (const alternative of feature.discouraged?.alternatives ?? []) {
assertValidFeatureReference(id, alternative, features)
}
break;
case "moved":
assertValidFeatureReference(id, feature.redirect_target, features);
break;
case "split":
for (const target of feature.redirect_targets) {
assertValidFeatureReference(id, target, features);
}
break;

15 changes: 4 additions & 11 deletions features/open-closed.yml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# Generated from: open-closed.yml
# Do not edit this file by hand. Edit the source file instead!
# This file intentionally left blank.
# Do not edit this file.
# The data for this feature has moved to open-pseudo.yml

status:
baseline: false
support:
chrome: "133"
chrome_android: "133"
edge: "133"
firefox: "136"
firefox_android: "136"
compat_features:
- css.selectors.open
{}
6 changes: 6 additions & 0 deletions features/open-pseudo.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should have a pretty good idea about the -pseudo versus -pseudo-class suggestion discussed in #3436 (comment) before proceeding. Otherwise, I like this.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: ":open"
description: The `:open` CSS pseudo-class matches elements that have open states, like `<details>`, `<dialog>`, or `<select>`, based on their state.
spec: https://drafts.csswg.org/selectors-4/#open-state
group: selectors
compat_features:
- css.selectors.open
13 changes: 13 additions & 0 deletions features/open-pseudo.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated from: open-pseudo.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "133"
chrome_android: "133"
edge: "133"
firefox: "136"
firefox_android: "136"
compat_features:
- css.selectors.open