Chromium Code Reviews| Index: Source/core/html/FormAssociatedElement.cpp |
| diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp |
| index d8257de9c9e85d802e9818f8cfce65f8279485c6..da0aa9cc755859c4a6916ca59287db51d19bbaff 100644 |
| --- a/Source/core/html/FormAssociatedElement.cpp |
| +++ b/Source/core/html/FormAssociatedElement.cpp |
| @@ -99,8 +99,12 @@ 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(); |
| + ASSERT(!m_form); |
|
tkent
2015/06/26 02:01:44
Some tests hit this. Investigating...
tkent
2015/06/26 03:49:16
According to the specification, ancestor form can
tkent
2015/06/26 03:51:54
Removed in Patch Set 2. PTAL.
|
| + 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())) |