mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
When z-index changes from 0 to a positive value on a positioned element, the stacking context tree is not rebuilt, causing the element to be painted twice. This test captures the current (incorrect) behavior.
31 lines
957 B
HTML
31 lines
957 B
HTML
<!doctype html>
|
|
<script src="../include.js"></script>
|
|
<style>
|
|
.container { position: relative; width: 200px; height: 200px; }
|
|
.target {
|
|
position: absolute;
|
|
z-index: 0;
|
|
width: 50px;
|
|
height: 50px;
|
|
background: blue;
|
|
}
|
|
</style>
|
|
<div class="container">
|
|
<div class="target" id="target"></div>
|
|
</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 dlBefore = internals.dumpDisplayList();
|
|
document.getElementById("target").style.zIndex = "10";
|
|
const dlAfter = internals.dumpDisplayList();
|
|
|
|
println("Before z-index change:");
|
|
println(dlBefore);
|
|
println("After z-index change:");
|
|
println(dlAfter);
|
|
});
|
|
</script>
|