layout_2020: Avoid decomposing mixed length / percentages in intrinsic sizing.

As that makes no sense in presence of min / max.
This commit is contained in:
Emilio Cobos Álvarez 2020-02-10 17:36:49 +01:00
parent f03026b869
commit 1754c832d8
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
2 changed files with 12 additions and 4 deletions

View file

@ -159,8 +159,12 @@ impl InlineFormattingContext {
}
fn add_lengthpercentage(&mut self, lp: LengthPercentage) {
self.add_length(lp.length_component());
self.current_line_percentages += lp.percentage_component();
if let Some(l) = lp.to_length() {
self.add_length(l);
}
if let Some(p) = lp.to_percentage() {
self.current_line_percentages += p;
}
}
fn add_length(&mut self, l: Length) {