mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
f03026b869
commit
1754c832d8
2 changed files with 12 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -148,8 +148,12 @@ impl BoxContentSizes {
|
|||
let margin = style.margin();
|
||||
pbm_lengths += border.inline_sum();
|
||||
let mut add = |x: LengthPercentage| {
|
||||
pbm_lengths += x.length_component();
|
||||
pbm_percentages += x.percentage_component();
|
||||
if let Some(l) = x.to_length() {
|
||||
pbm_lengths += l;
|
||||
}
|
||||
if let Some(p) = x.to_percentage() {
|
||||
pbm_percentages += p;
|
||||
}
|
||||
};
|
||||
add(padding.inline_start);
|
||||
add(padding.inline_end);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue