mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
layout: Generalize ContainingBlock
's block size to a SizeConstraint
(#34946)
It used to be an `AuOrAuto`, turning it into a `SizeConstraint` allows passing the information about the min and max constraints when the containing block doesn't have a definite block size. This will be useful for table layout. Note that in most cases we were already constructing the containing block from a `SizeConstraint`, but we were calling `to_auto_or()` to turn it into an `AuOrAuto`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
de780dcde4
commit
f66cd172d6
11 changed files with 71 additions and 69 deletions
|
@ -97,7 +97,7 @@ impl<'a> From<&'_ ContainingBlock<'a>> for IndefiniteContainingBlock {
|
|||
Self {
|
||||
size: LogicalVec2 {
|
||||
inline: AuOrAuto::LengthPercentage(containing_block.size.inline),
|
||||
block: containing_block.size.block,
|
||||
block: containing_block.size.block.to_auto_or(),
|
||||
},
|
||||
writing_mode: containing_block.style.writing_mode,
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ impl<'a> From<&'_ DefiniteContainingBlock<'a>> for IndefiniteContainingBlock {
|
|||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct ContainingBlockSize {
|
||||
inline: Au,
|
||||
block: AuOrAuto,
|
||||
block: SizeConstraint,
|
||||
}
|
||||
|
||||
pub(crate) struct ContainingBlock<'a> {
|
||||
|
@ -136,7 +136,7 @@ impl<'a> From<&'_ DefiniteContainingBlock<'a>> for ContainingBlock<'a> {
|
|||
ContainingBlock {
|
||||
size: ContainingBlockSize {
|
||||
inline: definite.size.inline,
|
||||
block: AuOrAuto::LengthPercentage(definite.size.block),
|
||||
block: SizeConstraint::Definite(definite.size.block),
|
||||
},
|
||||
style: definite.style,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue