Files
rust_browser/tests/goldens/fixtures/226-abspos-containing-block-chains.html
Zachary D. Rowitsch 327e31795b Implement positioning completeness (CSS 2.1 §10.3.7, §10.6.4, §11.1.2, §9.6.1)
Story 1.3: Complete positioning support including auto offset resolution,
clip rect, fixed scroll behavior, and containing block edge cases.

Key changes:
- Refactored calculate_absolute_layout() for full §10.3.7/§10.6.4 compliance
- Implemented clip: rect() parsing, style computation, layout, and paint
- Fixed sticky child recursion in process_deferred_absolutes
- Fixed shrink-to-fit abs_cb using unpositioned padding_box
- Added collapsed_borders handling in offset_children
- Propagated CSS clip to descendant stacking contexts
- Tightened rect() parser to reject garbage between rect and (
- Added tracing::warn for unrecognized clip tokens
- Replaced hardcoded epsilon with MARGIN_EPSILON constant
- Added RTL unimplemented comments on over-constrained resolution
- Strengthened tests: exact assertions, delta comparisons, new coverage
- 4 new tests: negative offsets, clip suppression, padding edge distinction
- 5 golden tests (222-226), promoted WPT absolute-tables-016

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

26 lines
730 B
HTML

<html>
<head>
<style>
body { margin: 0; }
/* A: relative with padding — CB for C */
.a { position: relative; width: 400px; height: 300px; padding: 20px; background-color: lightgray; }
/* B: static, does NOT establish CB */
.b { padding: 10px; }
/* C: absolute — CB is A's padding box */
.c { position: absolute; top: 30px; left: 30px; width: 200px; height: 120px; background-color: lightyellow; }
/* D: absolute inside C — CB is C's padding box */
.d { position: absolute; bottom: 10px; right: 10px; width: 60px; height: 40px; background-color: lightblue; }
</style>
</head>
<body>
<div class="a">
<div class="b">
<div class="c">
C content
<div class="d">D</div>
</div>
</div>
</div>
</body>
</html>