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

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

Issue 425383002: Move highestAncestorOrSelf() from Node to NodeTraversal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 985b37cff00ef4c8949a3ade7c54d9a1fecdeca4..180b879bed9d1d4264643c4db60ee28de7fead93 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -167,13 +167,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 = highestAncestorOrSelf();
+ Node& root = NodeTraversal::highestAncestorOrSelf(*this);
if (!m_associatedElementsAreDirty) {
FormAssociatedElement::List elements(associatedElements());
notifyFormRemovedFromTree(elements, root);
} else {
FormAssociatedElement::List elements;
- collectAssociatedElements(insertionPoint->highestAncestorOrSelf(), elements);
+ collectAssociatedElements(NodeTraversal::highestAncestorOrSelf(*insertionPoint), elements);
notifyFormRemovedFromTree(elements, root);
collectAssociatedElements(root, elements);
notifyFormRemovedFromTree(elements, root);
@@ -184,7 +184,7 @@ void HTMLFormElement::removedFrom(ContainerNode* insertionPoint)
notifyFormRemovedFromTree(images, root);
} else {
WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> > images;
- collectImageElements(insertionPoint->highestAncestorOrSelf(), images);
+ collectImageElements(NodeTraversal::highestAncestorOrSelf(*insertionPoint), images);
notifyFormRemovedFromTree(images, root);
collectImageElements(root, images);
notifyFormRemovedFromTree(images, root);
@@ -617,7 +617,7 @@ const FormAssociatedElement::List& HTMLFormElement::associatedElements() const
HTMLFormElement* mutableThis = const_cast<HTMLFormElement*>(this);
Node* scope = mutableThis;
if (m_hasElementsAssociatedByParser)
- scope = &highestAncestorOrSelf();
+ scope = &NodeTraversal::highestAncestorOrSelf(*mutableThis);
if (inDocument() && treeScope().idTargetObserverRegistry().hasObservers(fastGetAttribute(idAttr)))
scope = &treeScope().rootNode();
ASSERT(scope);
@@ -639,7 +639,7 @@ const WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> >& HTMLFormElement::
{
if (!m_imageElementsAreDirty)
return m_imageElements;
- collectImageElements(m_hasElementsAssociatedByParser ? highestAncestorOrSelf() : *this, m_imageElements);
+ collectImageElements(m_hasElementsAssociatedByParser ? NodeTraversal::highestAncestorOrSelf(*this) : *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