mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibWeb: Deduplicate clipping code
This makes it so that PaintableWithLines no longer has its own bespoke clipping logic, using the same code as regular scroll/ overflow clipping.
This commit is contained in:
parent
155e60a5ff
commit
85883ee5ce
Notes:
github-actions[bot]
2025-05-13 12:32:43 +00:00
Author: https://github.com/Psychpsyo
Commit: 85883ee5ce
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4565
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/kalenikaliaksandr
7 changed files with 52 additions and 44 deletions
|
@ -7,7 +7,6 @@
|
|||
#container {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
border: 5px solid black;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
@ -5,15 +5,27 @@
|
|||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
#outer {
|
||||
/*
|
||||
This needs to be here so that the text is double-clipped.
|
||||
This happens in the reference and causes a slight difference
|
||||
in aliasing around the edges.
|
||||
*/
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
border: 5px solid black;
|
||||
border-radius: 50%;
|
||||
overflow: scroll;
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
<div id="outer">
|
||||
<div id="container">
|
||||
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
|
||||
|
@ -23,6 +35,7 @@
|
|||
non elit in vehicula. Etiam malesuada neque eu porta rhoncus. Curabitur vel nunc finibus ligula
|
||||
posuere venenatis.
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const scrollContainer = document.getElementById("container");
|
||||
scrollContainer.scrollTop = 300;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue