mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Refactor computation of preferred aspect ratios (#34416)
* Refactor computation of preferred aspect ratios Computing min/max-content sizes required a ContainingBlock in order to resolve the padding and border when determining the preferred aspect ratio. However, all callers already knew the padding and border, so they can compute the ratio themselves, and pass it directly instead of the ContainingBlock. Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Put preferred aspect ratio into ConstraintSpace Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
16da1c2721
commit
19a7e95a6a
11 changed files with 133 additions and 113 deletions
|
@ -296,12 +296,13 @@ impl<'a> TableLayout<'a> {
|
|||
let mut inline_content_sizes = if is_in_fixed_mode {
|
||||
ContentSizes::zero()
|
||||
} else {
|
||||
let constraint_space = ConstraintSpace::new_for_style_and_ratio(
|
||||
&cell.style,
|
||||
None, /* TODO: support preferred aspect ratios on non-replaced boxes */
|
||||
);
|
||||
cell.contents
|
||||
.contents
|
||||
.inline_content_sizes(
|
||||
layout_context,
|
||||
&ConstraintSpace::new_for_style(&cell.style),
|
||||
)
|
||||
.inline_content_sizes(layout_context, &constraint_space)
|
||||
.sizes
|
||||
};
|
||||
inline_content_sizes.min_content += padding_border_sums.inline;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue