LibWeb: Set correct longhands if grid-area subproperties are omitted

This commit is contained in:
Tim Ledbetter 2025-03-20 14:19:36 +00:00 committed by Sam Atkins
parent c029a9c98c
commit 2672fe99b7
Notes: github-actions[bot] 2025-03-20 17:00:40 +00:00
2 changed files with 6 additions and 6 deletions

View file

@ -4176,14 +4176,14 @@ RefPtr<CSSStyleValue> Parser::parse_grid_area_shorthand_value(TokenStream<Compon
if (row_end_style_value)
row_end = row_end_style_value.release_nonnull()->as_grid_track_placement().grid_track_placement();
else
row_end = column_start;
row_end = row_start;
// When grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to
// that <custom-ident>; otherwise, it is set to auto.
if (column_end_style_value)
column_end = column_end_style_value.release_nonnull()->as_grid_track_placement().grid_track_placement();
else
column_end = row_end;
column_end = column_start;
transaction.commit();
return ShorthandStyleValue::create(PropertyID::GridArea,

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 53 tests
44 Pass
9 Fail
46 Pass
7 Fail
Pass e.style['grid-area'] = "auto" should set grid-column-end
Pass e.style['grid-area'] = "auto" should set grid-column-start
Pass e.style['grid-area'] = "auto" should set grid-row-end
@ -16,10 +16,10 @@ Pass e.style['grid-area'] = "--a" should set grid-row-start
Pass e.style['grid-area'] = "--a" should not set unrelated longhands
Pass e.style['grid-area'] = "a / b" should set grid-column-end
Pass e.style['grid-area'] = "a / b" should set grid-column-start
Fail e.style['grid-area'] = "a / b" should set grid-row-end
Pass e.style['grid-area'] = "a / b" should set grid-row-end
Pass e.style['grid-area'] = "a / b" should set grid-row-start
Pass e.style['grid-area'] = "a / b" should not set unrelated longhands
Fail e.style['grid-area'] = "a / b / c" should set grid-column-end
Pass e.style['grid-area'] = "a / b / c" should set grid-column-end
Pass e.style['grid-area'] = "a / b / c" should set grid-column-start
Pass e.style['grid-area'] = "a / b / c" should set grid-row-end
Pass e.style['grid-area'] = "a / b / c" should set grid-row-start