LibWeb: Handle CSS-wide keywords in style_property_for_sided_shorthand

CSS-wide keywords should not be concatenated in the same way as other
values unless they are all the same.
This commit is contained in:
Callum Law 2025-06-12 19:50:51 +12:00 committed by Sam Atkins
commit 7d81823eb3
Notes: github-actions[bot] 2025-06-16 11:38:51 +00:00
2 changed files with 6 additions and 3 deletions

View file

@ -479,6 +479,9 @@ static Optional<StyleProperty> style_property_for_sided_shorthand(PropertyID pro
bool const top_and_bottom_same = top_value == bottom_value;
bool const left_and_right_same = left_value == right_value;
if ((top_value->is_css_wide_keyword() || right_value->is_css_wide_keyword() || bottom_value->is_css_wide_keyword() || left_value->is_css_wide_keyword()) && (!top_and_bottom_same || !left_and_right_same || top_value != left_value))
return {};
RefPtr<CSSStyleValue const> value;
if (top_and_bottom_same && left_and_right_same && top_value == left_value) {