This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The Shadow DOM specification should specify the behavior of form elements if they cross shadow boundary. Specifically, it should clarify the behavior of pressing a submit button (or calling submit() method of the input element) in the following cases: (1) <form> - - - {shadow-root} | +-- <input type="submit"> (2) <form> - - - {shadow-root} | | | +-- <content></content> | +-- <input type="submit"> and encapsulation requirements of the following properties of form elements: * HTMLFormElement.elements, length, <getter>(unsigned long), <getter>(DOMString) * HTMLLabelElement.control * HTMLInputElement.form (and others)
Does this not cover it? http://www.w3.org/TR/shadow-dom/#html-forms
Oops, didn't notice that section. However, the current wording is somewhat vague: * "each shadow tree must scope its form elements and form-associated elements" - What does "scope" mean? * "the form submission must continue to work as specified" - What input elements are considered to be sent when the submit button is pressed? For example, <form> - - - {shadow-root} | | | +-- <input type="hidden" name="x" value="1"> | | | +-- <content select="#sub"></content> | +-- <input type="hidden" name="y" value="2"> | +-- <input id="sub" type="submit"> What should be sent if one presses the submit button? "x=1&y=2", "x=1", or "y=2"? What's the form owner of <input name="x">? What about <input name="y">? - In the example (1) above, <input> element's form owner is null, thus pressing the button does nothing; am I correct?
*** Bug 20320 has been marked as a duplicate of this bug. ***
I don't think that <input>s in a Shadow DOM should get any special behavior compared to other <input>s that are not in the document. I.e. I don't think they should submit with a <form> that lives in a document. See my comment in bug 25562 comment 6 for why. That said, I think that we should implement the system described here http://lists.w3.org/Archives/Public/public-webapps/2014JanMar/0448.html And we could even add special features for making it easier to submit <input>s that live in a Shadow DOM. One way to do that would be to add a .formData property on DocumentFragment or ShadowRoot. That way the implementation of .formData on a custom element would simply be function formData() { return this.shadowRoot.formData(); }
Moved to https://github.com/w3c/webcomponents/issues/65