mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb: Fix CSS clip-path ignoring scroll position
This commit is contained in:
parent
98691810b1
commit
8cd2fe3d08
Notes:
github-actions[bot]
2025-01-14 03:04:23 +00:00
Author: https://github.com/Psychpsyo Commit: https://github.com/LadybirdBrowser/ladybird/commit/8cd2fe3d085 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3247 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/Gingeh ✅
3 changed files with 41 additions and 0 deletions
|
@ -128,6 +128,9 @@ struct PushStackingContext {
|
|||
{
|
||||
source_paintable_rect.translate_by(offset);
|
||||
transform.origin.translate_by(offset.to_type<float>());
|
||||
if (clip_path.has_value()) {
|
||||
clip_path.value().transform(Gfx::AffineTransform().translate(offset.to_type<float>()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
18
Tests/LibWeb/Ref/expected/clip-path-scrolling.html
Normal file
18
Tests/LibWeb/Ref/expected/clip-path-scrolling.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
body {
|
||||
height: 200vh;
|
||||
position: relative;
|
||||
}
|
||||
div {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
background-color: green;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
<script>
|
||||
window.scrollTo(0, 100);
|
||||
</script>
|
20
Tests/LibWeb/Ref/input/clip-path-scrolling.html
Normal file
20
Tests/LibWeb/Ref/input/clip-path-scrolling.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="../expected/clip-path-scrolling.html" />
|
||||
<style>
|
||||
body {
|
||||
height: 200vh;
|
||||
position: relative;
|
||||
}
|
||||
div {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
background-color: green;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
<script>
|
||||
window.scrollTo(0, 100);
|
||||
</script>
|
Loading…
Add table
Reference in a new issue