Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/cssRotation.html

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <script> 5 <script>
6 var EPSILON = 1e-6; // float epsilon 6 var EPSILON = 1e-6; // float epsilon
7 function angle(deg) { 7 function angle(deg) {
8 return new CSSAngleValue(deg, 'deg'); 8 return new CSSUnitValue(deg, 'deg');
9 } 9 }
10 10
11 var values = [ 11 var values = [
12 {input: new CSSRotation(angle(0)), angle: 0, x: 0, y: 0, z: 1, 12 {input: new CSSRotation(angle(0)), angle: 0, x: 0, y: 0, z: 1,
13 is2D: true, cssText: "rotate(0deg)", 13 is2D: true, cssText: "rotate(0deg)",
14 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 1, 0, 0]))} , 14 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 1, 0, 0]))} ,
15 {input: new CSSRotation(angle(10)), angle: 10, x: 0, y: 0, z: 1, 15 {input: new CSSRotation(angle(10)), angle: 10, x: 0, y: 0, z: 1,
16 is2D: true, cssText: "rotate(10deg)", 16 is2D: true, cssText: "rotate(10deg)",
17 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9848077, 0.1736481 , -0.1736481, 0.9848077, 0, 0]))}, 17 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9848077, 0.1736481 , -0.1736481, 0.9848077, 0, 0]))},
18 {input: new CSSRotation(angle(-21)), angle: -21, x: 0, y: 0, z: 1, 18 {input: new CSSRotation(angle(-21)), angle: -21, x: 0, y: 0, z: 1,
19 is2D: true, cssText: "rotate(-21deg)", 19 is2D: true, cssText: "rotate(-21deg)",
20 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9335804, -0.358367 9, 0.3583679, 0.9335804, 0, 0]))}, 20 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9335804, -0.358367 9, 0.3583679, 0.9335804, 0, 0]))},
21 {input: new CSSRotation(angle(3.2)), angle: 3.2, x: 0, y: 0, z: 1, 21 {input: new CSSRotation(angle(3.2)), angle: 3.2, x: 0, y: 0, z: 1,
22 is2D: true, cssText: "rotate(3.2deg)", 22 is2D: true, cssText: "rotate(3.2deg)",
23 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9984407, 0.0558215 , -0.0558215, 0.9984407, 0, 0]))}, 23 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9984407, 0.0558215 , -0.0558215, 0.9984407, 0, 0]))},
24 {input: new CSSRotation(0, 0, 1, angle(90)), angle: 90, x: 0, y: 0, z: 1, 24 {input: new CSSRotation(0, 0, 1, angle(90)), angle: 90, x: 0, y: 0, z: 1,
25 is2D: false, cssText: "rotate3d(0, 0, 1, 90deg)", 25 is2D: false, cssText: "rotate3d(0, 0, 1, 90deg)",
26 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 1, 0, 0, -1, 0, 0 , 0, 0, 0, 1, 0, 0, 0, 0, 1]))}, 26 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 1, 0, 0, -1, 0, 0 , 0, 0, 0, 1, 0, 0, 0, 0, 1]))},
27 {input: new CSSRotation(2.7, -3, 4.4, angle(0)), angle: 0, x: 2.7, y: -3, z: 4 .4, 27 {input: new CSSRotation(2.7, -3, 4.4, angle(0)), angle: 0, x: 2.7, y: -3, z: 4 .4,
28 is2D: false, cssText: "rotate3d(2.7, -3, 4.4, 0deg)", 28 is2D: false, cssText: "rotate3d(2.7, -3, 4.4, 0deg)",
29 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]))}, 29 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]))},
30 {input: new CSSRotation(2, 3, 4, angle(10)), angle: 10, x: 2, y: 3, z: 4, 30 {input: new CSSRotation(2, 3, 4, angle(10)), angle: 10, x: 2, y: 3, z: 4,
31 is2D: false, cssText: "rotate3d(2, 3, 4, 10deg)", 31 is2D: false, cssText: "rotate3d(2, 3, 4, 10deg)",
32 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9869032, 0.1321258 , -0.0925460, 0, -0.1258394, 32 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9869032, 0.1321258 , -0.0925460, 0, -0.1258394,
33 0.9895225, 0.0707777, 0, 0.1009279, -0.0582048, 0.9931896, 0, 0, 0, 0, 1]) )}, 33 0.9895225, 0.0707777, 0, 0.1009279, -0.0582048, 0.9931896, 0, 0, 0, 0, 1]) )},
34 {input: new CSSRotation(2, 3.7, -4, angle(-1.2)), angle: -1.2, x: 2, y: 3.7, z : -4, 34 {input: new CSSRotation(2, 3.7, -4, angle(-1.2)), angle: -1.2, x: 2, y: 3.7, z : -4,
35 is2D: false, cssText: "rotate3d(2, 3.7, -4, -1.2deg)", 35 is2D: false, cssText: "rotate3d(2, 3.7, -4, -1.2deg)",
36 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9998067, 0.0144804 9, 0.0132978, 0, -0.0143841, 36 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([0.9998067, 0.0144804 9, 0.0132978, 0, -0.0143841,
37 0.9998698, -0.0073125, 0, -0.0134019, 0.0071198, 0.9998848, 0, 0, 0, 0, 1])) }, 37 0.9998698, -0.0073125, 0, -0.0134019, 0.0071198, 0.9998848, 0, 0, 0, 0, 1])) },
38 {input: new CSSRotation(1, 0, 0, new CSSAngleValue(0.5, 'turn')), angle: 180, x: 1, y: 0, z: 0, 38 {input: new CSSRotation(1, 0, 0, new CSSUnitValue(0.5, 'turn')), angle: 180, x : 1, y: 0, z: 0,
39 is2D: false, cssText: "rotate3d(1, 0, 0, 0.5turn)", 39 is2D: false, cssText: "rotate3d(1, 0, 0, 0.5turn)",
40 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 0, 0, -1, 1 .2246467991473532e-16, 0, 0, 40 asMatrix: new CSSMatrixComponent(new DOMMatrixReadOnly([1, 0, 0, 0, 0, -1, 1 .2246467991473532e-16, 0, 0,
41 -1.2246467991473532e-16, -1, 0, 0, 0, 0, 1]))} 41 -1.2246467991473532e-16, -1, 0, 0, 0, 0, 1]))}
42 ]; 42 ];
43 43
44 test(function() { 44 test(function() {
45 for (var i = 0; i < values.length; ++i) { 45 for (var i = 0; i < values.length; ++i) {
46 assert_equals(values[i].input.angle.degrees, values[i].angle); 46 assert_equals(values[i].input.angle.degrees, values[i].angle);
47 assert_equals(values[i].input.x, values[i].x); 47 assert_equals(values[i].input.x, values[i].x);
48 assert_equals(values[i].input.y, values[i].y); 48 assert_equals(values[i].input.y, values[i].y);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 for (var i = 0; i < actual.length; i++) { 85 for (var i = 0; i < actual.length; i++) {
86 assert_approx_equals(actual[i], expected[i], EPSILON); 86 assert_approx_equals(actual[i], expected[i], EPSILON);
87 } 87 }
88 } 88 }
89 89
90 function assert_matrix_approx_equals(actual, expected) { 90 function assert_matrix_approx_equals(actual, expected) {
91 assert_array_approx_equals(actual.toFloat64Array(), expected.toFloat64Array()) ; 91 assert_array_approx_equals(actual.toFloat64Array(), expected.toFloat64Array()) ;
92 } 92 }
93 93
94 </script> 94 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698