mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
This test verifies that modifying the CSS clip property via JavaScript properly invalidates the accumulated visual context. Currently fails because the clip rect in the display list remains unchanged after the style update.
28 lines
930 B
HTML
28 lines
930 B
HTML
<!doctype html>
|
|
<script src="../include.js"></script>
|
|
<style>
|
|
.box {
|
|
position: absolute;
|
|
width: 100px;
|
|
height: 100px;
|
|
background: lightblue;
|
|
clip: rect(0px, 100px, 100px, 0px);
|
|
}
|
|
</style>
|
|
<div class="box" id="box">Box</div>
|
|
<script>
|
|
test(() => {
|
|
// NOTE: Display lists are captured first and printed later because println() modifies
|
|
// the DOM tree, causing layout updates that invalidate the accumulated visual context
|
|
// tree, which would affect the captured display lists.
|
|
const displayListBefore = internals.dumpDisplayList();
|
|
document.getElementById("box").style.clip = "rect(10px, 90px, 90px, 10px)";
|
|
const displayListAfter = internals.dumpDisplayList();
|
|
|
|
println("Before clip change:");
|
|
println(displayListBefore);
|
|
println("After clip change:");
|
|
println(displayListAfter);
|
|
});
|
|
</script>
|