servo/components/layout_2020
Oriol Brufau 1f13e8b596
layout: Allow collapsing bottom margins with any indefinite block size (#36278)
According to CSS2, the bottom margin of a block container can collapse
with the bottom margin of its last in-flow child if `height` computes to
`auto`.

However, according to CSS Sizing, that was "legacy spec prose" and
should be interpreted as "behaves as `auto`".

Therefore, cyclic percentages and intrinsic keywords like `min-content`
shouldn't prevent margin collapse, because they behave as `auto`.

This change aligns Servo with Gecko and Blink, but diverges from WebKit.

https://www.w3.org/TR/CSS22/box.html#collapsing-margins
https://www.w3.org/TR/css-sizing/#behave-auto

Testing:
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-001.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-002.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-003.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-004.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-005.html`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-02 12:10:04 +00:00
..
display_list layout: Implement support for image-set() notation (#36210) 2025-03-29 13:20:16 +00:00
flexbox layout: Ensure compatible positioning context during flexbox block content sizing calculation (#36123) 2025-03-25 09:41:59 +00:00
flow layout: Allow collapsing bottom margins with any indefinite block size (#36278) 2025-04-02 12:10:04 +00:00
fragment_tree layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
table layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
taffy layout: Cache IndependentNonReplacedContents::layout() (#36082) 2025-03-24 12:33:44 +00:00
tests Migrate to the 2024 edition (#35755) 2025-03-13 10:28:11 +00:00
Cargo.toml Cleanup Stylo dependencies (#36046) 2025-03-19 08:53:26 +00:00
cell.rs layout: Remove the obsolete layout tracing functionality (#35001) 2025-01-15 13:24:14 +00:00
construct_modern.rs layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
context.rs layout: Implement support for image-set() notation (#36210) 2025-03-29 13:20:16 +00:00
dom.rs layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
dom_traversal.rs layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
formatting_contexts.rs layout: Cache IndependentNonReplacedContents::layout() (#36082) 2025-03-24 12:33:44 +00:00
geom.rs layout: Implement the fit-content() sizing function (#36056) 2025-03-23 14:26:44 +00:00
layout_box_base.rs layout: Cache IndependentNonReplacedContents::layout() (#36082) 2025-03-24 12:33:44 +00:00
lib.rs layout: Cache IndependentNonReplacedContents::layout() (#36082) 2025-03-24 12:33:44 +00:00
lists.rs layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
positioned.rs layout: Cache IndependentNonReplacedContents::layout() (#36082) 2025-03-24 12:33:44 +00:00
query.rs layout: Simplify and generalize the usage of pseudo-elements (#36202) 2025-03-29 12:41:04 +00:00
quotes.rs layout: Implement a non-recursive version of CSS quotes (#34770) 2025-02-27 16:00:21 +00:00
replaced.rs Animation: Aggregate Animated Image Info to Document (#36141) 2025-03-28 23:19:49 +00:00
sizing.rs layout: Implement the fit-content() sizing function (#36056) 2025-03-23 14:26:44 +00:00
style_ext.rs layout: Implement the fit-content() sizing function (#36056) 2025-03-23 14:26:44 +00:00
traversal.rs Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00