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: Fix clip box calculation in PaintableWithLines
All painting commands except SetClipRect are shifted by scroll offset before command list execution. This change removes scroll offset translation for sample/blit corner commands in `PaintableWithLines::paint` so it is only applied once in `CommandList::apply_scroll_offsets()`.
- Loading branch information
1 parent
7883afb
commit b9c01fd
Showing
3 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
Tests/LibWeb/Ref/paintablewithlines-corner-clip-in-scroll-container.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,50 @@ | ||
<!DOCTYPE html> | ||
<link rel="match" href="reference/paintablewithlines-corner-clip-in-scroll-container-ref.html" /> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
* { | ||
scrollbar-width: none; | ||
} | ||
|
||
#container { | ||
height: 500px; | ||
overflow: scroll; | ||
border: 1px solid black; | ||
} | ||
|
||
#padding { | ||
height: 300px; | ||
} | ||
|
||
#rounded-corners-mask { | ||
width: 300px; | ||
height: 300px; | ||
border-radius: 50%; | ||
overflow: hidden; | ||
overflow: scroll; | ||
font-size: 40px; | ||
background-color: orangered; | ||
} | ||
</style> | ||
<div id="container"> | ||
<div id="padding"></div> | ||
<div id="rounded-corners-mask"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ultrices neque | ||
eu nisi facilisis viverra. Integer lacinia, lacus vel condimentum suscipit, | ||
lacus felis porta nulla, eget lacinia sem neque ut neque. In sagittis, eros | ||
vel interdum porta, quam ex rhoncus lectus, vitae suscipit risus orci sit | ||
amet velit. Praesent imperdiet condimentum rutrum. Cras vitae nisl sapien. | ||
Curabitur ligula diam, tincidunt congue tincidunt nec, sodales nec orci. | ||
Vestibulum tincidunt non elit in vehicula. Etiam malesuada neque eu porta | ||
rhoncus. Curabitur vel nunc finibus ligula posuere venenatis. | ||
</div> | ||
<div id="padding"></div> | ||
</div> | ||
<script> | ||
const scrollContainer = document.getElementById("container"); | ||
scrollContainer.scrollTop = 300; | ||
</script> |
43 changes: 43 additions & 0 deletions
43
Tests/LibWeb/Ref/reference/paintablewithlines-corner-clip-in-scroll-container-ref.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,43 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
* { | ||
scrollbar-width: none; | ||
} | ||
|
||
#container { | ||
height: 500px; | ||
overflow: scroll; | ||
border: 1px solid black; | ||
} | ||
|
||
#padding { | ||
height: 300px; | ||
} | ||
|
||
#rounded-corners-mask { | ||
width: 300px; | ||
height: 300px; | ||
border-radius: 50%; | ||
overflow: hidden; | ||
overflow: scroll; | ||
font-size: 40px; | ||
background-color: orangered; | ||
} | ||
</style> | ||
<div id="container"> | ||
<div id="rounded-corners-mask"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ultrices neque | ||
eu nisi facilisis viverra. Integer lacinia, lacus vel condimentum suscipit, | ||
lacus felis porta nulla, eget lacinia sem neque ut neque. In sagittis, eros | ||
vel interdum porta, quam ex rhoncus lectus, vitae suscipit risus orci sit | ||
amet velit. Praesent imperdiet condimentum rutrum. Cras vitae nisl sapien. | ||
Curabitur ligula diam, tincidunt congue tincidunt nec, sodales nec orci. | ||
Vestibulum tincidunt non elit in vehicula. Etiam malesuada neque eu porta | ||
rhoncus. Curabitur vel nunc finibus ligula posuere venenatis. | ||
</div> | ||
</div> |
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