Skip to content

Commit

Permalink
[CSS Math Functions] Correctly serialize abs/sign/exp/log/pow/sqrt ro…
Browse files Browse the repository at this point in the history
…ot nodes

https://bugs.webkit.org/show_bug.cgi?id=259012
rdar://111948465

Reviewed by Darin Adler.

From the spec https://drafts.csswg.org/css-values-4/#calc-simplification:

> If root is an operator node that’s not one of the calc-operator nodes, and all of its calculation children are numeric values with enough information to compute the operation root represents, return the result of running root’s operation using its children, expressed in the result’s canonical unit.

We now always try to resolve the top-level abs/sign/exp/log/pow/sqrt functions, e.g. abs(-1) now becomes calc(1) instead of staying abs(-1).
This is consistent with calc(abs(-1)) being serialized as calc(1).

* LayoutTests/imported/w3c/web-platform-tests/css/css-values/exp-log-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/exp-log-serialize.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/hypot-pow-sqrt-invalid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/hypot-pow-sqrt-invalid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/hypot-pow-sqrt-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/hypot-pow-sqrt-serialize.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/signs-abs-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/signs-abs-serialize.html:

Re-import WPT with fixes from upstream.

* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::simplifyNode):
* Source/WebCore/css/calc/CSSCalcOperationNode.h:

Canonical link: https://commits.webkit.org/265879@main
  • Loading branch information
nt1m committed Jul 8, 2023
1 parent 2517a54 commit ea22468
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

FAIL 'exp(0)' as a specified value should serialize as 'calc(1)'. assert_equals: 'exp(0)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "exp(0)"
FAIL 'scale(exp(0))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(exp(0))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(exp(0))"
PASS 'exp(0)' as a specified value should serialize as 'calc(1)'.
PASS 'scale(exp(0))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'exp(0)' as a computed value should serialize as '1'.
PASS 'scale(exp(0))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
FAIL 'log(1)' as a specified value should serialize as 'calc(0)'. assert_equals: 'log(1)' and 'calc(0)' should serialize the same in specified values. expected "calc(0)" but got "log(1)"
FAIL 'scale(log(1))' as a specified value should serialize as 'scale(calc(0))'. assert_equals: 'scale(log(1))' and 'scale(calc(0))' should serialize the same in specified values. expected "scale(calc(0))" but got "scale(log(1))"
PASS 'log(1)' as a specified value should serialize as 'calc(0)'.
PASS 'scale(log(1))' as a specified value should serialize as 'scale(calc(0))'.
PASS 'log(1)' as a computed value should serialize as '0'.
PASS 'scale(log(1))' as a computed value should serialize as 'matrix(0, 0, 0, 0, 0, 0)'.
PASS 'calc(exp(0) + log(1) + log(1))' as a specified value should serialize as 'calc(1)'.
Expand All @@ -17,6 +17,5 @@ PASS 'calc(log(1) + 0.5)' as a computed value should serialize as '0.5'.
PASS 'scale(calc(log(1) + 0.5))' as a computed value should serialize as 'matrix(0.5, 0, 0, 0.5, 0, 0)'.
PASS 'calc(log(0))' as a specified value should serialize as 'calc(-infinity)'.
PASS 'scale(calc(log(0)))' as a specified value should serialize as 'scale(calc(-infinity))'.
FAIL 'calc(log(0))' as a computed value should serialize as '-infinity'. assert_equals: '-infinity' should round-trip exactly in computed values. expected "-infinity" but got "1"
FAIL 'scale(calc(log(0)))' as a computed value should serialize as 'matrix(-infinity, 0, 0, -infinity, 0, 0)'. assert_equals: 'matrix(-infinity, 0, 0, -infinity, 0, 0)' should round-trip exactly in computed values. expected "matrix(-infinity, 0, 0, -infinity, 0, 0)" but got "none"
PASS 'calc(log(0))' as a computed value should serialize as '0'.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#comp-func">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#exponent-funcs">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Apple Inc">
Expand Down Expand Up @@ -33,8 +33,11 @@
'calc(log(1) + 0.5)',
'calc(0.5)',
'0.5');
test_serialization(
'calc(log(0))',
'calc(-infinity)',
'-infinity');
</script>

