mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Partial support for sizing keywords on flex items (#35469)
* Add tests for sizing keywords on flex items Signed-off-by: Oriol Brufau <obrufau@igalia.com> * layout: Partial support for sizing keywords on flex items When a flex item has `flex-basis: auto`, the used `flex-basis` is the value of the main size property. In that case, if the main size property was set to keyword, we were always assuming it was `auto`. Now we handle non-`auto` keywords correctly. Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
5fa14c97bd
commit
c2224d5afc
9 changed files with 639 additions and 52 deletions
|
@ -202,28 +202,6 @@ pub(crate) struct ContentBoxSizesAndPBM {
|
|||
pub depends_on_block_constraints: bool,
|
||||
}
|
||||
|
||||
impl From<ContentBoxSizesAndPBM> for ContentBoxSizesAndPBMDeprecated {
|
||||
fn from(sizes: ContentBoxSizesAndPBM) -> Self {
|
||||
Self {
|
||||
content_box_size: sizes
|
||||
.content_box_sizes
|
||||
.map(|size| size.preferred.to_auto_or()),
|
||||
content_min_box_size: sizes.content_box_sizes.map(|size| size.min.to_auto_or()),
|
||||
content_max_box_size: sizes.content_box_sizes.map(|size| size.max.to_numeric()),
|
||||
pbm: sizes.pbm.clone(),
|
||||
depends_on_block_constraints: sizes.depends_on_block_constraints,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct ContentBoxSizesAndPBMDeprecated {
|
||||
pub content_box_size: LogicalVec2<AuOrAuto>,
|
||||
pub content_min_box_size: LogicalVec2<AuOrAuto>,
|
||||
pub content_max_box_size: LogicalVec2<Option<Au>>,
|
||||
pub pbm: PaddingBorderMargin,
|
||||
pub depends_on_block_constraints: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub(crate) struct BorderStyleColor {
|
||||
pub style: BorderStyle,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue