Auto merge of #29803 - stshine:no-margins, r=Loirooriol

layout_2020: Only count for content size for height of non-replaced inline elements

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

Accorinding to https://drafts.csswg.org/css2/#inline-non-replaced, The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the line-height. But only the line-height is used when calculating the height of the line box.

---
<!-- 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

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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-03 03:27:56 +02:00 committed by GitHub
commit 053a0aa4fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 6 additions and 39 deletions

View file

@ -461,7 +461,7 @@ impl InlineBox {
margin.inline_start = Length::zero();
}
let mut start_corner = Vec2 {
block: padding.block_start + border.block_start + margin.block_start,
block: Length::zero(),
inline: ifc.inline_position - ifc.current_nesting_level.inline_start,
};
if style.clone_position().is_relative() {
@ -533,12 +533,7 @@ impl<'box_tree> PartialInlineBoxFragment<'box_tree> {
}
self.parent_nesting_level
.max_block_size_of_fragments_so_far
.max_assign(
fragment.content_rect.size.block +
fragment.padding.block_sum() +
fragment.border.block_sum() +
fragment.margin.block_sum(),
);
.max_assign(fragment.content_rect.size.block);
if let Some(context) = nesting_level.positioning_context.as_mut() {
context.layout_collected_children(layout_context, &mut fragment);

View file

@ -1,2 +0,0 @@
[background-root-017.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-width-applies-to-008.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[c5506-ipadn-t-002.xht]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[margin-bottom-applies-to-008.xht]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[margin-inline-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-inline-002.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-top-applies-to-008.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[block-in-inline-empty-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[inlines-002.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-visual-layout-018.xht]
expected: FAIL

View file

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

View file

@ -0,0 +1,2 @@
[item-with-table-with-infinite-max-intrinsic-width.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[table-with-infinite-max-intrinsic-width.html]
expected: FAIL

View file

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

View file

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

View file

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