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

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

Issue 239703007: Rename Node::lastDescendant() / Node::highestAncestor() for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename highestAncestor() as well Created 6 years, 8 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 | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | 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 c8d69c34ee269fa10103e37996f2b68176f3d61c..a34beaacfff356699497c7a6d6e2b5a1f84a626b 100644
--- a/Source/core/html/FormAssociatedElement.cpp
+++ b/Source/core/html/FormAssociatedElement.cpp
@@ -75,7 +75,7 @@ void FormAssociatedElement::didMoveToNewDocument(Document& oldDocument)
void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint)
{
- if (!m_formWasSetByParser || insertionPoint->highestAncestor() != m_form->highestAncestor())
+ if (!m_formWasSetByParser || insertionPoint->highestAncestorOrSelf() != m_form->highestAncestorOrSelf())
resetFormOwner();
if (!insertionPoint->inDocument())
@@ -93,7 +93,7 @@ void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint)
m_formAttributeTargetObserver = nullptr;
// 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 && element->highestAncestor() != m_form->highestAncestor())
+ if (m_form && element->highestAncestorOrSelf() != m_form->highestAncestorOrSelf())
resetFormOwner();
}
@@ -120,7 +120,7 @@ HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
void FormAssociatedElement::formRemovedFromTree(const Node& formRoot)
{
ASSERT(m_form);
- if (toHTMLElement(this)->highestAncestor() == formRoot)
+ if (toHTMLElement(this)->highestAncestorOrSelf() == formRoot)
return;
resetFormOwner();
}
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698