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

Unified Diff: third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js

Issue 2702523003: [DevTools] Continue GlassPane refactoring. (Closed)
Patch Set: element Created 3 years, 10 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/devtools/front_end/dom_extension/DOMExtension.js
diff --git a/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js b/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js
index e073412aaef621871c76c4c8ae4433e359a8cd6b..dd12c013026953a83e5d8512b85c04db19ccdcba 100644
--- a/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js
+++ b/third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js
@@ -758,9 +758,15 @@ Event.prototype.deepElementFromPoint = function() {
* @return {?Node}
*/
Document.prototype.deepElementFromPoint = function(x, y) {
- var node = this.elementFromPoint(x, y);
- while (node && node.shadowRoot)
- node = node.shadowRoot.elementFromPoint(x, y);
+ var container = this;
+ var node = null;
+ while (container) {
+ var innerNode = container.elementFromPoint(x, y);
+ if (!innerNode)
+ break;
+ node = innerNode;
+ container = node.shadowRoot;
+ }
return node;
};
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698