Auto merge of #29897 - Loirooriol:clearance-prevents-margin-collapse, r=mrobinson

Prevent margins from collapsing through when separated by clearance

This fixes #29884 and improves #29896.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29884 and improve #29896
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2023-06-20 23:22:41 +02:00 committed by GitHub
commit 07bbbad5f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 3 additions and 26 deletions

View file

@ -657,6 +657,7 @@ fn layout_in_flow_non_replaced_block_level(
collapsible_margins_in_children.collapsed_through &&
block_is_same_formatting_context &&
pbm.padding_border_sums.block == Length::zero() &&
clearance == Length::zero() &&
block_size.auto_is(|| Length::zero()) == Length::zero() &&
min_box_size.block == Length::zero();
},

View file

@ -1,2 +0,0 @@
[clear-after-top-margin.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-collapse-018.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-collapse-027.xht]
expected: FAIL

View file

@ -0,0 +1,2 @@
[no-clearance-due-to-large-margin-after-left-right.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[remove-block-before-self-collapsing-sibling-with-clearance.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_flow-row-wrap-reverse.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_flow-row-wrap.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_item-float.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_item-top-float.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_item-vertical-align.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_wrap-long.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_wrap-reverse.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flexbox_wrap.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[acid1_a.html]
expected: FAIL