Commit dcd2afbb authored by Pavel Feldman's avatar Pavel Feldman Committed by Commit Bot

DevTools: do not render the inspect tool title if it covers the elements.

Bug: 947458
Change-Id: I117238860ade9c6fb86c4310c07c501306201196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1562575
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649769}
parent bfffb9fd
......@@ -594,6 +594,18 @@ function _createMaterialTooltip(parentElement, bounds, contentElement, withArrow
boxY = canvasHeight - arrowHalfWidth - titleHeight;
}
// If tooltip intersects with the bounds, hide it.
if (boxX < bounds.maxX && boxX + titleWidth > bounds.minX &&
boxY < bounds.maxY && boxY + titleHeight > bounds.minY) {
tooltipContent.style.display = 'none';
return;
}
if (boxX + titleWidth >= bounds.minX && boxX + titleWidth <= bounds.maxX && boxY + titleHeight >= bounds.minY && boxY + titleHeight <= bounds.maxY) {
tooltipContent.style.display = 'none';
return;
}
tooltipContent.style.top = boxY + "px";
tooltipContent.style.left = boxX + "px";
tooltipContent.style.setProperty('--arrow-visibility', arrowHidden ? 'hidden' : 'visible');
......
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