mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
When highlighting something that does not correspond to a
`PaintableBox`, we still need to apply `AccumulatedVisualContext`s. In
that case, search for the closest `PaintableBox` ancestor and apply its
`AccumulatedVisualContext`
This bug is most easily observed by highlighting a text node on a page
that has a scrollbar and is scrolled down at least a bit.
This fixes a regression from 009ddd4823.
21 lines
573 B
HTML
21 lines
573 B
HTML
<!DOCTYPE html>
|
|
<link rel="match" href="../expected/inspector-highlighted-text-node-with-scroll-offset-ref.html" />
|
|
<style>
|
|
html {
|
|
height: calc(100vh + 200px);
|
|
scrollbar-width: none;
|
|
}
|
|
#spacer { height: 200px; }
|
|
</style>
|
|
<div id="spacer"></div>
|
|
<div id="highlight-parent">Hello world</div>
|
|
<script>
|
|
if (!window.internals?.setHighlightedNode) {
|
|
document.body.innerText = "FAIL";
|
|
} else {
|
|
window.scrollTo(0, 200);
|
|
const highlightParent = document.getElementById("highlight-parent");
|
|
window.internals.setHighlightedNode(highlightParent.childNodes[0]);
|
|
}
|
|
</script>
|