| Index: Source/core/html/FormAssociatedElement.cpp
|
| diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp
|
| index d8257de9c9e85d802e9818f8cfce65f8279485c6..2ae9c8bf38e3298fbac292ff5a9978ac43918624 100644
|
| --- a/Source/core/html/FormAssociatedElement.cpp
|
| +++ b/Source/core/html/FormAssociatedElement.cpp
|
| @@ -99,8 +99,11 @@ void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint)
|
| void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint)
|
| {
|
| HTMLElement* element = toHTMLElement(this);
|
| - if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr))
|
| + if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr)) {
|
| setFormAttributeTargetObserver(nullptr);
|
| + resetFormOwner();
|
| + return;
|
| + }
|
| // If the form and element are both in the same tree, preserve the connection to the form.
|
| // Otherwise, null out our form and remove ourselves from the form's list of elements.
|
| if (m_form && NodeTraversal::highestAncestorOrSelf(*element) != NodeTraversal::highestAncestorOrSelf(*m_form.get()))
|
|
|