Closed Bug 1936113 Opened 2 months ago Closed 15 days ago

Implement CSS :open pseudo-class

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
relnote-firefox --- ?
firefox136 --- fixed

People

(Reporter: jarhar, Assigned: jfkthame)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(5 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

Steps to reproduce:

Use :open in CSS

Actual results:

Selector is not matched

Expected results:

The :open CSS pseudo-class is being added to the HTML spec and will be shipped in chrome soon:

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Severity: -- → S3
Type: defect → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true

Trivial doc cleanup that I noticed when going to edit this file.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

This enables us to parse the pseudo, but it's not yet connected to anything.

Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4ee0855e448f Remove mention of obsolete param from the pseudo_class_macro comment. r=dshin https://hg.mozilla.org/integration/autoland/rev/716bdadbea2a Parse :open pseudo-class in the style system. r=dshin https://hg.mozilla.org/integration/autoland/rev/9cfc0a675a42 Hook up :open to details, select, dialog, and input elements. r=webidl,emilio https://hg.mozilla.org/integration/autoland/rev/a88e93dff614 Add a couple of reftests for the :open pseudo-class. r=dshin https://hg.mozilla.org/integration/autoland/rev/2b07b9e7bf57 Update metadata for WPT tests that now pass. r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50135 for changes under testing/web-platform/tests

(In reply to Atila Butkovits from comment #8)

Backed out for causing failures at select-inside-top-layer.tentative.html.

Backout link: https://hg.mozilla.org/integration/autoland/rev/a7690617e71a8713537695a0ea5d07ba443da7cb

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=2b07b9e7bf57cf8358e546b7fe4141babe72f541

Failure log: https://treeherder.mozilla.org/logviewer?job_id=490559485&repo=autoland&lineNumber=2810

Ah, I see.... tests involving <select> fail on android, because the widget is completely different there, and the openInParentProcess thing doesn't apply to it. I'll mark these as (still) failing for now, and file a followup bug.

Flags: needinfo?(jfkthame)
Upstream PR was closed without merging
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/afae9b8eaceb Remove mention of obsolete param from the pseudo_class_macro comment. r=dshin https://hg.mozilla.org/integration/autoland/rev/27e814df42ec Parse :open pseudo-class in the style system. r=dshin https://hg.mozilla.org/integration/autoland/rev/3bfcd49c0bc8 Hook up :open to details, select, dialog, and input elements. r=webidl,emilio https://hg.mozilla.org/integration/autoland/rev/6d39e75391fa Add a couple of reftests for the :open pseudo-class. r=dshin https://hg.mozilla.org/integration/autoland/rev/bd6fe64b89d7 Update metadata for WPT tests that now pass. r=dshin
Upstream PR merged by moz-wptsync-bot

:jfkthame could you consider nominating this for a release note? (Process info)

Flags: needinfo?(jfkthame)
Blocks: 1942465

Release Note Request (optional, but appreciated)

[Why is this notable]: This pseudo-class allows authors to easily target openable elements such as <details> according to whether they are in their opened or closed state, e.g. to change the style of the Summary when a <details> element is expanded.

[Suggested wording]: Firefox now supports the CSS :open pseudo-class for styling elements can be toggled “open” to display more content

No longer blocks: 1942465
relnote-firefox: --- → ?
Flags: needinfo?(jfkthame)
Keywords: dev-doc-needed
Blocks: 1942465

Thanks, added to the Fx136 nightly release notes, please allow 30 minutes for the site to update.
Keeping the relnote-firefox flag as ? to keep it on the radar for inclusion in the final Fx136 release notes.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: