Files
rust_browser/tests/goldens/fixtures/217-z-index-three-level-nesting.html
Zachary D. Rowitsch 53dd6646b2 Implement stacking contexts and z-index per CSS 2.1 §9.9.1 / Appendix E
Root element now creates a stacking context unconditionally. Refactored
display list builder to correctly bucket stacking participants into three
groups (negative/zero/positive z-index) per Appendix E steps 2/6/7.
Fixed z-index:0 elements painting at step 7 instead of step 6, and
descendant stacking contexts being trapped inside positioned z-index:auto
ancestors instead of participating in the parent stacking context.

Added StackingBuckets struct, unified step-6 rendering with tree-order
merge by node_id, and 7 unit tests for creates_stacking_context().
Added 6 golden tests (213-218) and 4 integration tests asserting
paint-order invariants programmatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 19:30:31 -04:00

51 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<style>
.root {
position: relative;
width: 300px;
height: 200px;
background-color: lightgray;
z-index: 0;
}
.level1 {
position: absolute;
top: 10px;
left: 10px;
width: 200px;
height: 150px;
background-color: red;
z-index: 1;
}
.level2 {
position: absolute;
top: 10px;
left: 10px;
width: 150px;
height: 100px;
background-color: green;
z-index: 2;
}
.level3 {
position: absolute;
top: 10px;
left: 10px;
width: 100px;
height: 60px;
background-color: blue;
z-index: 3;
}
</style>
</head>
<body>
<div class="root">
<div class="level1">L1
<div class="level2">L2
<div class="level3">L3</div>
</div>
</div>
</div>
</body>
</html>