display property not updated on label when set through :has(>:disabled)
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: pygy79, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0
Steps to reproduce:
run this code:
<style>
</style>
label.foo:has(>:disabled) {
display:none;
}
<label class=foo><input type=checkbox id=inputFoo>label foo</label>
<script>
inputFoo.disabled = true
setTimeout(()=>{ inputFoo.disabled = false}, 1000)
</script>
Actual results:
The label content remains hidden when disabled is set to false.
Expected results:
It should reappear.
- This is only broken for
display
, but not forcolor
,opacitiy
orbox-shadow
. - AFAICT this only happens when the input is nested and the label is queried with
:has(>:disabled)
or:has(>:not(:disabled))
.
Here's a sandbox with that exhibits the problem, along with similar selectors, not all of which are broken.
Comment 1•9 months ago
|
||
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.
Comment 2•9 months ago
|
||
I think this might be fixed in Nightly -- dshin, maybe you can take a look and dupe if appropriate?
(I'm seeing the label remain hidden in Firefox 122 but not in Nightly 124.0a1 (2024-02-13), using the testcase linked in comment 0, when I click the button in that testcase and wait through the timeout.)
Comment 3•9 months ago
|
||
Yep - fixed by Bug 1875137.
Description
•