Closed Bug 1875110 Opened 8 months ago Closed 8 months ago

When using `:has(select:disabled) { display: none }` in CSS, the style does not get removed when the disabled attribute is removed

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 122
defect

Tracking

()

RESOLVED DUPLICATE of bug 1875137

People

(Reporter: molovo, Assigned: dshin)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0

Steps to reproduce:

Writing the following CSS should cause the element to be hidden when it contains a disabled select:

.wrapper:has(select:disabled) {
  display: none;
}

However, when you remove the disabled attribute, the .wrapper element remains hidden. Other CSS properties appear to work correctly.

Example test case: https://codepen.io/molovo/pen/WNmpJEB

Actual results:

The element remains hidden after the disabled attribute is removed from the element within it.

Expected results:

The element should become visible when the disabled attribute is removed.

Blocks: has-issues
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Assignee: nobody → dshin
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: -- → S3

(Patching in :emilio's change in bug 1875137 fixes the testcase)

Status: NEW → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1875137
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.