mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Don't consider a definite stretch
size as intrinsic (#36045)
`block_size_is_zero_or_intrinsic()` was always returning true for `stretch`. This function is used for the margin collapse heuristics in block layout, so we were considering that an empty element with `height: stretch` would self-collapse. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
6be7612d16
commit
3a3c3aeb75
2 changed files with 7 additions and 7 deletions
|
@ -2144,11 +2144,13 @@ impl<'container> PlacementState<'container> {
|
|||
|
||||
fn block_size_is_zero_or_intrinsic(size: &StyleSize, containing_block: &ContainingBlock) -> bool {
|
||||
match size {
|
||||
StyleSize::Auto |
|
||||
StyleSize::MinContent |
|
||||
StyleSize::MaxContent |
|
||||
StyleSize::FitContent |
|
||||
StyleSize::Stretch => true,
|
||||
StyleSize::Auto | StyleSize::MinContent | StyleSize::MaxContent | StyleSize::FitContent => {
|
||||
true
|
||||
},
|
||||
StyleSize::Stretch => {
|
||||
// TODO: Should this return true when the containing block has a definite size of 0px?
|
||||
!containing_block.size.block.is_definite()
|
||||
},
|
||||
StyleSize::LengthPercentage(lp) => {
|
||||
// TODO: Should this resolve definite percentages? Blink does it, Gecko and WebKit don't.
|
||||
lp.is_definitely_zero() ||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[block-height-009.html]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue