Closed Bug 1404864 Opened 2 years ago Closed 2 years ago
Element .form works per spec in Shadow DOM
No description provided.
Cameron, which spec do you refer to? Can you attach URL on the bug?
I don't know that there is currently a problem. In bug 1404180 comment 6 smaug asked me to file this bug to make sure we get the behavior right. That bug was about associating form control elements with <form>s, so the stuff that happens in nsGenericHTMLElement::UpdateFormOwner. I think, although it's not exactly clear to me, that only <form> elements in the same shadow tree should be considered. https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#association-of-controls-and-forms We should also verify that we have the correct behavior for <fieldset> association, in nsGenericHTMLElement::UpdateFieldSet, when shadow trees are involved.
https://github.com/w3c/webcomponents/issues/196 So, we don't want to cross shadow tree boundaries when finding a form owner.
remote: View your changes here: remote: https://hg.mozilla.org/try/rev/eb1f4921a27daa8027f70808f2d1b81b11e97075 remote: https://hg.mozilla.org/try/rev/7f53d74a3588e714bca7fb5c2fc908ff8eda6399 remote: remote: Follow the progress of your build on Treeherder: remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7f53d74a3588e714bca7fb5c2fc908ff8eda6399 remote: recorded changegroup in replication log in 0.103s
Assignee: jessi3py → bugs
Status: NEW → ASSIGNED
Attachment #8975124 - Flags: review?(peterv)
Looks like there is a wpt test which passes with this change, TEST-UNEXPECTED-PASS | /shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-007.html | A_04_01_07_T02 So mozilla-central/testing/web-platform/meta/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-007.html.ini could be removed
Comment on attachment 8975124 [details] [diff] [review] form_attribute_in_shadow_dom.diff Review of attachment 8975124 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/html/nsGenericHTMLElement.cpp @@ +2134,3 @@ > > nsAutoString formId; > + DocumentOrShadowRoot* docOrShadow = GetUncomposedDocOrConnectedShadowRoot(); Nit: you could just assert non-null docOrShadow here instead? Not sure the assertion is very useful anyway, we'll crash immediately below.
Attachment #8975124 - Flags: review?(peterv) → review+
yeah, the assertion isn't too useful. I guess I should just remove it.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/69256fdf60d6 ensure HTMLInputElement.form works per spec in Shadow DOM, r=peterv
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/11077 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.