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

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

Issue 1204353004: Fix form association behavior when a form and a control with form= are removed from a document toge… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't add an assertion Created 5 years, 6 months 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/form-attribute-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
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()))
« no previous file with comments | « LayoutTests/fast/forms/form-attribute-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698