diff --git a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp index c0d52f5c902..65ad7630bca 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp @@ -383,6 +383,9 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const auto& rows = longhand(PropertyID::GridTemplateRows)->as_grid_track_size_list(); auto& columns = longhand(PropertyID::GridTemplateColumns)->as_grid_track_size_list(); + if (areas.grid_template_area().size() == 0 && rows.grid_track_size_list().track_list().size() == 0 && columns.grid_track_size_list().track_list().size() == 0) + return "none"_string; + auto construct_rows_string = [&]() { StringBuilder builder; size_t idx = 0; 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 437fcca9e23..9100ce10650 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 @@ -383,7 +383,7 @@ All supported properties and their default values exposed from CSSStylePropertie 'fontWidth': 'normal' 'font-width': 'normal' 'gap': 'normal' -'grid': '' +'grid': 'none' 'gridArea': 'auto' 'grid-area': 'auto' 'gridAutoColumns': 'auto' @@ -410,8 +410,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'grid-row-gap': 'normal' 'gridRowStart': 'auto' 'grid-row-start': 'auto' -'gridTemplate': '' -'grid-template': '' +'gridTemplate': 'none' +'grid-template': 'none' 'gridTemplateAreas': 'none' 'grid-template-areas': 'none' 'gridTemplateColumns': 'none' diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-invalid.txt index c2eb3b28f1e..c5519e59bb1 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-invalid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-invalid.txt @@ -2,17 +2,17 @@ Harness status: OK Found 34 tests -21 Pass -13 Fail +16 Pass +18 Fail Pass e.style['grid'] = "none none" should not set the property value Pass e.style['grid'] = "none []" should not set the property value Fail e.style['grid'] = "10px" should not set the property value Fail e.style['grid'] = "20%" should not set the property value Fail e.style['grid'] = "5fr" should not set the property value -Pass e.style['grid'] = "[a]" should not set the property value +Fail e.style['grid'] = "[a]" should not set the property value Fail e.style['grid'] = "[a] 10px" should not set the property value Fail e.style['grid'] = "[a] 10px []" should not set the property value -Pass e.style['grid'] = "[]" should not set the property value +Fail e.style['grid'] = "[]" should not set the property value Fail e.style['grid'] = "10px \"a\"" should not set the property value Fail e.style['grid'] = "[] 10px \"a\"" should not set the property value Fail e.style['grid'] = "10px [] \"a\"" should not set the property value @@ -28,13 +28,13 @@ Pass e.style['grid'] = "[a] \"a\" [a] [a]" should not set the property value Pass e.style['grid'] = "\"a\" \"a\" [a] [a]" should not set the property value Pass e.style['grid'] = "\"a\" [a] [a] / none" should not set the property value Pass e.style['grid'] = "\"a\" \"a\" [a] [a] / none" should not set the property value -Pass e.style['grid'] = "none / \"a\"" should not set the property value +Fail e.style['grid'] = "none / \"a\"" should not set the property value Pass e.style['grid'] = "\"a\" / none" should not set the property value -Pass e.style['grid'] = "none / [] \"a\"" should not set the property value +Fail e.style['grid'] = "none / [] \"a\"" should not set the property value Pass e.style['grid'] = "none / \"a\" []" should not set the property value Pass e.style['grid'] = "none / \"a\" [] 10px" should not set the property value Pass e.style['grid'] = "auto-flow 100px" should not set the property value -Pass e.style['grid'] = "auto-flow / auto-flow" should not set the property value +Fail e.style['grid'] = "auto-flow / auto-flow" should not set the property value Pass e.style['grid'] = "auto-flow 1fr / auto-flow 1fr" should not set the property value Pass e.style['grid'] = "dense auto-flow / dense auto-flow" should not set the property value Pass e.style['grid'] = "auto / auto-flow foo()" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-valid.txt index 89a8b2249a0..1bf04722cb8 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-shorthand-valid.txt @@ -2,10 +2,10 @@ Harness status: OK Found 49 tests -5 Pass -44 Fail -Fail e.style['grid'] = "none" should set the property value -Fail e.style['grid'] = "none / none" should set the property value +7 Pass +42 Fail +Pass e.style['grid'] = "none" should set the property value +Pass e.style['grid'] = "none / none" should set the property value Pass e.style['grid'] = "auto / auto" should set the property value Fail e.style['grid'] = "none / [a] 0px" should set the property value Fail e.style['grid'] = "none / [] 0px" should set the property value diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-invalid.txt index d3c1c246458..16632b34461 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-invalid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-invalid.txt @@ -2,15 +2,15 @@ Harness status: OK Found 66 tests -19 Pass -47 Fail +15 Pass +51 Fail Fail e.style['grid-template'] = "auto" should not set the property value Pass e.style['grid-template'] = "none none" should not set the property value Pass e.style['grid-template'] = "none []" should not set the property value Fail e.style['grid-template'] = "10px" should not set the property value Fail e.style['grid-template'] = "20%" should not set the property value Fail e.style['grid-template'] = "5fr" should not set the property value -Pass e.style['grid-template'] = "[a]" should not set the property value +Fail e.style['grid-template'] = "[a]" should not set the property value Fail e.style['grid-template'] = "[a] 10px" should not set the property value Fail e.style['grid-template'] = "[a] repeat(2, 10px)" should not set the property value Fail e.style['grid-template'] = "[a] repeat(auto-fill, 10px)" should not set the property value @@ -19,7 +19,7 @@ Fail e.style['grid-template'] = "[a] 10px []" should not set the property value Fail e.style['grid-template'] = "[a] repeat(2, 10px) []" should not set the property value Fail e.style['grid-template'] = "[a] repeat(auto-fill, 10px) []" should not set the property value Fail e.style['grid-template'] = "[a] repeat(auto-fit, 10px) []" should not set the property value -Pass e.style['grid-template'] = "[]" should not set the property value +Fail e.style['grid-template'] = "[]" should not set the property value Fail e.style['grid-template'] = "10px \"a\"" should not set the property value Fail e.style['grid-template'] = "repeat(2, 10px) \"a\"" should not set the property value Fail e.style['grid-template'] = "repeat(auto-fill, 10px) \"a\"" should not set the property value @@ -62,9 +62,9 @@ Pass e.style['grid-template'] = "[a] \"a\" [a] [a]" should not set the property Pass e.style['grid-template'] = "\"a\" \"a\" [a] [a]" should not set the property value Pass e.style['grid-template'] = "\"a\" [a] [a] / none" should not set the property value Pass e.style['grid-template'] = "\"a\" \"a\" [a] [a] / none" should not set the property value -Pass e.style['grid-template'] = "none / \"a\"" should not set the property value +Fail e.style['grid-template'] = "none / \"a\"" should not set the property value Pass e.style['grid-template'] = "\"a\" / none" should not set the property value -Pass e.style['grid-template'] = "none / [] \"a\"" should not set the property value +Fail e.style['grid-template'] = "none / [] \"a\"" should not set the property value Pass e.style['grid-template'] = "none / \"a\" []" should not set the property value Pass e.style['grid-template'] = "none / \"a\" [] 10px" should not set the property value Pass e.style['grid-template'] = "none / \"a\" [] repeat(2, 10px)" should not set the property value diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-valid.txt index 74682704772..a19f0668a84 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/parsing/grid-template-shorthand-valid.txt @@ -2,10 +2,10 @@ Harness status: OK Found 40 tests -5 Pass -35 Fail -Fail e.style['grid-template'] = "none" should set the property value -Fail e.style['grid-template'] = "none / none" should set the property value +7 Pass +33 Fail +Pass e.style['grid-template'] = "none" should set the property value +Pass e.style['grid-template'] = "none / none" should set the property value Pass e.style['grid-template'] = "auto / auto" should set the property value Fail e.style['grid-template'] = "none / [a] 0px" should set the property value Fail e.style['grid-template'] = "none / [] 0px" should set the property value diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom/cssom-getPropertyValue-common-checks.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/cssom-getPropertyValue-common-checks.txt index c92763a34b9..d77de0b684b 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/cssom/cssom-getPropertyValue-common-checks.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/cssom-getPropertyValue-common-checks.txt @@ -2,10 +2,10 @@ Harness status: OK Found 11 tests -6 Pass -5 Fail +7 Pass +4 Fail Fail All properties can serialize 'initial' -Fail All properties (except 'all') can serialize their initial value (computed) +Pass All properties (except 'all') can serialize their initial value (computed) Fail All properties (except 'all') can serialize their initial value (specified) Fail All shorthands can serialize their longhands set to 'initial' Fail All shorthands (except 'all') can serialize their longhands set to their initial value