diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp index 94351b656c7..7603c454603 100644 --- a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp @@ -17,6 +17,17 @@ bool StyleValueList::Properties::operator==(Properties const& other) const return separator == other.separator && values.span() == other.values.span(); } +ValueComparingNonnullRefPtr StyleValueList::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const +{ + StyleValueVector absolutized_style_values; + absolutized_style_values.ensure_capacity(m_properties.values.size()); + + for (auto const& value : m_properties.values) + absolutized_style_values.append(value->absolutized(viewport_rect, font_metrics, root_font_metrics)); + + return StyleValueList::create(move(absolutized_style_values), m_properties.separator); +} + String StyleValueList::to_string(SerializationMode mode) const { if (m_properties.values.is_empty()) diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h index 61541265311..7e5e847271a 100644 --- a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h +++ b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h @@ -36,6 +36,8 @@ public: virtual String to_string(SerializationMode) const override; virtual Vector tokenize() const override; + virtual ValueComparingNonnullRefPtr absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const override; + bool properties_equal(StyleValueList const& other) const { return m_properties == other.m_properties; } Separator separator() const { return m_properties.separator; } diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/box-shadow-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/box-shadow-interpolation.txt index 717d448ece1..f60b4895195 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/box-shadow-interpolation.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/animations/box-shadow-interpolation.txt @@ -2,8 +2,8 @@ Harness status: OK Found 402 tests -274 Pass -128 Fail +290 Pass +112 Fail Pass CSS Transitions: property from neutral to [20px 20px 20px 20px black] at (-0.3) should be [rgb(0, 0, 0) 7px 33px 7px 33px] Pass CSS Transitions: property from neutral to [20px 20px 20px 20px black] at (0) should be [rgb(0, 0, 0) 10px 30px 10px 30px] Pass CSS Transitions: property from neutral to [20px 20px 20px 20px black] at (0.3) should be [rgb(0, 0, 0) 13px 27px 13px 27px] @@ -244,30 +244,30 @@ Pass Web Animations: property from [10px 10px 10px 10px black] to [ Pass Web Animations: property from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (0.6) should be [rgb(0, 77, 0) 10px 10px 10px 10px] Pass Web Animations: property from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1) should be [rgb(0, 128, 0) 10px 10px 10px 10px] Pass Web Animations: property from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1.5) should be [rgb(0, 192, 0) 10px 10px 10px 10px] -Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] -Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] +Pass CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] +Pass CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) should be [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) should be [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] -Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] -Fail CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] -Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] -Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] +Pass CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] +Pass CSS Transitions: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] +Pass CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] +Pass CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) should be [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) should be [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] -Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] -Fail CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] -Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] -Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] +Pass CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] +Pass CSS Transitions with transition: all: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] +Pass CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] +Pass CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) should be [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) should be [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] -Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] -Fail CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] -Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] -Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] +Pass CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] +Pass CSS Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] +Pass Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) should be [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] +Pass Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) should be [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) should be [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) should be [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] -Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] -Fail Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] +Pass Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) should be [rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px inset] +Pass Web Animations: property from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) should be [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] Fail CSS Transitions: property from [inset 0 0 0 0 black] to [inset 0 0 0 calc(max(10em, 20px) / 2) black] at (-0.3) should be [rgb(0, 0, 0) 0px 0px 0px -4.5px inset] Fail CSS Transitions: property from [inset 0 0 0 0 black] to [inset 0 0 0 calc(max(10em, 20px) / 2) black] at (0) should be [rgb(0, 0, 0) 0px 0px 0px 0px inset] Fail CSS Transitions: property from [inset 0 0 0 0 black] to [inset 0 0 0 calc(max(10em, 20px) / 2) black] at (0.3) should be [rgb(0, 0, 0) 0px 0px 0px 4.5px inset] diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/signs-abs-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/signs-abs-computed.txt index dff39f87e9a..951683a53f4 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/signs-abs-computed.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/signs-abs-computed.txt @@ -2,8 +2,8 @@ Harness status: OK Found 233 tests -209 Pass -24 Fail +212 Pass +21 Fail Pass abs(1) should be used-value-equivalent to 1 Pass sign(1) should be used-value-equivalent to 1 Pass abs(-1) should be used-value-equivalent to 1 @@ -222,9 +222,9 @@ Pass calc(50px + 100px * sign(38px - 2em)) should be used-value-equivalent to -5 Fail calc(90deg + 30deg * sign(42px - 2em)) should be used-value-equivalent to 120deg Fail calc(90deg + 30deg * sign(40px - 2em)) should be used-value-equivalent to 90deg Fail calc(90deg + 30deg * sign(38px - 2em)) should be used-value-equivalent to 60deg -Fail calc(5s + 15s * sign(42px - 2em)) should be used-value-equivalent to 20s -Fail calc(5s + 15s * sign(40px - 2em)) should be used-value-equivalent to 5s -Fail calc(5s + 15s * sign(38px - 2em)) should be used-value-equivalent to -10s +Pass calc(5s + 15s * sign(42px - 2em)) should be used-value-equivalent to 20s +Pass calc(5s + 15s * sign(40px - 2em)) should be used-value-equivalent to 5s +Pass calc(5s + 15s * sign(38px - 2em)) should be used-value-equivalent to -10s Fail calc(100dpi + 20dpi * sign(42px - 2em)) should be used-value-equivalent to 120dpi Fail calc(100dpi + 20dpi * sign(40px - 2em)) should be used-value-equivalent to 100dpi Fail calc(100dpi + 20dpi * sign(38px - 2em)) should be used-value-equivalent to 80dpi