layout: Remove min and max container sizes from FlexContext (#35144)

Thanks to #34946 we don't have to recompute the min and max sizes, we
can get them from the `ContainingBlock`.

And then in `FlexContext` there is no need to store both the definite
and the min & max sizes of the container`, we can instead make do with
a single `FlexRelativeVec2<SizeConstraint>`.

This removes 1 of the 3 usages of `ContentBoxSizesAndPBMDeprecated`,
which is also good.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-24 08:11:23 -08:00 committed by GitHub
parent 56d55d48d9
commit fea8b68860
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 54 additions and 67 deletions

View file

@ -14,6 +14,15 @@ pub(super) struct FlexRelativeVec2<T> {
pub cross: T,
}
impl<T> FlexRelativeVec2<T> {
pub fn map<U>(&self, f: impl Fn(&T) -> U) -> FlexRelativeVec2<U> {
FlexRelativeVec2 {
main: f(&self.main),
cross: f(&self.cross),
}
}
}
#[derive(Clone, Copy, Debug)]
pub(super) struct FlexRelativeSides<T> {
pub cross_start: T,