mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
layout: Implement keyword sizes for block layout heuristics (#34695)
Block layout uses some heuristics to guess whether margins are separated by clearance and then don't collapse. These heuristics now take the min-content, max-content, fit-content and stretch sizing keywords into account. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
2ab66ce678
commit
6be0a64939
9 changed files with 212 additions and 63 deletions
|
@ -261,16 +261,6 @@ pub(crate) trait ComputedValuesExt {
|
|||
box_size: LogicalVec2<Size<Au>>,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> LogicalVec2<Size<Au>>;
|
||||
fn content_max_box_size(
|
||||
&self,
|
||||
containing_block: &ContainingBlock,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> LogicalVec2<Size<Au>>;
|
||||
fn content_max_box_size_deprecated(
|
||||
&self,
|
||||
containing_block: &ContainingBlock,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> LogicalVec2<Option<Au>>;
|
||||
fn content_max_box_size_for_max_size(
|
||||
&self,
|
||||
box_size: LogicalVec2<Size<Au>>,
|
||||
|
@ -470,27 +460,6 @@ impl ComputedValuesExt for ComputedValues {
|
|||
}
|
||||
}
|
||||
|
||||
fn content_max_box_size(
|
||||
&self,
|
||||
containing_block: &ContainingBlock,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> LogicalVec2<Size<Au>> {
|
||||
let max_box_size = self
|
||||
.max_box_size(containing_block.style.writing_mode)
|
||||
.percentages_relative_to(containing_block);
|
||||
|
||||
self.content_max_box_size_for_max_size(max_box_size, pbm)
|
||||
}
|
||||
|
||||
fn content_max_box_size_deprecated(
|
||||
&self,
|
||||
containing_block: &ContainingBlock,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> LogicalVec2<Option<Au>> {
|
||||
self.content_max_box_size(containing_block, pbm)
|
||||
.map(Size::to_numeric)
|
||||
}
|
||||
|
||||
fn content_max_box_size_for_max_size(
|
||||
&self,
|
||||
max_box_size: LogicalVec2<Size<Au>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue