Commit 48044f12 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: fix tooltip logic for elements within shadow DOM

Tooltips only show when the mouse target is visible/has offsetParent.
Elements using shadow DOM can have <content> elements in the event
path, which may be visible despite having no offsetParent.

Bug: 847387
Change-Id: Ie5dab99d27146787ad7b14bdf95c7932af1e712d
Reviewed-on: https://chromium-review.googlesource.com/1077328Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563062}
parent 79cdf59c
...@@ -63,7 +63,7 @@ UI.Tooltip = class { ...@@ -63,7 +63,7 @@ UI.Tooltip = class {
for (const element of path) { for (const element of path) {
// The offsetParent is null when the element or an ancestor has 'display: none'. // The offsetParent is null when the element or an ancestor has 'display: none'.
if (element === this._anchorElement || element.offsetParent === null) { if (element === this._anchorElement || (element.nodeName !== 'CONTENT' && element.offsetParent === null)) {
return; return;
} else if (element[UI.Tooltip._symbol]) { } else if (element[UI.Tooltip._symbol]) {
this._show(element, mouseEvent); this._show(element, mouseEvent);
......
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