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

Unified Diff: Source/core/html/HTMLImageElement.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/HTMLFormElement.cpp ('k') | Source/core/inspector/PageConsoleAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index a4b9f9f298b2c8e3d58e96084ff91ec9f538b721..3e989662de648e7267eba659c3eccc5608b7fa51 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -31,6 +31,7 @@
#include "core/css/MediaValuesDynamic.h"
#include "core/css/parser/SizesAttributeParser.h"
#include "core/dom/Attribute.h"
+#include "core/dom/NodeTraversal.h"
#include "core/fetch/ImageResource.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLCanvasElement.h"
@@ -146,7 +147,7 @@ HTMLFormElement* HTMLImageElement::formOwner() const
void HTMLImageElement::formRemovedFromTree(const Node& formRoot)
{
ASSERT(m_form);
- if (highestAncestorOrSelf() != formRoot)
+ if (NodeTraversal::highestAncestorOrSelf(*this) != formRoot)
resetFormOwner();
}
@@ -296,7 +297,7 @@ void HTMLImageElement::attach(const AttachContext& context)
Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* insertionPoint)
{
- if (!m_formWasSetByParser || insertionPoint->highestAncestorOrSelf() != m_form->highestAncestorOrSelf())
+ if (!m_formWasSetByParser || NodeTraversal::highestAncestorOrSelf(*insertionPoint) != NodeTraversal::highestAncestorOrSelf(*m_form.get()))
resetFormOwner();
bool imageWasModified = false;
@@ -318,7 +319,7 @@ Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode*
void HTMLImageElement::removedFrom(ContainerNode* insertionPoint)
{
- if (!m_form || m_form->highestAncestorOrSelf() != highestAncestorOrSelf())
+ if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTraversal::highestAncestorOrSelf(*this))
resetFormOwner();
HTMLElement::removedFrom(insertionPoint);
}
« no previous file with comments | « Source/core/html/HTMLFormElement.cpp ('k') | Source/core/inspector/PageConsoleAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698