diff --git a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp index bb67cb2710b..82c55bc651f 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp @@ -293,6 +293,8 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const builder.appendff(" / {}", row_end.grid_track_placement().to_string()); if (!column_end.grid_track_placement().is_auto()) builder.appendff(" / {}", column_end.grid_track_placement().to_string()); + if (builder.is_empty()) + return "auto"_string; return MUST(builder.to_string()); } // FIXME: Serialize Grid differently once we support it better! diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt index 4618425ff68..cbc50ebce1d 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt @@ -366,8 +366,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'font-width': 'normal' 'gap': 'normal' 'grid': '' -'gridArea': '' -'grid-area': '' +'gridArea': 'auto' +'grid-area': 'auto' 'gridAutoColumns': 'auto' 'grid-auto-columns': 'auto' 'gridAutoFlow': 'row' diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-computed.txt index 41438e56586..7ac687aaff5 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-computed.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-computed.txt @@ -2,9 +2,9 @@ Harness status: OK Found 30 tests -13 Pass -17 Fail -Fail Property grid-area value 'auto / auto / auto / auto' +14 Pass +16 Fail +Pass Property grid-area value 'auto / auto / auto / auto' Pass Property grid-row value 'auto / auto' Pass Property grid-column-end value 'auto' Fail Property grid-row value '-zπ' diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-valid.txt index ef2b5ae2a44..a712f742fcd 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-area-valid.txt @@ -2,13 +2,13 @@ Harness status: OK Found 57 tests -19 Pass -38 Fail -Fail e.style['grid-area'] = "auto" should set the property value -Fail e.style['grid-area'] = "auto / auto" should set the property value -Fail e.style['grid-area'] = "auto / auto / auto" should set the property value -Fail e.style['grid-area'] = "auto / auto / auto / auto" should set the property value -Fail e.style['grid-area'] = "AuTo" should set the property value +24 Pass +33 Fail +Pass e.style['grid-area'] = "auto" should set the property value +Pass e.style['grid-area'] = "auto / auto" should set the property value +Pass e.style['grid-area'] = "auto / auto / auto" should set the property value +Pass e.style['grid-area'] = "auto / auto / auto / auto" should set the property value +Pass e.style['grid-area'] = "AuTo" should set the property value Pass e.style['grid-row'] = "auto" should set the property value Pass e.style['grid-row'] = "auto/auto" should set the property value Pass e.style['grid-column-end'] = "AuTo" should set the property value