Closed Bug 1880036 Opened 9 months ago Closed 9 months ago

display property not updated on label when set through :has(>:disabled)

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 122
defect

Tracking

()

RESOLVED DUPLICATE of bug 1875137

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 for color, opacitiy or box-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.

https://flems.io/#0=N4IgtglgJlA2CmIBcA2A7AOgBwEYA0IAzvAgMYAu8UyIGphhIBAZhAo0gNqgB2AhmERJaAC3JhYTEKQD2PSvJoAeWHwBGJAASlVDALzMZMgHxKIPAA4BXcpvIBPC-D2kR8UgGs1MgB6boeubW5ABiRsaqGrCahjJKAPSRJMaaAD4AOjxKagBOxpmZZpY2do7Oru5evv5QgcWhRgBMpknROnz6sY0xMjl1wWEyza09QwmtKRlZufk8hSPt+mp8eUXBpU4ubp7efgFBNgBCKxHqWss542ewk4UzBVkHtg6bFTvV+-XHOc0q19q6Qh6C7dQx9J7fYb-EFXKK3aZ5B5-KIAjpA5YAL1MTw25W2VT2tQhfCxI0xsOSaTuiLmj3quK2lV2NX6RxJvwWgOB7J64K+7NOKMxjQpNypCNmdxs5DkLLU0rkxgAwgAZACSSoA0gl5eQZTxZlJiGRyBA5BwQAAGJCWgC01pQAE4QABfPC8ARCWgAK0YBFk8ngimEmV1+owch0EE8mj0mgAFABKWMpYCZTT+eqDDBQCCEdQIKCxzPBb45vMFqjF4kY8v5tSF4vkHJWeDpks2QaNOuVotx4k-HsNqv9-kY7u5+uNuPN1vt4jkAAqEEEMhs8aTemMaZ4GYzT2zk971f5OSH0475GOtaPw77MT4sGI7YPTXPI8vkPf95rE4rd+LZhH2fXdNDdTQcEtKDE0yF0jRIdxTXNGgsCQHBXXdEB+EEGg6AYKQAwUcgaFaDBYiQEQOnjYwkFvQtEzwTRaP-QsAGpSK6HcM0nCxVHsJAeDkeAAG5YMyUiLgoqiaME8h42YqcqETBimNk+S6KUzRWM0CSVkaLjNB4viBKE0SeBdcTrgwTEpMIaiTLkhTe2UxiHPUljNO03TxwM2RYF6JAcioMyLJ4eCTTNHgLUaND7RtV0AF0XSAA

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

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.)

Flags: needinfo?(dshin)

Yep - fixed by Bug 1875137.

Status: UNCONFIRMED → RESOLVED
Closed: 9 months ago
Duplicate of bug: 1875137
Flags: needinfo?(dshin)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.