diff --git a/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp index 67953014f57..56a0c946275 100644 --- a/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp @@ -130,7 +130,7 @@ String TransformationStyleValue::to_string(SerializationMode mode) const auto x_value = resolve_to_string(m_properties.values[0]); auto y_value = resolve_to_string(m_properties.values[1]); Optional z_value; - if (m_properties.values.size() == 3) + if (m_properties.values.size() == 3 && (!m_properties.values[2]->is_number() || m_properties.values[2]->as_number().number() != 1)) z_value = resolve_to_string(m_properties.values[2]); StringBuilder builder; diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-computed.txt index 038193ba13d..7439740249d 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-computed.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-computed.txt @@ -2,8 +2,7 @@ Harness status: OK Found 22 tests -16 Pass -6 Fail +22 Pass Pass Property scale value 'none' Pass Property scale value '1' Pass Property scale value '1%' @@ -11,18 +10,18 @@ Pass Property scale value '100' Pass Property scale value '100%' Pass Property scale value '100 100' Pass Property scale value '100% 100%' -Fail Property scale value '100 100 1' -Fail Property scale value '100% 100% 1' +Pass Property scale value '100 100 1' +Pass Property scale value '100% 100% 1' Pass Property scale value '-100' Pass Property scale value '-100%' Pass Property scale value '-100 -100' Pass Property scale value '-100% -100%' -Fail Property scale value '-100 -100 1' -Fail Property scale value '-100% -100% 1' +Pass Property scale value '-100 -100 1' +Pass Property scale value '-100% -100% 1' Pass Property scale value '100 200' Pass Property scale value '100% 200%' -Fail Property scale value '100 200 1' -Fail Property scale value '100% 200% 1' +Pass Property scale value '100 200 1' +Pass Property scale value '100% 200% 1' Pass Property scale value '100 200 300' Pass Property scale value '100 100 2' Pass Property scale value '100% 200% 300%' \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-valid.txt index 9f27610916d..a5ee9149398 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-transforms/parsing/scale-parsing-valid.txt @@ -2,8 +2,7 @@ Harness status: OK Found 22 tests -16 Pass -6 Fail +22 Pass Pass e.style['scale'] = "none" should set the property value Pass e.style['scale'] = "1" should set the property value Pass e.style['scale'] = "1%" should set the property value @@ -11,18 +10,18 @@ Pass e.style['scale'] = "100" should set the property value Pass e.style['scale'] = "100%" should set the property value Pass e.style['scale'] = "100 100" should set the property value Pass e.style['scale'] = "100% 100%" should set the property value -Fail e.style['scale'] = "100 100 1" should set the property value -Fail e.style['scale'] = "100% 100% 1" should set the property value +Pass e.style['scale'] = "100 100 1" should set the property value +Pass e.style['scale'] = "100% 100% 1" should set the property value Pass e.style['scale'] = "-100" should set the property value Pass e.style['scale'] = "-100%" should set the property value Pass e.style['scale'] = "-100 -100" should set the property value Pass e.style['scale'] = "-100% -100%" should set the property value -Fail e.style['scale'] = "-100 -100 1" should set the property value -Fail e.style['scale'] = "-100% -100% 1" should set the property value +Pass e.style['scale'] = "-100 -100 1" should set the property value +Pass e.style['scale'] = "-100% -100% 1" should set the property value Pass e.style['scale'] = "100 200" should set the property value Pass e.style['scale'] = "100% 200%" should set the property value -Fail e.style['scale'] = "100 200 1" should set the property value -Fail e.style['scale'] = "100% 200% 1" should set the property value +Pass e.style['scale'] = "100 200 1" should set the property value +Pass e.style['scale'] = "100% 200% 1" should set the property value Pass e.style['scale'] = "100 200 300" should set the property value Pass e.style['scale'] = "100 100 2" should set the property value Pass e.style['scale'] = "100% 200% 300%" should set the property value \ No newline at end of file