Index: Source/core/layout/HitTestResult.cpp |
diff --git a/Source/core/layout/HitTestResult.cpp b/Source/core/layout/HitTestResult.cpp |
index e7242e52c132a7c11c14defd691470c8440b158d..865a6a023faefdd87633e51826361355795e9dc3 100644 |
--- a/Source/core/layout/HitTestResult.cpp |
+++ b/Source/core/layout/HitTestResult.cpp |
@@ -25,6 +25,7 @@ |
#include "core/HTMLNames.h" |
#include "core/dom/DocumentMarkerController.h" |
#include "core/dom/NodeRenderingTraversal.h" |
+#include "core/dom/shadow/ComposedTreeTraversal.h" |
#include "core/dom/shadow/ShadowRoot.h" |
#include "core/editing/FrameSelection.h" |
#include "core/fetch/ImageResource.h" |
@@ -220,7 +221,7 @@ String HitTestResult::title(TextDirection& dir) const |
dir = LTR; |
// Find the title in the nearest enclosing DOM node. |
// For <area> tags in image maps, walk the tree for the <area>, not the <img> using it. |
- for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode->parentNode()) { |
+ for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = ComposedTreeTraversal::parent(*titleNode)) { |
if (titleNode->isElementNode()) { |
String title = toElement(titleNode)->title(); |
if (!title.isNull()) { |