const t = 'calc(log(0))';
const s = 'calc(-infinity)';
const c = '0';
test_specified_serialization('opacity', t, s);
test_specified_serialization('transform', `scale(${t})`, `scale(${s})`);
test_computed_serialization('opacity', t, c);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ PASS e.style['opacity'] = "hypot(1 * )" should not set the property value
PASS e.style['opacity'] = "hypot(1 / )" should not set the property value
PASS e.style['opacity'] = "hypot(1 2)" should not set the property value
PASS e.style['opacity'] = "hypot(1, , 2)" should not set the property value
FAIL e.style['opacity'] = "hypot(1, 2)" should not set the property value assert_equals: expected "" but got "calc(2.236068)"
PASS e.style['opacity'] = "sqrt()" should not set the property value
PASS e.style['opacity'] = "sqrt( )" should not set the property value
PASS e.style['opacity'] = "sqrt(,)" should not set the property value
Expand All @@ -33,17 +32,18 @@ PASS e.style['opacity'] = "pow(1 * )" should not set the property value
PASS e.style['opacity'] = "pow(1 / )" should not set the property value
PASS e.style['opacity'] = "pow(1 2)" should not set the property value
PASS e.style['opacity'] = "pow(1, , 2)" should not set the property value
FAIL e.style['opacity'] = "pow(1, 2)" should not set the property value assert_equals: expected "" but got "pow(1, 2)"
PASS e.style['letter-spacing'] = "calc(1px * pow(1))" should not set the property value
PASS e.style['letter-spacing'] = "calc(1px * pow(2px, 3px))" should not set the property value
PASS e.style['letter-spacing'] = "calc(sqrt(100px)" should not set the property value
PASS e.style['letter-spacing'] = "hypot(2px, 40%)" should not set the property value
PASS e.style['letter-spacing'] = "hypot(2px, 3)" should not set the property value
PASS e.style['letter-spacing'] = "hypot(3, ,4)" should not set the property value
PASS e.style['letter-spacing'] = "hypot(1, 2)" should not set the property value
PASS e.style['letter-spacing'] = "calc(1px * pow(2 3))" should not set the property value
PASS e.style['letter-spacing'] = "hypot()" should not set the property value
PASS e.style['letter-spacing'] = "calc(pow(2))" should not set the property value
PASS e.style['letter-spacing'] = "pow())" should not set the property value
PASS e.style['letter-spacing'] = "pow(1, 2)" should not set the property value
PASS e.style['letter-spacing'] = "calc(sqrt())" should not set the property value
PASS e.style['letter-spacing'] = "calc(sqrt(100, 200))" should not set the property value

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#comp-func">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#exponent-funcs">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-type-checking">
<link rel="author" title="Apple Inc">
Expand Down Expand Up @@ -27,7 +27,6 @@
test_invalid_number('hypot(1 / )');
test_invalid_number('hypot(1 2)');
test_invalid_number('hypot(1, , 2)');
test_invalid_number('hypot(1, 2)');
test_invalid_number('sqrt()');
test_invalid_number('sqrt( )');
test_invalid_number('sqrt(,)');
Expand All @@ -50,7 +49,6 @@
test_invalid_number('pow(1 / )');
test_invalid_number('pow(1 2)');
test_invalid_number('pow(1, , 2)');
test_invalid_number('pow(1, 2)');

// General tests
test_invalid_length('calc(1px * pow(1))');
Expand All @@ -59,10 +57,12 @@
test_invalid_length('hypot(2px, 40%)');
test_invalid_length('hypot(2px, 3)');
test_invalid_length('hypot(3, ,4)');
test_invalid_length('hypot(1, 2)');
test_invalid_length('calc(1px * pow(2 3))');
test_invalid_length('hypot()');
test_invalid_length('calc(pow(2))');
test_invalid_length('pow())');
test_invalid_length('pow(1, 2)');
test_invalid_length('calc(sqrt())');
test_invalid_length('calc(sqrt(100, 200))');
</script>
</script>
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@

