mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove unnecessary clamping in used_size_as_if_inline_element() (#34114)
We don't need to floor the preferred box sizes to be at least zero, since `used_size_as_if_inline_element_from_content_box_sizes()` will take care of applying min and max constraints, and the min has been floored to be at least zero. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
b22c0771be
commit
2a6d480cd8
1 changed files with 4 additions and 10 deletions
|
@ -447,19 +447,13 @@ impl ReplacedContent {
|
|||
style: &ComputedValues,
|
||||
content_box_sizes_and_pbm: &ContentBoxSizesAndPBMDeprecated,
|
||||
) -> LogicalVec2<Au> {
|
||||
// We need to clamp to zero here to obtain the proper aspect ratio when box-sizing
|
||||
// is border-box and the inner box size would otherwise be negative.
|
||||
let content_box_size = content_box_sizes_and_pbm
|
||||
.content_box_size
|
||||
.map(|value| value.map(|value| value.max(Au::zero())));
|
||||
let content_min_box_size = content_box_sizes_and_pbm
|
||||
.content_min_box_size
|
||||
.auto_is(Au::zero);
|
||||
self.used_size_as_if_inline_element_from_content_box_sizes(
|
||||
containing_block,
|
||||
style,
|
||||
content_box_size,
|
||||
content_min_box_size,
|
||||
content_box_sizes_and_pbm.content_box_size,
|
||||
content_box_sizes_and_pbm
|
||||
.content_min_box_size
|
||||
.auto_is(Au::zero),
|
||||
content_box_sizes_and_pbm.content_max_box_size,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue