Skip to content

Conversation

@foolip
Copy link
Collaborator

@foolip foolip commented Oct 10, 2025

Fixes #3239.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Oct 10, 2025
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.

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;

@captainbrosset
Copy link
Contributor

This looks mergeable. @foolip are there any changes you'd like to make before we merge?

@ddbeck ddbeck changed the title Rename open-closed to open-pseudo Rename open-closed to open-pseudo Nov 3, 2025
@ddbeck ddbeck merged commit 9a29392 into web-platform-dx:main Nov 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give the :open pseudo a better ID than open-closed

3 participants