Closed Bug 1861346 Opened 7 months ago Closed 6 months ago

Radio inputs after checked input have indeterminate style on page load

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

VERIFIED FIXED
121 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox119 --- verified
firefox120 --- verified
firefox121 --- verified

People

(Reporter: julian, Assigned: emilio)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(6 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

I have a group of radio buttons that use the :indeterminate CSS selector. A minimal reproducible example follows:

CSS:

input[type=radio]:indeterminate + label {
  background: red;
}
input[type=radio]:checked + label {
  background: green;
}

HTML:

<form>
  <input type="radio" name="a" id="one" value="1">
  <label for="one">One</label>
  
  <input type="radio" name="a" id="two" value="2" checked> 
  <label for="two">Two</label>
  
  <input type="radio" name="a" id="three" value="3"> 
  <label for="three">Three</label>
  
  <input type="radio" name="a" id="four" value="4"> 
  <label for="four">Four</label>
</form>

Tested on:

  • Windows 11 22H2 / Firefox Nightly 121.0a1 (2023-10-25) (64-bit)
  • Ubuntu 22.04.3 (WSL2) / Firefox Nightly 121.0a1 (2023-10-25) (64-bit)

Actual results:

The radio inputs following the checked radio will have the :indeterminate style applied, i.e. have a red label background on page load.

Selecting a different input removes the :indeterminate style on all radio inputs in the group.

Expected results:

If one radio input in a group is checked, none of the inputs in the same group should have :indeterminate applied.

I also confirmed this works as expected in other browsers.

Summary: Radio inputs after checked input have indeterminate style → Radio inputs after checked input have indeterminate style on page load

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
Attached file reporter's testcase

:emilio, since you are the author of the regressor, bug 1850293, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c50d066111a
Update indeterminate state when getting added or removed from a radio group. r=smaug
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42826 for changes under testing/web-platform/tests

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox120 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Attachment #9360972 - Flags: approval-mozilla-beta?
Flags: needinfo?(emilio)

Uplift Approval Request

  • Steps to reproduce for manual QE testing: comment 0
  • Code covered by automated testing: yes
  • User impact if declined: comment 0
  • String changes made/needed: none
  • Is Android affected?: yes
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Very simple tweak.
  • Needs manual QE test: yes
  • Fix verified in Nightly: yes
Flags: qe-verify+

Comment on attachment 9360972 [details]
Bug 1861346 - Update indeterminate state when getting added or removed from a radio group. r=edgar,smaug

Approved for 120.0b5

Attachment #9360972 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triaged]
Upstream PR was closed without merging

:emilio wha'ts the severity on this?
Is this safe to get a release uplift request for inclusion in next week's dot release?

Flags: needinfo?(emilio)
Attachment #9361185 - Flags: approval-mozilla-release?

Uplift Approval Request

  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Explanation of risk level: Trivial well-scoped change.
  • Risk associated with taking this patch: low
  • Is Android affected?: yes
  • String changes made/needed: none
  • User impact if declined: See above
  • Code covered by automated testing: yes
  • Steps to reproduce for manual QE testing: comment 0

Yeah

Flags: needinfo?(emilio)

Verified as fixed on Firefox 121.0a1 (2023-10-31) on Windows 11 x64, macOS 11.6 and on Ubuntu 20.04 x64.

Verified as fixed on Firefox 120.0b5 on Windows 11 x64, macOS 11.6 and on Ubuntu 20.04 x64.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+

Comment on attachment 9361185 [details]
Bug 1861346 - Update indeterminate state when getting added or removed from a radio group. r=edgar,smaug

Approved for 119.0.1

Attachment #9361185 - Flags: approval-mozilla-release? → approval-mozilla-release+

Comment on attachment 9361185 [details]
Bug 1861346 - Update indeterminate state when getting added or removed from a radio group. r=edgar,smaug

Setting the approval back to pending
The patch failed to land due to conflicts
https://lando.services.mozilla.com/D192322/

Flags: needinfo?(emilio)
Attachment #9361185 - Flags: approval-mozilla-release+ → approval-mozilla-release?
Attachment #9362022 - Flags: approval-mozilla-release?

Uplift Approval Request

  • Needs manual QE test: yes
  • User impact if declined: comment 0
  • Explanation of risk level: trivialish fix
  • Risk associated with taking this patch: low
  • Code covered by automated testing: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Is Android affected?: yes
  • String changes made/needed: none
  • Fix verified in Nightly: yes
Flags: qe-verify+

comment 24 is a rebase.

Flags: needinfo?(emilio)

Comment on attachment 9362022 [details]
Bug 1861346 - Update indeterminate state when getting added or removed from a radio group.

Thanks
Approved for 119.0.1

Attachment #9362022 - Flags: approval-mozilla-release? → approval-mozilla-release+

Comment on attachment 9361185 [details]
Bug 1861346 - Update indeterminate state when getting added or removed from a radio group. r=edgar,smaug

Rejecting uplift request, replaced with Comment 24

Attachment #9361185 - Flags: approval-mozilla-release? → approval-mozilla-release-

Backed out for causing build failures in release.

Backout:
https://hg.mozilla.org/releases/mozilla-release/rev/ff4255011d2c4eb5e7454df4bbca950b56aa1808

Failures:
https://treeherder.mozilla.org/jobs?repo=mozilla-release&revision=f8c9a830f7b6de5fbca49073fdbb9ada484bf4d2

/dom/html/HTMLInputElement.cpp:6254:27: error: use of undeclared identifier 'container'
bool indeterminate = !container->GetCurrentRadioButton(name);
/dom/html/HTMLInputElement.cpp:6254:60: error: use of undeclared identifier 'name'
bool indeterminate = !container->GetCurrentRadioButton(name);

Flags: needinfo?(emilio)
Attached file Fixed-up release patch

Ah, yeah, so this depends on bug 1685926. Here's a fixed up patch to not depend on it.

Flags: needinfo?(emilio) → needinfo?(dmeehan)
Flags: needinfo?(dmeehan)
Attachment #9362022 - Flags: approval-mozilla-release+

Comment on attachment 9362090 [details]
Fixed-up release patch

Approved for 119.0.1

Attachment #9362090 - Flags: approval-mozilla-release+
Attachment #9361185 - Attachment is obsolete: true

Verified as fixed on Firefox 119.0.1 on Windows 11 x64, macOS 11.6 and on Ubuntu 20.04 x64

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: