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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp

Issue 2763913002: Allow DOM.getNodeForLocation to skip to nearest non-shadow ancestor (Closed)
Patch Set: Use Common.moduleSettings value to in/exclude UA shadow dom Created 3 years, 9 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
Index: third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
index dfeeadc2e1a1f25d6f671b2bab63d682f4bcf3ea..afcfbc36ff85a42146a09903e4f9378f88d7b9ba 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1471,7 +1471,13 @@ Response InspectorDOMAgent::getBoxModel(
return Response::OK();
}
-Response InspectorDOMAgent::getNodeForLocation(int x, int y, int* nodeId) {
+Response InspectorDOMAgent::getNodeForLocation(
+ int x,
+ int y,
+ Maybe<bool> optionalIncludeUserAgentShadowDOM,
+ int* nodeId) {
+ bool includeUserAgentShadowDOM =
+ optionalIncludeUserAgentShadowDOM.fromMaybe(false);
Response response = pushDocumentUponHandlelessOperation();
if (!response.isSuccess())
return response;
@@ -1479,6 +1485,8 @@ Response InspectorDOMAgent::getNodeForLocation(int x, int y, int* nodeId) {
HitTestRequest::AllowChildFrameContent);
HitTestResult result(request, IntPoint(x, y));
m_document->frame()->contentLayoutItem().hitTest(result);
+ if (!includeUserAgentShadowDOM)
+ result.setToShadowHostIfInRestrictedShadowRoot();
Node* node = result.innerPossiblyPseudoNode();
while (node && node->getNodeType() == Node::kTextNode)
node = node->parentNode();

Powered by Google App Engine
This is Rietveld 408576698