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>
39 lines
970 B
HTML
39 lines
970 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
.container {
|
|
position: relative;
|
|
width: 200px;
|
|
height: 150px;
|
|
background-color: lightgray;
|
|
z-index: 0;
|
|
}
|
|
/* z-index:auto positioned element should paint at step 6 */
|
|
.auto {
|
|
position: relative;
|
|
width: 80px;
|
|
height: 40px;
|
|
background-color: red;
|
|
/* z-index defaults to auto (not set) */
|
|
}
|
|
/* z-index:0 stacking context should also paint at step 6,
|
|
interleaved with auto in tree order */
|
|
.zero {
|
|
position: relative;
|
|
width: 80px;
|
|
height: 40px;
|
|
background-color: blue;
|
|
z-index: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="auto">Auto</div>
|
|
<div class="zero">Zero</div>
|
|
<div class="auto">Auto2</div>
|
|
</div>
|
|
</body>
|
|
</html>
|