mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Fix CSS clip-path ignoring scroll position
This commit is contained in:
parent
98691810b1
commit
8cd2fe3d08
|
|
@ -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…
Reference in New Issue
Block a user