Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: Source/core/html/FormAssociatedElement.cpp

Issue 114783002: Merge 163680 "Fix a crash when a form control is in a past naems..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1700/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/forms/past-names-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « LayoutTests/fast/forms/past-names-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698