mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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) {
|
fn add_lengthpercentage(&mut self, lp: LengthPercentage) {
|
||||||
self.add_length(lp.length_component());
|
if let Some(l) = lp.to_length() {
|
||||||
self.current_line_percentages += lp.percentage_component();
|
self.add_length(l);
|
||||||
|
}
|
||||||
|
if let Some(p) = lp.to_percentage() {
|
||||||
|
self.current_line_percentages += p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_length(&mut self, l: Length) {
|
fn add_length(&mut self, l: Length) {
|
||||||
|
|
|
@ -148,8 +148,12 @@ impl BoxContentSizes {
|
||||||
let margin = style.margin();
|
let margin = style.margin();
|
||||||
pbm_lengths += border.inline_sum();
|
pbm_lengths += border.inline_sum();
|
||||||
let mut add = |x: LengthPercentage| {
|
let mut add = |x: LengthPercentage| {
|
||||||
pbm_lengths += x.length_component();
|
if let Some(l) = x.to_length() {
|
||||||
pbm_percentages += x.percentage_component();
|
pbm_lengths += l;
|
||||||
|
}
|
||||||
|
if let Some(p) = x.to_percentage() {
|
||||||
|
pbm_percentages += p;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
add(padding.inline_start);
|
add(padding.inline_start);
|
||||||
add(padding.inline_end);
|
add(padding.inline_end);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue