Files
rust_browser/tests/goldens/fixtures/212-margin-collapse-min-height.html
Zachary D. Rowitsch 0863153acd Implement parent-child margin collapsing (CSS 2.1 §8.3.1)
Add parent-first-child top and parent-last-child bottom margin collapsing
using a two-level approach (Level A shifts child inside parent, Level B
adjusts grandparent for effective collapsed margin). Fix pre-existing bug
in shift_subtree_x that incorrectly skipped absolute/fixed children.
Extract shared MARGIN_EPSILON constant, add 9 unit tests and 4 golden
tests (209-212), promote 31 WPT tests to pass. Includes code review
fixes: pub(crate) visibility for is_root_element, known-limitation docs,
and inline-content shift test coverage.

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

17 lines
407 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; }
.before { height: 10px; margin-bottom: 20px; background: lightblue; }
.min-h { min-height: 10px; margin-top: 15px; margin-bottom: 25px; background: lightgreen; }
.after { height: 10px; margin-top: 10px; background: lightyellow; }
</style>
</head>
<body>
<div class="before"></div>
<div class="min-h"></div>
<div class="after"></div>
</body>
</html>