forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Use clip rectangles assigned to paintables in hit-testing
This change makes hit-testing more consistent in the handling of hidden overflow by reusing the same clip-rectangles. Also, it fixes bugs where the box is visible for hit-testing even though it is clipped by the hidden overflow of the containing block.
- Loading branch information
1 parent
5dcd68f
commit 8eceb9f
Showing
8 changed files
with
64 additions
and
28 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/hit_testing/click-outside-of-box-with-hidden-overflow.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 @@ | ||
<HTML > |
1 change: 1 addition & 0 deletions
1
.../LibWeb/Text/expected/hit_testing/click-outside-of-box-with-lines-and-hidden-overflow.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 @@ | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan semper massa ut pharetra. Nunc vitae lorem at odio facilisis vehicula nec ut nibh. Duis ornare nibh orci, nec mollis est mollis ac. Aenean ultricies condimentum interdum. In eu elit vestibulum, sollicitudin lectus vel, congue nibh. Morbi vitae nunc in tortor ultrices aliquet sit amet a turpis. Phasellus ut dui sodales, dictum sem ut, efficitur tellus. Etiam eu orci et magna suscipit dignissim nec et sem. Aenean quam erat, euismod eu faucibus et, placerat ut dolor. <HTML > |
23 changes: 23 additions & 0 deletions
23
Tests/LibWeb/Text/input/hit_testing/click-outside-of-box-with-hidden-overflow.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,23 @@ | ||
<script src="../include.js"></script> | ||
<style> | ||
.overflow-hidden { | ||
overflow: hidden; | ||
border: 1px solid black; | ||
width: 200px; | ||
height: 200px; | ||
} | ||
|
||
#box { | ||
width: 400px; | ||
height: 400px; | ||
background-color: red; | ||
} | ||
</style> | ||
<div class="overflow-hidden"> | ||
<div id="box"></div> | ||
</div> | ||
<script type="text/javascript"> | ||
test(() => { | ||
printElement(internals.hitTest(300, 300).node); | ||
}); | ||
</script> |
29 changes: 29 additions & 0 deletions
29
Tests/LibWeb/Text/input/hit_testing/click-outside-of-box-with-lines-and-hidden-overflow.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,29 @@ | ||
<script src="../include.js"></script> | ||
<style> | ||
.overflow-hidden { | ||
overflow: hidden; | ||
border: 1px solid black; | ||
width: 200px; | ||
height: 200px; | ||
} | ||
|
||
#box { | ||
width: 400px; | ||
height: 400px; | ||
} | ||
</style> | ||
<div class="overflow-hidden"> | ||
<div id="box"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan semper massa | ||
ut pharetra. Nunc vitae lorem at odio facilisis vehicula nec ut nibh. Duis ornare nibh orci, | ||
nec mollis est mollis ac. Aenean ultricies condimentum interdum. In eu elit vestibulum, | ||
sollicitudin lectus vel, congue nibh. Morbi vitae nunc in tortor ultrices aliquet sit amet a | ||
turpis. Phasellus ut dui sodales, dictum sem ut, efficitur tellus. Etiam eu orci et magna | ||
suscipit dignissim nec et sem. Aenean quam erat, euismod eu faucibus et, placerat ut dolor. | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
test(() => { | ||
printElement(internals.hitTest(300, 300).node); | ||
}); | ||
</script> |
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
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