mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01: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
|
@ -341,7 +341,11 @@ impl ComputedValuesExt for ComputedValues {
|
|||
fn unwrap(max_size: &MaxSize<NonNegativeLengthPercentage>) -> Option<&LengthPercentage> {
|
||||
match max_size {
|
||||
MaxSize::LengthPercentage(length) => Some(&length.0),
|
||||
MaxSize::None => None,
|
||||
MaxSize::None |
|
||||
MaxSize::MinContent |
|
||||
MaxSize::MaxContent |
|
||||
MaxSize::FitContent |
|
||||
MaxSize::Stretch => None,
|
||||
}
|
||||
}
|
||||
let position = self.get_position();
|
||||
|
@ -997,7 +1001,9 @@ impl From<stylo::Display> for Display {
|
|||
fn size_to_length(size: &Size) -> LengthPercentageOrAuto {
|
||||
match size {
|
||||
Size::LengthPercentage(length) => LengthPercentageOrAuto::LengthPercentage(&length.0),
|
||||
Size::Auto => LengthPercentageOrAuto::Auto,
|
||||
Size::Auto | Size::MinContent | Size::MaxContent | Size::FitContent | Size::Stretch => {
|
||||
LengthPercentageOrAuto::Auto
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue