mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Enable min-content, max-content, fit-content and stretch (#33492)
For the sizing properties. We don't actually support them yet, just treating them as the initial value. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
4bde9af515
commit
9597390d2b
66 changed files with 120 additions and 2798 deletions
|
@ -168,8 +168,8 @@ impl BlockLevelBox {
|
|||
return false;
|
||||
}
|
||||
|
||||
if !block_size_is_zero_or_auto(style.content_block_size(), containing_block) ||
|
||||
!block_size_is_zero_or_auto(style.min_block_size(), containing_block) ||
|
||||
if !block_size_is_zero_or_intrinsic(style.content_block_size(), containing_block) ||
|
||||
!block_size_is_zero_or_intrinsic(style.min_block_size(), containing_block) ||
|
||||
pbm.padding_border_sums.block != Au::zero()
|
||||
{
|
||||
return false;
|
||||
|
@ -877,8 +877,8 @@ fn layout_in_flow_non_replaced_block_level_same_formatting_context(
|
|||
|
||||
let collapsed_through = collapsible_margins_in_children.collapsed_through &&
|
||||
pbm.padding_border_sums.block == Au::zero() &&
|
||||
block_size_is_zero_or_auto(computed_block_size, containing_block) &&
|
||||
block_size_is_zero_or_auto(style.min_block_size(), containing_block);
|
||||
block_size_is_zero_or_intrinsic(computed_block_size, containing_block) &&
|
||||
block_size_is_zero_or_intrinsic(style.min_block_size(), containing_block);
|
||||
block_margins_collapsed_with_children.collapsed_through = collapsed_through;
|
||||
|
||||
let end_margin_can_collapse_with_children = collapsed_through ||
|
||||
|
@ -1872,9 +1872,9 @@ impl<'container> PlacementState<'container> {
|
|||
}
|
||||
}
|
||||
|
||||
fn block_size_is_zero_or_auto(size: &Size, containing_block: &ContainingBlock) -> bool {
|
||||
fn block_size_is_zero_or_intrinsic(size: &Size, containing_block: &ContainingBlock) -> bool {
|
||||
match size {
|
||||
Size::Auto => true,
|
||||
Size::Auto | Size::MinContent | Size::MaxContent | Size::FitContent | Size::Stretch => true,
|
||||
Size::LengthPercentage(ref lp) => {
|
||||
// TODO: Should this resolve definite percentages? Blink does it, Gecko and WebKit don't.
|
||||
lp.is_definitely_zero() ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue