| Index: Source/core/html/FormAssociatedElement.cpp
|
| ===================================================================
|
| --- Source/core/html/FormAssociatedElement.cpp (revision 163824)
|
| +++ Source/core/html/FormAssociatedElement.cpp (working copy)
|
| @@ -122,8 +122,10 @@
|
| void FormAssociatedElement::formRemovedFromTree(const Node* formRoot)
|
| {
|
| ASSERT(m_form);
|
| - if (toHTMLElement(this)->highestAncestor() != formRoot)
|
| - setForm(0);
|
| + if (toHTMLElement(this)->highestAncestor() == formRoot)
|
| + return;
|
| + RefPtr<HTMLElement> protector(toHTMLElement(this));
|
| + setForm(0);
|
| }
|
|
|
| void FormAssociatedElement::setForm(HTMLFormElement* newForm)
|
|
|