Commit e1bacfb3 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: do not act on link click if there is selection

Selecting text that includes a link can unexpectedly open the link in
a new tab. This CL only allows link actions when the link has no
selection.

Bug: 783965
Change-Id: I790f85211a80809fdfce94cfce8ddecde2d0d5be
Reviewed-on: https://chromium-review.googlesource.com/764376Reviewed-by: 's avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516137}
parent 4ce68f88
......@@ -490,7 +490,7 @@ Components.Linkifier = class {
static _handleClick(event) {
var link = /** @type {!Element} */ (event.currentTarget);
event.consume(true);
if (UI.isBeingEdited(/** @type {!Node} */ (event.target)))
if (UI.isBeingEdited(/** @type {!Node} */ (event.target)) || link.hasSelection())
return;
var actions = Components.Linkifier._linkActions(link);
if (actions.length)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment