mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Take spaces into account in the max-content size of an IFC (#31613)
They were only considered in min-content sizes. Also avoid some pointless conversions from Au to Length. Fixes #31605.
This commit is contained in:
parent
a6e25d555b
commit
de7b9bed85
6 changed files with 12 additions and 21 deletions
|
@ -2215,7 +2215,7 @@ struct ContentSizesComputation<'a> {
|
||||||
paragraph: ContentSizes,
|
paragraph: ContentSizes,
|
||||||
current_line: ContentSizes,
|
current_line: ContentSizes,
|
||||||
/// Size for whitepsace pending to be added to this line.
|
/// Size for whitepsace pending to be added to this line.
|
||||||
pending_whitespace: Length,
|
pending_whitespace: Au,
|
||||||
/// Whether or not this IFC has seen any non-whitespace content.
|
/// Whether or not this IFC has seen any non-whitespace content.
|
||||||
had_non_whitespace_content_yet: bool,
|
had_non_whitespace_content_yet: bool,
|
||||||
/// Stack of ending padding, margin, and border to add to the length
|
/// Stack of ending padding, margin, and border to add to the length
|
||||||
|
@ -2270,14 +2270,13 @@ impl<'a> ContentSizesComputation<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for run in segment.runs.iter() {
|
for run in segment.runs.iter() {
|
||||||
let advance = Length::from(run.glyph_store.total_advance());
|
let advance = run.glyph_store.total_advance();
|
||||||
|
|
||||||
if !run.glyph_store.is_whitespace() {
|
if !run.glyph_store.is_whitespace() {
|
||||||
self.had_non_whitespace_content_yet = true;
|
self.had_non_whitespace_content_yet = true;
|
||||||
self.current_line.min_content += advance.into();
|
self.current_line.min_content += advance;
|
||||||
self.current_line.max_content +=
|
self.current_line.max_content += self.pending_whitespace + advance;
|
||||||
(self.pending_whitespace + advance).into();
|
self.pending_whitespace = Au::zero();
|
||||||
self.pending_whitespace = Length::zero();
|
|
||||||
} else {
|
} else {
|
||||||
// If this run is a forced line break, we *must* break the line
|
// If this run is a forced line break, we *must* break the line
|
||||||
// and start measuring from the inline origin once more.
|
// and start measuring from the inline origin once more.
|
||||||
|
@ -2307,10 +2306,9 @@ impl<'a> ContentSizesComputation<'a> {
|
||||||
self.containing_block_writing_mode,
|
self.containing_block_writing_mode,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.current_line.min_content +=
|
self.current_line.min_content += self.pending_whitespace + outer.min_content;
|
||||||
(self.pending_whitespace + outer.min_content.into()).into();
|
self.current_line.max_content += self.pending_whitespace + outer.max_content;
|
||||||
self.current_line.max_content += outer.max_content;
|
self.pending_whitespace = Au::zero();
|
||||||
self.pending_whitespace = Length::zero();
|
|
||||||
self.had_non_whitespace_content_yet = true;
|
self.had_non_whitespace_content_yet = true;
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
@ -2349,7 +2347,7 @@ impl<'a> ContentSizesComputation<'a> {
|
||||||
containing_block_writing_mode,
|
containing_block_writing_mode,
|
||||||
paragraph: ContentSizes::zero(),
|
paragraph: ContentSizes::zero(),
|
||||||
current_line: ContentSizes::zero(),
|
current_line: ContentSizes::zero(),
|
||||||
pending_whitespace: Length::zero(),
|
pending_whitespace: Au::zero(),
|
||||||
had_non_whitespace_content_yet: false,
|
had_non_whitespace_content_yet: false,
|
||||||
ending_inline_pbm_stack: Vec::new(),
|
ending_inline_pbm_stack: Vec::new(),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[table-anonymous-objects-118.xht]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[table-anonymous-objects-120.xht]
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +1,3 @@
|
||||||
[percentage-size-quirks-002.html]
|
[percentage-size-quirks-002.html]
|
||||||
[.pct 2]
|
[.pct 2]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.pct 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[td-with-subpixel-padding-vertical-rl.html]
|
||||||
|
[td-with-subpixel-padding-vertical-rl]
|
||||||
|
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
||||||
[td-with-subpixel-padding.html]
|
|
||||||
[td-with-subpixel-padding]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue