OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src='../resources/testharness.js'></script> | |
3 <script src='../resources/testharnessreport.js'></script> | |
4 <script> | |
5 | |
6 test(function() { | |
7 var result = CSSLengthValue.from(5, 'px'); | |
8 assert_equals(result.constructor.name, CSSSimpleLength.name); | |
9 assert_equals(result.value, 5); | |
10 assert_equals(result.type, 'px'); | |
11 }, "Test that CSSLengthValue's static from(double value, LengthType type) method
produces a CSSSimpleLength."); | |
12 | |
13 test(function() { | |
14 var result = CSSLengthValue.from({px: 1, percent: 2.5}); | |
15 assert_equals(result.constructor.name, CSSCalcLength.name); | |
16 assert_equals(result.px, 1); | |
17 assert_equals(result.percent, 2.5); | |
18 }, "Test that CSSLengthValue's static from(CalcDictionary dictionary) method pro
duces a CSSCalcLength."); | |
19 | |
20 </script> | |
21 <body> | |
22 </body> | |
OLD | NEW |