mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
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:
committed by
Alexander Kalenik
parent
eb860e2f10
commit
f68b6cd0f0
Notes:
github-actions[bot]
2026-02-06 11:28:38 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/f68b6cd0f0d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7519
27
Tests/LibWeb/Text/input/display_list/clip-invalidation.html
Normal file
27
Tests/LibWeb/Text/input/display_list/clip-invalidation.html
Normal 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>
|
||||
Reference in New Issue
Block a user