Index: Source/core/layout/HitTestResult.cpp |
diff --git a/Source/core/layout/HitTestResult.cpp b/Source/core/layout/HitTestResult.cpp |
index 8129c2799a98a5728f7103db2df6cbfe20610d6f..d9a94662efc02de935561e709f571a132580e7b3 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()) { |