Index: Source/core/testing/Internals.cpp |
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
index a9a177bf06a15e21e88355c1056a5739c267f57c..107e3bb01e5a5802f8bd006706e35089a1d3a6af 100644 |
--- a/Source/core/testing/Internals.cpp |
+++ b/Source/core/testing/Internals.cpp |
@@ -1498,8 +1498,12 @@ PassRefPtrWillBeRawPtr<StaticNodeList> Internals::nodesFromRect(Document* docume |
if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) { |
HitTestResult result(point); |
renderView->hitTest(request, result); |
- if (result.innerNode()) |
- matches.append(result.innerNode()->deprecatedShadowAncestorNode()); |
+ |
+ if (Node* innerNode = result.innerNode()) { |
+ if (innerNode->isInShadowTree()) |
+ innerNode = innerNode->shadowHost(); |
+ matches.append(innerNode); |
+ } |
} else { |
HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding); |
renderView->hitTest(request, result); |