FAIL 'pow(1,1)' as a specified value should serialize as 'calc(1)'. assert_equals: 'pow(1,1)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "pow(1, 1)"
FAIL 'scale(pow(1,1))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(pow(1,1))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(pow(1, 1))"
PASS 'pow(1,1)' as a specified value should serialize as 'calc(1)'.
PASS 'scale(pow(1,1))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'pow(1,1)' as a computed value should serialize as '1'.
PASS 'scale(pow(1,1))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
PASS 'hypot(1)' as a specified value should serialize as 'calc(1)'.
PASS 'scale(hypot(1))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'hypot(1)' as a computed value should serialize as '1'.
PASS 'scale(hypot(1))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
FAIL 'sqrt(1)' as a specified value should serialize as 'calc(1)'. assert_equals: 'sqrt(1)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "sqrt(1)"
FAIL 'scale(sqrt(1))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(sqrt(1))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(sqrt(1))"
PASS 'sqrt(1)' as a specified value should serialize as 'calc(1)'.
PASS 'scale(sqrt(1))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'sqrt(1)' as a computed value should serialize as '1'.
PASS 'scale(sqrt(1))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
PASS 'calc(pow(1,1) + 1)' as a specified value should serialize as 'calc(2)'.
PASS 'scale(calc(pow(1,1) + 1))' as a specified value should serialize as 'scale(calc(2))'.
FAIL 'calc(pow(1,1) + 1)' as a computed value should serialize as '2'. assert_equals: '2' should round-trip exactly in computed values. expected "2" but got "1"
PASS 'scale(calc(pow(1,1) + 1))' as a computed value should serialize as 'matrix(2, 0, 0, 2, 0, 0)'.
PASS 'calc(hypot(1) * 2)' as a specified value should serialize as 'calc(2)'.
PASS 'scale(calc(hypot(1) * 2))' as a specified value should serialize as 'scale(calc(2))'.
FAIL 'calc(hypot(1) * 2)' as a computed value should serialize as '2'. assert_equals: '2' should round-trip exactly in computed values. expected "2" but got "1"
PASS 'scale(calc(hypot(1) * 2))' as a computed value should serialize as 'matrix(2, 0, 0, 2, 0, 0)'.
PASS 'calc(pow(1,1) - 0.5)' as a specified value should serialize as 'calc(0.5)'.
PASS 'scale(calc(pow(1,1) - 0.5))' as a specified value should serialize as 'scale(calc(0.5))'.
PASS 'calc(pow(1,1) - 0.5)' as a computed value should serialize as '0.5'.
PASS 'scale(calc(pow(1,1) - 0.5))' as a computed value should serialize as 'matrix(0.5, 0, 0, 0.5, 0, 0)'.
PASS 'calc(hypot(1) * 0.5)' as a specified value should serialize as 'calc(0.5)'.
PASS 'scale(calc(hypot(1) * 0.5))' as a specified value should serialize as 'scale(calc(0.5))'.
PASS 'calc(hypot(1) * 0.5)' as a computed value should serialize as '0.5'.
PASS 'scale(calc(hypot(1) * 0.5))' as a computed value should serialize as 'matrix(0.5, 0, 0, 0.5, 0, 0)'.
PASS 'calc(sqrt(1) - 1)' as a specified value should serialize as 'calc(0)'.
PASS 'scale(calc(sqrt(1) - 1))' as a specified value should serialize as 'scale(calc(0))'.
PASS 'calc(sqrt(1) - 1)' as a computed value should serialize as '0'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#comp-func">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#exponent-funcs">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Apple Inc">
Expand Down Expand Up @@ -29,15 +29,15 @@
'1');

test_serialization(
'calc(pow(1,1) + 1)',
'calc(2)',
'2');
'calc(pow(1,1) - 0.5)',
'calc(0.5)',
'0.5');
test_serialization(
'calc(hypot(1) * 2)',
'calc(2)',
'2');
'calc(hypot(1) * 0.5)',
'calc(0.5)',
'0.5');
test_serialization(
'calc(sqrt(1) - 1)',
'calc(0)',
'0');
</script>
</script>
Original file line number Diff line number Diff line change
@@ -1,58 +1,18 @@

