layout: Basic implementation of size keywords on flex-basis (#35413)

layout: Basic implementation of size keywords on `flex-basis`

This splits the logic to resolve the used value of `flex-basis` into its
own method, which preserves size keywords.

And then it changes `flex_base_size()` to resolve the provided keywords
properly. However, it doesn't handle size keywords in the cross axis.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-02-13 16:24:06 +01:00 committed by GitHub
parent 3d9e7a95e0
commit 2b930814d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 153 additions and 168 deletions

View file

@ -57,6 +57,13 @@ impl ContentSizes {
max_content: self.max_content + other.max_content,
}
}
pub fn map(&self, f: impl Fn(Au) -> Au) -> Self {
Self {
min_content: f(self.min_content),
max_content: f(self.max_content),
}
}
}
impl Zero for ContentSizes {