-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Handle continuation chain during hit-testing instead of after it
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.
- Loading branch information
Showing
4 changed files
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Tests/LibWeb/Text/expected/hit_testing/pointer-events-no-parent-extension.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<HTML> | ||
<#document> |
15 changes: 15 additions & 0 deletions
15
Tests/LibWeb/Text/input/hit_testing/pointer-events-no-parent-extension.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<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> |