[WICG/webcomponents] Explicit support for nested forms inside ShadowRoots (Issue #981)

Reading through the [html standard](https://html.spec.whatwg.org/#association-of-controls-and-forms) there are a few mentions of disallowing nested forms.  What I've seen browsers do in this scenario is to strip the form tags as it parses.

I think it would be nice to update the html standard to explicitly state that this does **not** apply to nested ShadowDOM roots -- All three browser engines seem to work fine with this scenario, as long as the ShadowDOM content is appended from a cloned template.  I think that would be a good thing as I definitely see common scenarios where we would want to allow forms in a custom element, without telling consumers they cannot use the custom element inside a form.

However, Safari (16.4 TP, at least) exhibits different behavior from Chrome and Firefox when the innerHTML property is used to set the content.  In this scenario, the form tag *is* stripped, which kind of seems like a bug, except I'm not sure the standard is explicit enough on this whole topic to say whether it is a bug or a feature.

[Demo](https://codepen.io/bahrus/pen/jOpqyGN)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/981
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/981@github.com>

Received on Thursday, 29 December 2022 17:24:24 UTC