mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
layout: Handle keyword sizes when computing the hypothetical cross size (#35826)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
b1e1e01ee9
commit
71c207ff25
3 changed files with 14 additions and 29 deletions
|
@ -2031,15 +2031,21 @@ impl FlexItem<'_> {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
IndependentFormattingContextContents::NonReplaced(non_replaced) => {
|
IndependentFormattingContextContents::NonReplaced(non_replaced) => {
|
||||||
let calculate_hypothetical_cross_size = |content_block_size| {
|
let calculate_hypothetical_cross_size = |content_block_size: Au| {
|
||||||
// TODO(#32853): handle size keywords.
|
if !cross_axis_is_item_block_axis {
|
||||||
|
return inline_size;
|
||||||
|
}
|
||||||
|
// This means that an auto size with stretch alignment will behave different than
|
||||||
|
// a stretch size. That's not what the spec says, but matches other browsers.
|
||||||
|
// To be discussed in https://github.com/w3c/csswg-drafts/issues/11784.
|
||||||
|
let stretch_size = containing_block
|
||||||
|
.size
|
||||||
|
.block
|
||||||
|
.to_definite()
|
||||||
|
.map(|size| Au::zero().max(size - self.pbm_auto_is_zero.cross));
|
||||||
|
let content_size = LazyCell::new(|| content_block_size.into());
|
||||||
self.content_cross_size
|
self.content_cross_size
|
||||||
.to_numeric()
|
.resolve_for_preferred(Size::FitContent, stretch_size, &content_size)
|
||||||
.unwrap_or(if cross_axis_is_item_block_axis {
|
|
||||||
content_block_size
|
|
||||||
} else {
|
|
||||||
inline_size
|
|
||||||
})
|
|
||||||
.clamp_between_extremums(
|
.clamp_between_extremums(
|
||||||
self.content_min_size.cross,
|
self.content_min_size.cross,
|
||||||
self.content_max_size.cross,
|
self.content_max_size.cross,
|
||||||
|
|
|
@ -89,15 +89,6 @@
|
||||||
[.test 45]
|
[.test 45]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 46]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 47]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 48]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 49]
|
[.test 49]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -2,23 +2,11 @@
|
||||||
[[data-expected-height\] 8]
|
[[data-expected-height\] 8]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[[data-expected-height\] 19]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[[data-expected-height\] 21]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[[data-expected-height\] 22]
|
[[data-expected-height\] 22]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[[data-expected-height\] 31]
|
[[data-expected-height\] 31]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[[data-expected-height\] 42]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[[data-expected-height\] 44]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[[data-expected-height\] 45]
|
[[data-expected-height\] 45]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue