mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Add absolutized method for TransformStyleValue
This commit is contained in:
parent
e675b95f51
commit
4a998879d5
|
|
@ -375,6 +375,27 @@ GC::Ref<CSSTransformComponent> TransformationStyleValue::reify_a_transform_funct
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue const> TransformationStyleValue::absolutized(ComputationContext const& computation_context) const
|
||||
{
|
||||
StyleValueVector absolutized_values;
|
||||
|
||||
bool absolutized_values_different = false;
|
||||
|
||||
for (auto const& value : m_properties.values) {
|
||||
auto const& absolutized_value = value->absolutized(computation_context);
|
||||
|
||||
if (absolutized_value != value)
|
||||
absolutized_values_different = true;
|
||||
|
||||
absolutized_values.append(absolutized_value);
|
||||
}
|
||||
|
||||
if (!absolutized_values_different)
|
||||
return *this;
|
||||
|
||||
return TransformationStyleValue::create(m_properties.property, m_properties.transform_function, move(absolutized_values));
|
||||
}
|
||||
|
||||
bool TransformationStyleValue::Properties::operator==(Properties const& other) const
|
||||
{
|
||||
return property == other.property
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ public:
|
|||
virtual String to_string(SerializationMode) const override;
|
||||
GC::Ref<CSSTransformComponent> reify_a_transform_function(JS::Realm&) const;
|
||||
|
||||
virtual ValueComparingNonnullRefPtr<StyleValue const> absolutized(ComputationContext const&) const override;
|
||||
|
||||
bool properties_equal(TransformationStyleValue const& other) const { return m_properties == other.m_properties; }
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ Harness status: OK
|
|||
|
||||
Found 19 tests
|
||||
|
||||
18 Pass
|
||||
1 Fail
|
||||
19 Pass
|
||||
Pass Property translate value 'none'
|
||||
Pass Property translate value '0px'
|
||||
Pass Property translate value '100%'
|
||||
|
|
@ -20,6 +19,6 @@ Pass Property translate value '100px 200px 300px'
|
|||
Pass Property translate value '100% 200% 300px'
|
||||
Pass Property translate value '100% 0% 200px'
|
||||
Pass Property translate value '0% 0% 100px'
|
||||
Fail Property translate value '0em 0em 100px'
|
||||
Pass Property translate value '0em 0em 100px'
|
||||
Pass Property translate value '0'
|
||||
Pass Property translate value '1px 2px 0'
|
||||
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 45 tests
|
||||
|
||||
34 Pass
|
||||
11 Fail
|
||||
36 Pass
|
||||
9 Fail
|
||||
Pass acos(1) should be used-value-equivalent to 0deg
|
||||
Pass atan(0) should be used-value-equivalent to 0deg
|
||||
Pass asin(0) should be used-value-equivalent to 0deg
|
||||
|
|
@ -39,9 +39,9 @@ Fail atan2(1em, -1em) should be used-value-equivalent to 135deg
|
|||
Fail atan2(1ex, -1ex) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1ch, -1ch) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1rem, -1rem) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1rem + 1px - 1px, -1rem) should be used-value-equivalent to 135deg
|
||||
Pass atan2(1rem + 1px - 1px, -1rem) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1vh, -1vh) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1vh + 0px, -1vh + 0px) should be used-value-equivalent to 135deg
|
||||
Pass atan2(1vh + 0px, -1vh + 0px) should be used-value-equivalent to 135deg
|
||||
Fail atan2(1vw, -1vw) should be used-value-equivalent to 135deg
|
||||
Pass atan2(1deg, -1deg) should be used-value-equivalent to 135deg
|
||||
Pass atan2(1grad, -1grad) should be used-value-equivalent to 135deg
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 233 tests
|
||||
|
||||
212 Pass
|
||||
21 Fail
|
||||
221 Pass
|
||||
12 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
|
||||
|
|
@ -210,18 +210,18 @@ Pass abs(-1turn) should be used-value-equivalent to 1turn
|
|||
Pass sign(10px - 1em) should be used-value-equivalent to 0; fontSize=10px
|
||||
Pass sign(10px - 2em) should be used-value-equivalent to -1; fontSize=10px
|
||||
Pass calc(sign(10%) * 100px) should be used-value-equivalent to 100px
|
||||
Fail calc(2.5 - sign(41px - 2em) / 2) should be used-value-equivalent to 2
|
||||
Fail calc(2.5 - sign(40px - 2em) / 2) should be used-value-equivalent to 2.5
|
||||
Fail calc(2.5 - sign(39px - 2em) / 2) should be used-value-equivalent to 3
|
||||
Pass calc(2.5 - sign(41px - 2em) / 2) should be used-value-equivalent to 2
|
||||
Pass calc(2.5 - sign(40px - 2em) / 2) should be used-value-equivalent to 2.5
|
||||
Pass calc(2.5 - sign(39px - 2em) / 2) should be used-value-equivalent to 3
|
||||
Pass calc(3 + sign(42px - 2em)) should be used-value-equivalent to 4
|
||||
Pass calc(3 + sign(40px - 2em)) should be used-value-equivalent to 3
|
||||
Pass calc(3 + sign(38px - 2em)) should be used-value-equivalent to 2
|
||||
Pass calc(50px + 100px * sign(42px - 2em)) should be used-value-equivalent to 150px
|
||||
Pass calc(50px + 100px * sign(40px - 2em)) should be used-value-equivalent to 50px
|
||||
Pass calc(50px + 100px * sign(38px - 2em)) should be used-value-equivalent to -50px
|
||||
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
|
||||
Pass calc(90deg + 30deg * sign(42px - 2em)) should be used-value-equivalent to 120deg
|
||||
Pass calc(90deg + 30deg * sign(40px - 2em)) should be used-value-equivalent to 90deg
|
||||
Pass calc(90deg + 30deg * sign(38px - 2em)) should be used-value-equivalent to 60deg
|
||||
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
|
||||
|
|
@ -231,9 +231,9 @@ Fail calc(100dpi + 20dpi * sign(38px - 2em)) should be used-value-equivalent to
|
|||
Fail calc(3fr + 1fr * sign(42px - 2em)) should be used-value-equivalent to 4fr
|
||||
Fail calc(3fr + 1fr * sign(40px - 2em)) should be used-value-equivalent to 3fr
|
||||
Fail calc(3fr + 1fr * sign(38px - 2em)) should be used-value-equivalent to 2fr
|
||||
Fail calc(2.5 - sign(33px - 2rem) / 2) should be used-value-equivalent to 2
|
||||
Fail calc(2.5 - sign(32px - 2rem) / 2) should be used-value-equivalent to 2.5
|
||||
Fail calc(2.5 - sign(31px - 2rem) / 2) should be used-value-equivalent to 3
|
||||
Pass calc(2.5 - sign(33px - 2rem) / 2) should be used-value-equivalent to 2
|
||||
Pass calc(2.5 - sign(32px - 2rem) / 2) should be used-value-equivalent to 2.5
|
||||
Pass calc(2.5 - sign(31px - 2rem) / 2) should be used-value-equivalent to 3
|
||||
Pass calc(50px + 100px * sign(34px - 2rem)) should be used-value-equivalent to 150px
|
||||
Pass calc(50px + 100px * sign(32px - 2rem)) should be used-value-equivalent to 50px
|
||||
Pass calc(50px + 100px * sign(30px - 2rem)) should be used-value-equivalent to -50px
|
||||
Loading…
Reference in New Issue
Block a user