FAIL 'abs(1)' as a specified value should serialize as 'calc(1)'. assert_equals: 'abs(1)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "abs(1)"
FAIL 'scale(abs(1))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(abs(1))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(abs(1))"
PASS 'abs(1)' as a computed value should serialize as '1'.
PASS 'scale(abs(1))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
FAIL 'sign(.1)' as a specified value should serialize as 'calc(1)'. assert_equals: 'sign(.1)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "sign(0.1)"
FAIL 'scale(sign(.1))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(sign(.1))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(sign(0.1))"
PASS 'sign(.1)' as a computed value should serialize as '1'.
PASS 'scale(sign(.1))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
FAIL 'abs(1 + 2 + 3)' as a specified value should serialize as 'calc(6)'. assert_equals: 'abs(1 + 2 + 3)' and 'calc(6)' should serialize the same in specified values. expected "calc(6)" but got "abs(6)"
FAIL 'scale(abs(1 + 2 + 3))' as a specified value should serialize as 'scale(calc(6))'. assert_equals: 'scale(abs(1 + 2 + 3))' and 'scale(calc(6))' should serialize the same in specified values. expected "scale(calc(6))" but got "scale(abs(6))"
FAIL 'abs(1 + 2 + 3)' as a computed value should serialize as '6'. assert_equals: '6' should round-trip exactly in computed values. expected "6" but got "1"
PASS 'scale(abs(1 + 2 + 3))' as a computed value should serialize as 'matrix(6, 0, 0, 6, 0, 0)'.
FAIL 'sign(1 + 2 + 3)' as a specified value should serialize as 'calc(1)'. assert_equals: 'sign(1 + 2 + 3)' and 'calc(1)' should serialize the same in specified values. expected "calc(1)" but got "sign(6)"
FAIL 'scale(sign(1 + 2 + 3))' as a specified value should serialize as 'scale(calc(1))'. assert_equals: 'scale(sign(1 + 2 + 3))' and 'scale(calc(1))' should serialize the same in specified values. expected "scale(calc(1))" but got "scale(sign(6))"
PASS 'sign(1 + 2 + 3)' as a computed value should serialize as '1'.
PASS 'scale(sign(1 + 2 + 3))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
PASS 'calc(abs(1) + abs(2))' as a specified value should serialize as 'calc(3)'.
PASS 'scale(abs(1))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'scale(sign(.1))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'scale(abs(1 + 2 + 3))' as a specified value should serialize as 'scale(calc(6))'.
PASS 'scale(sign(1 + 2 + 3))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'scale(calc(abs(1) + abs(2)))' as a specified value should serialize as 'scale(calc(3))'.
FAIL 'calc(abs(1) + abs(2))' as a computed value should serialize as '3'. assert_equals: '3' should round-trip exactly in computed values. expected "3" but got "1"
PASS 'scale(calc(abs(1) + abs(2)))' as a computed value should serialize as 'matrix(3, 0, 0, 3, 0, 0)'.
PASS 'calc(sign(.1) + sign(.2))' as a specified value should serialize as 'calc(2)'.
PASS 'scale(calc(sign(.1) + sign(.2)))' as a specified value should serialize as 'scale(calc(2))'.
FAIL 'calc(sign(.1) + sign(.2))' as a computed value should serialize as '2'. assert_equals: '2' should round-trip exactly in computed values. expected "2" but got "1"
PASS 'scale(calc(sign(.1) + sign(.2)))' as a computed value should serialize as 'matrix(2, 0, 0, 2, 0, 0)'.
PASS 'calc(1 + abs(1))' as a specified value should serialize as 'calc(2)'.
PASS 'scale(calc(1 + abs(1)))' as a specified value should serialize as 'scale(calc(2))'.
FAIL 'calc(1 + abs(1))' as a computed value should serialize as '2'. assert_equals: '2' should round-trip exactly in computed values. expected "2" but got "1"
PASS 'scale(calc(1 + abs(1)))' as a computed value should serialize as 'matrix(2, 0, 0, 2, 0, 0)'.
PASS 'calc(sign(.1) + 1)' as a specified value should serialize as 'calc(2)'.
PASS 'scale(calc(sign(.1) + 1))' as a specified value should serialize as 'scale(calc(2))'.
FAIL 'calc(sign(.1) + 1)' as a computed value should serialize as '2'. assert_equals: '2' should round-trip exactly in computed values. expected "2" but got "1"
PASS 'scale(calc(sign(.1) + 1))' as a computed value should serialize as 'matrix(2, 0, 0, 2, 0, 0)'.
FAIL 'calc(abs(inFinity))' as a specified value should serialize as 'calc(inFinity)'. assert_equals: 'calc(inFinity)' should round-trip exactly in specified values. expected "calc(inFinity)" but got "calc(infinity)"
PASS 'scale(calc(abs(inFinity)))' as a specified value should serialize as 'scale(calc(infinity))'.
FAIL 'calc(abs(inFinity))' as a computed value should serialize as 'infinity'. assert_equals: 'infinity' should round-trip exactly in computed values. expected "infinity" but got "1"
FAIL 'scale(calc(abs(inFinity)))' as a computed value should serialize as 'matrix(infinity, 0, 0, infinity, 0, 0)'. assert_equals: 'matrix(infinity, 0, 0, infinity, 0, 0)' should round-trip exactly in computed values. expected "matrix(infinity, 0, 0, infinity, 0, 0)" but got "none"
PASS 'calc(abs(infinity))' as a specified value should serialize as 'calc(infinity)'.
PASS 'scale(calc(abs(infinity)))' as a specified value should serialize as 'scale(calc(infinity))'.
FAIL 'calc(abs(infinity))' as a computed value should serialize as 'infinity'. assert_equals: 'infinity' should round-trip exactly in computed values. expected "infinity" but got "1"
FAIL 'scale(calc(abs(infinity)))' as a computed value should serialize as 'matrix(infinity, 0, 0, infinity, 0, 0)'. assert_equals: 'matrix(infinity, 0, 0, infinity, 0, 0)' should round-trip exactly in computed values. expected "matrix(infinity, 0, 0, infinity, 0, 0)" but got "none"
PASS 'calc(sign(infinity))' as a specified value should serialize as 'calc(1)'.
PASS 'scale(calc(sign(infinity)))' as a specified value should serialize as 'scale(calc(1))'.
PASS 'calc(sign(infinity))' as a computed value should serialize as '1'.
PASS 'scale(calc(sign(infinity)))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.
FAIL 'abs(infinity)' as a specified value should serialize as 'calc(infinity)'. assert_equals: 'abs(infinity)' and 'calc(infinity)' should serialize the same in specified values. expected "calc(infinity)" but got "abs(infinity)"
FAIL 'scale(abs(infinity))' as a specified value should serialize as 'scale(calc(infinity))'. assert_equals: 'scale(abs(infinity))' and 'scale(calc(infinity))' should serialize the same in specified values. expected "scale(calc(infinity))" but got "scale(abs(infinity))"
FAIL 'abs(infinity)' as a computed value should serialize as 'infinity'. assert_equals: 'infinity' should round-trip exactly in computed values. expected "infinity" but got "1"
FAIL 'scale(abs(infinity))' as a computed value should serialize as 'matrix(infinity, 0, 0, infinity, 0, 0)'. assert_equals: 'matrix(infinity, 0, 0, infinity, 0, 0)' should round-trip exactly in computed values. expected "matrix(infinity, 0, 0, infinity, 0, 0)" but got "none"
PASS 'calc(abs(-infinity))' as a specified value should serialize as 'calc(infinity)'.
PASS 'scale(abs(infinity))' as a specified value should serialize as 'scale(calc(infinity))'.
PASS 'scale(calc(abs(-infinity)))' as a specified value should serialize as 'scale(calc(infinity))'.
FAIL 'calc(abs(-infinity))' as a computed value should serialize as 'infinity'. assert_equals: 'infinity' should round-trip exactly in computed values. expected "infinity" but got "1"
FAIL 'scale(calc(abs(-infinity)))' as a computed value should serialize as 'matrix(infinity, 0, 0, infinity, 0, 0)'. assert_equals: 'matrix(infinity, 0, 0, infinity, 0, 0)' should round-trip exactly in computed values. expected "matrix(infinity, 0, 0, infinity, 0, 0)" but got "none"
PASS 'calc(sign(-1 * infinity))' as a specified value should serialize as 'calc(-1)'.
PASS 'scale(calc(sign(-1 * infinity)))' as a specified value should serialize as 'scale(calc(-1))'.
FAIL 'calc(sign(-1 * infinity))' as a computed value should serialize as '-1'. assert_equals: '-1' should round-trip exactly in computed values. expected "-1" but got "0"
PASS 'scale(calc(sign(-1 * infinity)))' as a computed value should serialize as 'matrix(-1, 0, 0, -1, 0, 0)'.
PASS 'scale(calc(sign(-1 * NaN)))' as a specified value should serialize as 'scale(calc(NaN))'.
PASS 'scale(calc(sign(1 * NaN)))' as a specified value should serialize as 'scale(calc(NaN))'.

Loading

0 comments on commit ea22468

Please sign in to comment.