1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:47:45 +00:00

LibWeb: Parse and resolve flex-flow property

This commit is contained in:
Tobias Christiansen 2021-05-30 12:25:10 +02:00 committed by Ali Mohammad Pur
parent e6545d5259
commit ead864acf3
2 changed files with 21 additions and 0 deletions

View file

@ -762,6 +762,21 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::FlexFlow) {
auto parts = split_on_whitespace(value.to_string());
if (parts.size() == 0)
return;
auto direction = parse_css_value(context, parts[0]);
style.set_property(CSS::PropertyID::FlexDirection, direction.release_nonnull());
if (parts.size() > 1) {
auto wrap = parse_css_value(context, parts[1]);
style.set_property(CSS::PropertyID::FlexWrap, wrap.release_nonnull());
}
return;
}
style.set_property(property_id, value);
}