mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1556352 - Part 1: Do not set form owner from parser for form-associated custom element; r=smaug
See steps 14 of https://html.spec.whatwg.org/commit-snapshots/3ad5159be8f27e110a70cefadcb50fc45ec21b05/#create-an-element-for-the-token From spec perspective, FACE needs this in order to enqueue the formAssociated callback while FACE is inserted into document. Otherwise it would bail out in https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#association-of-controls-and-forms:parser-inserted-flag, and wouldn't run https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#reset-the-form-owner steps nor https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions:reset-the-form-owner From implementation perspective, we don't implement parser inserted flag, but we do update the form owner from parser. Not doing this would make the subsequent part which implements formAssociated callback a bit simpler, where we don't need to consider or handle the case that form owner is set from parser. Differential Revision: https://phabricator.services.mozilla.com/D129646
This commit is contained in:
parent
52ff56ab90
commit
3f791b5050
@ -645,6 +645,8 @@ void nsHtml5TreeOperation::SetFormElement(nsIContent* aNode,
|
||||
"The form element doesn't implement HTMLFormElement.");
|
||||
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(aNode));
|
||||
if (formControl &&
|
||||
formControl->ControlType() !=
|
||||
FormControlType::FormAssociatedCustomElement &&
|
||||
!aNode->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::form)) {
|
||||
formControl->SetForm(formElement);
|
||||
} else if (HTMLImageElement* domImageElement =
|
||||
|
Loading…
Reference in New Issue
Block a user