diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp index 8d8de019c08..94351b656c7 100644 --- a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp @@ -19,6 +19,9 @@ bool StyleValueList::Properties::operator==(Properties const& other) const String StyleValueList::to_string(SerializationMode mode) const { + if (m_properties.values.is_empty()) + return {}; + auto separator = ""sv; switch (m_properties.separator) { case Separator::Space: @@ -31,6 +34,10 @@ String StyleValueList::to_string(SerializationMode mode) const VERIFY_NOT_REACHED(); } + auto first_value = m_properties.values.first(); + if (all_of(m_properties.values, [&](auto const& property) { return property == first_value; })) + return first_value->to_string(mode); + StringBuilder builder; for (size_t i = 0; i < m_properties.values.size(); ++i) { builder.append(m_properties.values[i]->to_string(mode)); diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/background-size-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/background-size-interpolation.txt index c33789d7b4e..eea77d3b31d 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/background-size-interpolation.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/background-size-interpolation.txt @@ -2,17 +2,17 @@ Harness status: OK Found 364 tests -78 Pass -286 Fail +108 Pass +256 Fail Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (-0.25) should be [ 7.5px 7.5px, 12.5px 12.5px, 7.5px 7.5px, 12.5px 12.5px] -Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (0) should be [10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px] +Pass CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (0) should be [10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px] Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (0.25) should be [12.5px 12.5px, 7.5px 7.5px, 12.5px 12.5px, 7.5px 7.5px] Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (0.5) should be [15.0px 15.0px, 5.0px 5.0px, 15.0px 15.0px, 5.0px 5.0px] Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (0.75) should be [17.5px 17.5px, 2.5px 2.5px, 17.5px 17.5px, 2.5px 2.5px] Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (1) should be [20.0px 20.0px, 0.0px 0.0px, 20.0px 20.0px, 0.0px 0.0px] Fail CSS Transitions: property from neutral to [20px 20px, 0px 0px] at (1.25) should be [22.5px 22.5px, 0.0px 0.0px, 22.5px 22.5px, 0.0px 0.0px] Fail CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (-0.25) should be [ 7.5px 7.5px, 12.5px 12.5px, 7.5px 7.5px, 12.5px 12.5px] -Fail CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (0) should be [10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px] +Pass CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (0) should be [10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px, 10.0px 10.0px] Fail CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (0.25) should be [12.5px 12.5px, 7.5px 7.5px, 12.5px 12.5px, 7.5px 7.5px] Fail CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (0.5) should be [15.0px 15.0px, 5.0px 5.0px, 15.0px 15.0px, 5.0px 5.0px] Fail CSS Transitions with transition: all: property from neutral to [20px 20px, 0px 0px] at (0.75) should be [17.5px 17.5px, 2.5px 2.5px, 17.5px 17.5px, 2.5px 2.5px] @@ -75,28 +75,28 @@ Fail Web Animations: property from [initial] to [20px 20px, 0p Pass Web Animations: property from [initial] to [20px 20px, 0px 0px] at (1) should be [20px 20px, 0px 0px] Fail Web Animations: property from [initial] to [20px 20px, 0px 0px] at (1.5) should be [20px 20px, 0px 0px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (-0.25) should be [120px 120px, 125px 125px, 120px 120px, 125px 125px] -Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (0.25) should be [ 80px 80px, 75px 75px, 80px 80px, 75px 75px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (0.5) should be [ 60px 60px, 50px 50px, 60px 60px, 50px 50px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (0.75) should be [ 40px 40px, 25px 25px, 40px 40px, 25px 25px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (1) should be [ 20px 20px, 0px 0px, 20px 20px, 0px 0px] Fail CSS Transitions: property from [inherit] to [20px 20px, 0px 0px] at (1.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (-0.25) should be [120px 120px, 125px 125px, 120px 120px, 125px 125px] -Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (0.25) should be [ 80px 80px, 75px 75px, 80px 80px, 75px 75px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (0.5) should be [ 60px 60px, 50px 50px, 60px 60px, 50px 50px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (0.75) should be [ 40px 40px, 25px 25px, 40px 40px, 25px 25px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (1) should be [ 20px 20px, 0px 0px, 20px 20px, 0px 0px] Fail CSS Transitions with transition: all: property from [inherit] to [20px 20px, 0px 0px] at (1.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (-0.25) should be [120px 120px, 125px 125px, 120px 120px, 125px 125px] -Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.25) should be [ 80px 80px, 75px 75px, 80px 80px, 75px 75px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.5) should be [ 60px 60px, 50px 50px, 60px 60px, 50px 50px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.75) should be [ 40px 40px, 25px 25px, 40px 40px, 25px 25px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (1) should be [ 20px 20px, 0px 0px, 20px 20px, 0px 0px] Fail CSS Animations: property from [inherit] to [20px 20px, 0px 0px] at (1.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] Fail Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (-0.25) should be [120px 120px, 125px 125px, 120px 120px, 125px 125px] -Fail Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (0) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.25) should be [ 80px 80px, 75px 75px, 80px 80px, 75px 75px] Fail Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.5) should be [ 60px 60px, 50px 50px, 60px 60px, 50px 50px] Fail Web Animations: property from [inherit] to [20px 20px, 0px 0px] at (0.75) should be [ 40px 40px, 25px 25px, 40px 40px, 25px 25px] @@ -285,33 +285,33 @@ Pass Web Animations: property from [0px 0px, 0px 0px, 0px 0px, Pass Web Animations: property from [0px 0px, 0px 0px, 0px 0px, 0px 0px] to [20px 20px, 40px 40px, 60px 60px, 100px 100px] at (1) should be [20px 20px, 40px 40px, 60px 60px, 100px 100px] Pass Web Animations: property from [0px 0px, 0px 0px, 0px 0px, 0px 0px] to [20px 20px, 40px 40px, 60px 60px, 100px 100px] at (1.25) should be [25px 25px, 50px 50px, 75px 75px, 125px 125px] Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (-0.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] -Fail CSS Transitions: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] +Pass CSS Transitions: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (-0.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] -Fail CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] +Pass CSS Transitions with transition: all: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Animations: property from [0px 0px] to [80px 80px] at (-0.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] -Fail CSS Animations: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] +Pass CSS Animations: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail Web Animations: property from [0px 0px] to [80px 80px] at (-0.25) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] -Fail Web Animations: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (0) should be [ 0px 0px, 0px 0px, 0px 0px, 0px 0px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (0.25) should be [ 20px 20px, 20px 20px, 20px 20px, 20px 20px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (0.5) should be [ 40px 40px, 40px 40px, 40px 40px, 40px 40px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (0.75) should be [ 60px 60px, 60px 60px, 60px 60px, 60px 60px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (1) should be [ 80px 80px, 80px 80px, 80px 80px, 80px 80px] +Pass Web Animations: property from [0px 0px] to [80px 80px] at (1.25) should be [100px 100px, 100px 100px, 100px 100px, 100px 100px] Fail CSS Transitions: property from [0px] to [80px] at (-0.25) should be [ 0px, 0px, 0px, 0px] Fail CSS Transitions: property from [0px] to [80px] at (0) should be [ 0px, 0px, 0px, 0px] Fail CSS Transitions: property from [0px] to [80px] at (0.25) should be [ 20px, 20px, 20px, 20px] diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-image-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-image-valid.txt index 9fbb702c5db..08aa2d10c1c 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-image-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-image-valid.txt @@ -2,8 +2,7 @@ Harness status: OK Found 30 tests -29 Pass -1 Fail +30 Pass Pass e.style['border-image'] = "none" should set the property value Pass e.style['border-image'] = "stretch" should set the property value Pass e.style['border-image'] = "none 100% / 1 / 0 stretch" should set the property value @@ -13,7 +12,7 @@ Pass e.style['border-image'] = "url(\"http://www.example.com/\")" should set the Pass e.style['border-image'] = "repeat round" should set the property value Pass e.style['border-image'] = "none repeat round" should set the property value Pass e.style['border-image'] = "space" should set the property value -Fail e.style['border-image'] = "none space space" should set the property value +Pass e.style['border-image'] = "none space space" should set the property value Pass e.style['border-image'] = "none 100% / 1 / 0 space" should set the property value Pass e.style['border-image'] = "1" should set the property value Pass e.style['border-image'] = "none 1 1 1 1" should set the property value