mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-05 15:27:04 +00:00
LibWeb: Fix CSS clip-path ignoring scroll position
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user