Index: Source/core/html/HTMLImageElement.cpp |
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp |
index 205e0bad15aaee7c3d0ede62c4664317799e9b9a..f7bd98a18f95fb54b6e865414260d07a5ac7c274 100644 |
--- a/Source/core/html/HTMLImageElement.cpp |
+++ b/Source/core/html/HTMLImageElement.cpp |
@@ -127,7 +127,7 @@ HTMLFormElement* HTMLImageElement::formOwner() const |
void HTMLImageElement::formRemovedFromTree(const Node& formRoot) |
{ |
ASSERT(m_form); |
- if (highestAncestor() != formRoot) |
+ if (highestAncestorOrSelf() != formRoot) |
resetFormOwner(); |
} |
@@ -228,7 +228,7 @@ void HTMLImageElement::attach(const AttachContext& context) |
Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* insertionPoint) |
{ |
- if (!m_formWasSetByParser || insertionPoint->highestAncestor() != m_form->highestAncestor()) |
+ if (!m_formWasSetByParser || insertionPoint->highestAncestorOrSelf() != m_form->highestAncestorOrSelf()) |
resetFormOwner(); |
// If we have been inserted from a renderer-less document, |
@@ -241,7 +241,7 @@ Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* |
void HTMLImageElement::removedFrom(ContainerNode* insertionPoint) |
{ |
- if (!m_form || m_form->highestAncestor() != highestAncestor()) |
+ if (!m_form || m_form->highestAncestorOrSelf() != highestAncestorOrSelf()) |
resetFormOwner(); |
HTMLElement::removedFrom(insertionPoint); |
} |