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

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

Issue 2884963002: [css-typed-om] replace is2D() method with attribute in CSSTransformValue. (Closed)
Patch Set: [css-typed-om] replace is2D() method with attribute in CSSTransformValue. Created 3 years, 7 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 6
7 test(function() { 7 test(function() {
8 var transformValueObject = new CSSTransformValue(); 8 var transformValueObject = new CSSTransformValue();
9 assert_equals(transformValueObject.constructor.name, CSSTransformValue.name) ; 9 assert_equals(transformValueObject.constructor.name, CSSTransformValue.name) ;
10 }, "A CSSTransformValue object can be constructed"); 10 }, "A CSSTransformValue object can be constructed");
11 11
12 test(function() { 12 test(function() {
13 var transformArray = [new CSSScale(2,2), 13 var transformArray = [new CSSScale(2,2),
14 new CSSMatrixComponent(1,1,1,1,1,1), new CSSScale(5,6)]; 14 new CSSMatrixComponent(1,1,1,1,1,1), new CSSScale(5,6)];
15 var transformValue = new CSSTransformValue(transformArray); 15 var transformValue = new CSSTransformValue(transformArray);
16 assert_true(transformValue.is2D()); 16 assert_true(transformValue.is2D);
17 }, "is2D returns true for transformValues containing only 2D transformComponents "); 17 }, "is2D returns true for transformValues containing only 2D transformComponents ");
18 18
19 test(function() { 19 test(function() {
20 var transformArray = [new CSSScale(2,2), 20 var transformArray = [new CSSScale(2,2),
21 new CSSMatrixComponent(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), new CSSScale(5,6)]; 21 new CSSMatrixComponent(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), new CSSScale(5,6)];
22 var transformValue = new CSSTransformValue(transformArray); 22 var transformValue = new CSSTransformValue(transformArray);
23 assert_false(transformValue.is2D()); 23 assert_false(transformValue.is2D);
24 }, "is2D returns false for transformValues containing both 2D and 3D transformCo mponents"); 24 }, "is2D returns false for transformValues containing both 2D and 3D transformCo mponents");
25 25
26 test(function() { 26 test(function() {
27 var transformArray = [new CSSScale(2,2), 27 var transformArray = [new CSSScale(2,2),
28 new CSSMatrixComponent(1,1,1,1,1,1), new CSSScale(5,6)]; 28 new CSSMatrixComponent(1,1,1,1,1,1), new CSSScale(5,6)];
29 var transformValue = new CSSTransformValue(transformArray); 29 var transformValue = new CSSTransformValue(transformArray);
30 30
31 var newTransformArray = []; 31 var newTransformArray = [];
32 for (var component of transformValue) { 32 for (var component of transformValue) {
33 newTransformArray.push(component); 33 newTransformArray.push(component);
34 } 34 }
35 assert_true(newTransformArray.length == 3); 35 assert_true(newTransformArray.length == 3);
36 assert_equals(newTransformArray[0].constructor.name, CSSScale.name); 36 assert_equals(newTransformArray[0].constructor.name, CSSScale.name);
37 assert_equals(newTransformArray[1].constructor.name, CSSMatrixComponent.name); 37 assert_equals(newTransformArray[1].constructor.name, CSSMatrixComponent.name);
38 assert_equals(newTransformArray[2].constructor.name, CSSScale.name); 38 assert_equals(newTransformArray[2].constructor.name, CSSScale.name);
39 }, "CSSTransformValue can iterate through all its all its transformComponent mem bers"); 39 }, "CSSTransformValue can iterate through all its all its transformComponent mem bers");
40 40
41 </script> 41 </script>
42 42
43 <body> 43 <body>
44 </body> 44 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698