mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
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:
parent
62da650992
commit
7d81823eb3
Notes:
github-actions[bot]
2025-06-16 11:38:51 +00:00
Author: https://github.com/Calme1709
Commit: 7d81823eb3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5066
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 6 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 11 tests
|
||||
|
||||
5 Pass
|
||||
6 Fail
|
||||
6 Pass
|
||||
5 Fail
|
||||
Fail All properties can serialize 'initial'
|
||||
Fail All properties (except 'all') can serialize their initial value (computed)
|
||||
Fail All properties (except 'all') can serialize their initial value (specified)
|
||||
|
@ -11,7 +11,7 @@ Fail All shorthands can serialize their longhands set to 'initial'
|
|||
Fail All shorthands (except 'all') can serialize their longhands set to their initial value
|
||||
Pass All aliases can serialize target property set to 'initial'
|
||||
Pass All aliases can serialize target property set to its initial value
|
||||
Fail Can't serialize shorthand when longhands are set to different css-wide keywords
|
||||
Pass Can't serialize shorthand when longhands are set to different css-wide keywords
|
||||
Pass Can't serialize shorthand when longhands have different priority
|
||||
Pass Can't serialize shorthand set to 'initial' when some longhand is missing
|
||||
Pass Can't serialize shorthand set to initial value when some longhand is missing
|
Loading…
Add table
Add a link
Reference in a new issue