Nightly: Firefox doesn't respect radio groups in shadow DOM

RESOLVED FIXED in Firefox 63

Status

()

defect
P2
normal
RESOLVED FIXED
7 months ago
a month ago

People

(Reporter: caleb.d.williams, Assigned: smaug)

Tracking

({nightly-community})

64 Branch
mozilla64
Points:
---

Firefox Tracking Flags

(firefox63 fixed, firefox64 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

7 months ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36

Steps to reproduce:

Testing a component that includes generated radio buttons inside a shadow root. Buttons with the same name are not counted as part of the same group and will allow you to select multiple options.

There is a reproduction at https://codepen.io/calebdwilliams/pen/GXxEMv


Actual results:

Multiple radio buttons can be selected.


Expected results:

A single radio button should be selected similar to the light DOM.
(Reporter)

Updated

7 months ago
Component: Untriaged → DOM
Product: Firefox → Core
Priority: -- → P2
(Assignee)

Comment 1

7 months ago
Posted file testcase
(Assignee)

Updated

7 months ago
Assignee: nobody → bugs
(Assignee)

Comment 2

7 months ago
remote: adding changesets                                                                                                                                                                     
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 9 changes to 9 files (+1 heads)
remote: recorded push in pushlog
remote: 
remote: View your change here:
remote:   https://hg.mozilla.org/try/rev/989490ac7af27b9bbc9a243410035527b0331a79
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=989490ac7af27b9bbc9a243410035527b0331a79
remote: recorded changegroup in replication log in 0.018s

Not quite sure who should review this.


The patch is basically just moving implementation of radio group handling from nsDocument to DocumentOrShadowRoot. nsDocument and ShadowRoot themselves still need to inherit the actual interface, since we have tons of code expecting that nsIDocument doesn't multiple inherit nsISupports.

Code moves are annoying to review.

Note, I'm not trying to make us to follow the spec in disconnected trees. That would be a different bug, but way too risky change for beta (I'd prefer to get this to beta). And that has nothing to do with shadow DOM.
Attachment #9010674 - Flags: review?(ehsan)

Comment 3

7 months ago
Comment on attachment 9010674 [details] [diff] [review]
shadow_radio.diff

Review of attachment 9010674 [details] [diff] [review]:
-----------------------------------------------------------------

Makes sense.
Attachment #9010674 - Flags: review?(ehsan) → review+

Comment 4

7 months ago
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bfb9062ec18b
radio groups should work in shadow DOM, r=ehsan
(Assignee)

Comment 5

7 months ago
Comment on attachment 9010674 [details] [diff] [review]
shadow_radio.diff

Approval Request Comment
[Feature/Bug causing the regression]: Not a regression, but new feature, bug 1205323
[User impact if declined]: possibly broken behavior
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: just landed to m-i
[Needs manual test from QE? If yes, steps to reproduce]:  I don't think so
[List of other uplifts needed for the feature/fix]: NA
[Is the change risky?]: not too
[Why is the change risky/not risky?]: Mostly just moving code upper in the class hierarchy so that it can be used also by ShadowRoot
[String changes made/needed]: NA
Attachment #9010674 - Flags: approval-mozilla-beta?

Comment 6

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/bfb9062ec18b
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/13138 for changes under testing/web-platform/tests
Comment on attachment 9010674 [details] [diff] [review]
shadow_radio.diff

Fix with tests for a 63 feature, uplift approved for 63 beta 9, thanks.
Attachment #9010674 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Can't merge web-platform-tests PR due to failing upstream checks:
Github PR https://github.com/web-platform-tests/wpt/pull/13138
* Taskcluster (pull_request) (https://tools.taskcluster.net/task-group-inspector/#/CtHEkkUBTi6gnnL9D8EovQ)
Upstream PR merged
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.