aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flexbox/layout.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2025-03-13 23:50:16 +0100
committerGitHub <noreply@github.com>2025-03-13 22:50:16 +0000
commit7cf2fc88a03c59ab74dc63e0e784797f26435f73 (patch)
tree398249dcc7821e6123cf47f14a01cd52bd878cea /components/layout_2020/flexbox/layout.rs
parent62d6759106c987ed438d6a8e281fea28859300d3 (diff)
downloadservo-7cf2fc88a03c59ab74dc63e0e784797f26435f73.tar.gz
servo-7cf2fc88a03c59ab74dc63e0e784797f26435f73.zip
layout: Allow lazy resolution of automatic minimum sizes (#35965)
`Size::resolve_for_min()` had an `Au` parameter, representing the value to be used for an automatic minimum size. However, this amount isn't trivial to compute in flexbox, so this patch changes the parameter to a function that can be called lazily. Note flexbox isn't currently using `Size::resolve_for_min()`, but it will in #35961. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/flexbox/layout.rs')
-rw-r--r--components/layout_2020/flexbox/layout.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs
index 7fcf41a269c..ff8d3e50683 100644
--- a/components/layout_2020/flexbox/layout.rs
+++ b/components/layout_2020/flexbox/layout.rs
@@ -1715,7 +1715,7 @@ impl InitialFlexLineLayout<'_> {
item.item.content_cross_sizes.resolve(
axis,
Size::Stretch,
- Au::zero(),
+ Au::zero,
Some(final_line_cross_size - item.item.pbm_auto_is_zero.cross),
|| content_size.into(),
// Tables have a special sizing in the block axis in that handles collapsed rows,
@@ -1966,7 +1966,7 @@ impl FlexItem<'_> {
self.content_cross_sizes.resolve(
Direction::Inline,
automatic_size,
- Au::zero(),
+ Au::zero,
Some(stretch_size),
get_content_size,
self.is_table(),
@@ -2117,7 +2117,7 @@ impl FlexItem<'_> {
self.content_cross_sizes.resolve(
Direction::Block,
Size::FitContent,
- Au::zero(),
+ Au::zero,
stretch_size,
|| content_block_size.into(),
self.is_table(),