Files
ladybird/Tests/LibWeb/Text/input/display_list/clip-path-invalidation.html
Aliaksandr Kalenik d208fa4316 Tests/LibWeb: Add failing test for clip-path invalidation
This test verifies that modifying clip-path via JavaScript properly
invalidates the accumulated visual context. Currently fails because the
clip-path in the display list remains unchanged after the style update.

Regression from 98afd82491.
2026-01-19 04:01:37 +01:00

27 lines
951 B
HTML

<!doctype html>
<script src="../include.js"></script>
<style>
.box {
width: 100px;
height: 100px;
background: lightblue;
clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}
</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.clipPath = "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)";
const displayListAfter = internals.dumpDisplayList();
println("Before clip-path change:");
println(displayListBefore);
println("After clip-path change:");
println(displayListAfter);
});
</script>