Skip to content

Truly independent web browser

930 B
Raw Blame
<!DOCTYPE html>
<link rel="match" href="../expected/inspector-highlighted-node-overlay-inside-empty-clip-ref.html" />
<!-- The highlighted element sits inside an ancestor whose overflow clip rect is empty, so all of its regular
     paint commands are dropped as invisible — but the inspector overlay ignores ancestor clips and must still
     be drawn. The reference paints the overlay for the same box without the empty clip (and with the content
     made invisible to match). -->
<style>
#outer {
  position: relative;
  width: 0;
  height: 0;
  overflow: hidden;
}
#inner {
  position: absolute;
  left: 50px;
  top: 50px;
  width: 100px;
  height: 100px;
  background-color: green;
}
</style>
<div id="outer"><div id="inner"></div></div>
<script>
if (!window.internals?.setHighlightedNode) {
  document.body.innerText = "FAIL";
} else {
  window.internals.setHighlightedNode(document.getElementById("inner"));
}
</script>