Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing closed/open CSS selector features #21369

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

queengooborg
Copy link
Contributor

@queengooborg queengooborg commented Nov 28, 2023

This PR is a part of a project to add missing interfaces and interface features to BCD that are from an active spec (including WICG specs) and is supported in at least one browser. This particular PR adds the missing closed and open CSS selector. The data comes from the mdn-bcd-collector project (v10.5.1).

Check out the collector's guide on how to review this PR.

Tests Used:
https://mdn-bcd-collector.gooborg.com/tests/css/selectors/open
https://mdn-bcd-collector.gooborg.com/tests/css/selectors/closed

This PR is a part of a project to add missing interfaces and interface features to BCD that are from an active spec (including WICG specs) and is supported in at least one browser. This particular PR adds the missing `closed-and-open` CSS selector. The data comes from the [mdn-bcd-collector](https://mdn-bcd-collector.gooborg.com) project (v10.5.1).

_Check out the [collector's guide on how to review this PR](https://github.com/openwebdocs/mdn-bcd-collector#reviewing-bcd-changes)._

Tests Used: https://mdn-bcd-collector.gooborg.com/tests/css/selectors/closed-and-open
@queengooborg queengooborg added the data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label Nov 28, 2023
@queengooborg queengooborg changed the title Add missing closed-and-open CSS selector feature Add missing closed/open CSS selector features Nov 28, 2023
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

hmm I think this is being removed. The CSS spec hasn't removed these two unfortunately. It was removed in the HTML spec: whatwg/html#9077

Gone in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1825807
Gone in Webkit: https://bugs.webkit.org/show_bug.cgi?id=254816

Chrome seems to not have removed :open and :closed and only added :popover-open?
https://bugs.chromium.org/p/chromium/issues/detail?id=1429670

@Elchi3
Copy link
Member

Elchi3 commented Nov 28, 2023

I wonder if these should be marked at least deprecated or something?
Maybe @mfreed7 knows more?

@mfreed7
Copy link
Contributor

mfreed7 commented Nov 28, 2023

So I think there's still a desire to add :open and :closed for things like <details>, and <select>. We (Chromium) just haven't gotten around to doing that. But yes, the CSS parser still recognizes :open and :closed so the test in the comment above passes. However, the only implemented behavior for these is the new (not yet standardized or shipped) <selectlist> element.

I'm not sure how you'd like to represent this state in MDN!

@Elchi3
Copy link
Member

Elchi3 commented Nov 28, 2023

Thanks for the background, @mfreed7!
I guess then we could merge these in with a note.

(Shipping stuff this way is a bit bad for feature detection)

@mfreed7
Copy link
Contributor

mfreed7 commented Nov 28, 2023

Thanks for the background, @mfreed7! I guess then we could merge these in with a note.

(Shipping stuff this way is a bit bad for feature detection)

Yeah, agreed. @josepharhar would you mind changing the code to only parse :open and :closed if the experimental feature for <selectlist> is enabled?

@Elchi3 Elchi3 merged commit 2c9b35b into mdn:main Nov 28, 2023
@queengooborg queengooborg deleted the css/selectors/closed-and-open/additions branch November 28, 2023 18:02
@josepharhar
Copy link

https://chromium-review.googlesource.com/c/chromium/src/+/4861035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants