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

Unified Diff: Source/core/html/HTMLFormElement.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/html/FormAssociatedElement.cpp ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormElement.cpp
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index cfb51cacf91998afe5f5dc2cbdac2188f85e7699..6c615226a531cd3db14e719fe047bbc28b9b5e67 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -136,13 +136,13 @@ void HTMLFormElement::removedFrom(ContainerNode* insertionPoint)
// We don't need to take care of form association by 'form' content
// attribute becuse IdTargetObserver handles it.
if (m_hasElementsAssociatedByParser) {
- Node& root = highestAncestor();
+ Node& root = highestAncestorOrSelf();
if (!m_associatedElementsAreDirty) {
Vector<FormAssociatedElement*> elements(associatedElements());
notifyFormRemovedFromTree(elements, root);
} else {
Vector<FormAssociatedElement*> elements;
- collectAssociatedElements(insertionPoint->highestAncestor(), elements);
+ collectAssociatedElements(insertionPoint->highestAncestorOrSelf(), elements);
notifyFormRemovedFromTree(elements, root);
collectAssociatedElements(root, elements);
notifyFormRemovedFromTree(elements, root);
@@ -153,7 +153,7 @@ void HTMLFormElement::removedFrom(ContainerNode* insertionPoint)
notifyFormRemovedFromTree(images, root);
} else {
Vector<HTMLImageElement*> images;
- collectImageElements(insertionPoint->highestAncestor(), images);
+ collectImageElements(insertionPoint->highestAncestorOrSelf(), images);
notifyFormRemovedFromTree(images, root);
collectImageElements(root, images);
notifyFormRemovedFromTree(images, root);
@@ -564,7 +564,7 @@ const Vector<FormAssociatedElement*>& HTMLFormElement::associatedElements() cons
HTMLFormElement* mutableThis = const_cast<HTMLFormElement*>(this);
Node* scope = mutableThis;
if (m_hasElementsAssociatedByParser)
- scope = &highestAncestor();
+ scope = &highestAncestorOrSelf();
if (inDocument() && treeScope().idTargetObserverRegistry().hasObservers(fastGetAttribute(idAttr)))
scope = &treeScope().rootNode();
ASSERT(scope);
@@ -586,7 +586,7 @@ const Vector<HTMLImageElement*>& HTMLFormElement::imageElements()
{
if (!m_imageElementsAreDirty)
return m_imageElements;
- collectImageElements(m_hasElementsAssociatedByParser ? highestAncestor() : *this, m_imageElements);
+ collectImageElements(m_hasElementsAssociatedByParser ? highestAncestorOrSelf() : *this, m_imageElements);
m_imageElementsAreDirty = false;
return m_imageElements;
}
« no previous file with comments | « Source/core/html/FormAssociatedElement.cpp ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698