mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
LibWeb: Create a LengthStyleValue for flex-basis of 0
We're about to stop letting 0 NumericStyleValues pretend to be Lengths, so this will break. As noted, the flex-basis property accepts `<length>` not `<number>` so this is actually correct.
This commit is contained in:
parent
5cbf6eb930
commit
6bbf163499
1 changed files with 3 additions and 2 deletions
|
@ -5392,9 +5392,10 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_flex_value(Vector<ComponentValue> cons
|
|||
case PropertyID::FlexGrow: {
|
||||
// NOTE: The spec says that flex-basis should be 0 here, but other engines currently use 0%.
|
||||
// https://github.com/w3c/csswg-drafts/issues/5742
|
||||
auto zero_percent = TRY(NumericStyleValue::create_integer(0));
|
||||
// (flex-basis takes `<length>`, not `<number>`, so the 0 is a Length.)
|
||||
auto flex_basis = TRY(LengthStyleValue::create(Length::make_px(0)));
|
||||
auto one = TRY(NumericStyleValue::create_integer(1));
|
||||
return FlexStyleValue::create(*value, one, zero_percent);
|
||||
return FlexStyleValue::create(*value, one, flex_basis);
|
||||
}
|
||||
case PropertyID::FlexBasis: {
|
||||
auto one = TRY(NumericStyleValue::create_integer(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue