Tests/LibWeb: Add failing test for clip property invalidation

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.
This commit is contained in:
Aliaksandr Kalenik
2026-01-19 03:36:07 +01:00
committed by Alexander Kalenik
parent eb860e2f10
commit f68b6cd0f0
Notes: github-actions[bot] 2026-02-06 11:28:38 +00:00
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<!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>