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

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 661103002: DevTools: make web component anchor handling go the generic route. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index c5679f348c0da0a0c342067ae510ca1f644ee02a..674b19fc52c7aad001f1d96248f8e15a71b41caa 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -378,13 +378,17 @@ WebInspector.Main.prototype = {
_documentClick: function(event)
{
- var anchor = event.target.enclosingNodeOrSelfWithNodeName("a");
+ var target = event.deepElementFromPoint();
+ var anchor = target.enclosingNodeOrSelfWithNodeName("a");
aandrey 2014/10/20 13:37:14 "Uncaught TypeError: Cannot read property 'enclosi
if (!anchor || !anchor.href)
return;
// Prevent the link from navigating, since we don't do any navigation by following links normally.
event.consume(true);
+ if (anchor.preventFollow)
+ return;
+
if (anchor.target === "_blank") {
InspectorFrontendHost.openInNewTab(anchor.href);
return;
@@ -392,7 +396,7 @@ WebInspector.Main.prototype = {
function followLink()
{
- if (WebInspector.isBeingEdited(event.target))
+ if (WebInspector.isBeingEdited(target))
return;
if (WebInspector.openAnchorLocationRegistry.dispatch({ url: anchor.href, lineNumber: anchor.lineNumber}))
return;

Powered by Google App Engine
This is Rietveld 408576698