mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
My previous attempt at resolving the continuation chain tried to deal with `pointer-events: none` by repeatedly falling back to the parent paintable until one was found that _would_ want to handle pointer events. But since we were no longer performing hit-tests on those paintables, false positives could pop up. This could happen for out-of-flow block elements that did not overlap with their parent rects, for example. This approach works much better since it only handles the continuation case that's relevant (the "middle" anonymous box) and it does so during hit-testing instead of after, allowing all the other relevant logic to come into play.
15 lines
456 B
HTML
15 lines
456 B
HTML
<script src="../include.js"></script>
|
|
<body>
|
|
<div>
|
|
<!-- this div should not be hit, nor should its parent -->
|
|
<div id="a1" style="position: fixed; width: 100px; height: 100px; pointer-events: none"></div>
|
|
foobar
|
|
</div>
|
|
</body>
|
|
<script>
|
|
test(() => {
|
|
const hit = internals.hitTest(a1.offsetLeft + 50, a1.offsetTop + 80);
|
|
printElement(hit.node);
|
|
printElement(hit.node.parentNode);
|
|
});
|
|
</script>
|