OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <p id="description"></p> | |
8 <div id="console"></div> | |
9 <div id="aspectRatioTest"></div> | |
10 <script> | |
11 description('CSS Aspect Ratio Parsing Test'); | |
12 function testParsing(elementId, value, styleAttribute) | |
13 { | |
14 var div = document.getElementById(elementId); | |
15 div.style[styleAttribute] = value; | |
16 return div.style[styleAttribute]; | |
17 } | |
18 | |
19 shouldBeEqualToString('testParsing("aspectRatioTest", "2/1", "-webkit-aspe
ct-ratio")', '2/1'); | |
20 shouldBeEqualToString('testParsing("aspectRatioTest", "1/1", "-webkit-aspe
ct-ratio")', '1/1'); | |
21 shouldBeEqualToString('testParsing("aspectRatioTest", "1/4", "-webkit-aspe
ct-ratio")', '1/4'); | |
22 shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 2", "-webkit-as
pect-ratio")', '1/2'); | |
23 shouldBeEqualToString('testParsing("aspectRatioTest", "1.2 / 2", "-webkit-
aspect-ratio")', '1.2/2'); | |
24 shouldBeEqualToString('testParsing("aspectRatioTest", "2 / 0.5", "-webkit-
aspect-ratio")', '2/0.5'); | |
25 shouldBeEqualToString('testParsing("aspectRatioTest", "inherit", "-webkit-
aspect-ratio")', 'inherit'); | |
26 shouldBeEqualToString('testParsing("aspectRatioTest", "none", "-webkit-asp
ect-ratio")', 'none'); | |
27 | |
28 // The following are invalid and should get ignored. | |
29 shouldBeEqualToString('testParsing("aspectRatioTest", "1 2", "-webkit-aspe
ct-ratio")', 'none'); | |
30 shouldBeEqualToString('testParsing("aspectRatioTest", "a/1", "-webkit-aspe
ct-ratio")', 'none'); | |
31 shouldBeEqualToString('testParsing("aspectRatioTest", "1/a", "-webkit-aspe
ct-ratio")', 'none'); | |
32 shouldBeEqualToString('testParsing("aspectRatioTest", "abc123", "-webkit-a
spect-ratio")', 'none'); | |
33 shouldBeEqualToString('testParsing("aspectRatioTest", "1", "-webkit-aspect
-ratio")', 'none'); | |
34 shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 0", "-webkit-as
pect-ratio")', 'none'); | |
35 shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 1", "-webkit-as
pect-ratio")', 'none'); | |
36 shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 0", "-webkit-as
pect-ratio")', 'none'); | |
37 shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / 8", "-webkit-a
spect-ratio")', 'none'); | |
38 shouldBeEqualToString('testParsing("aspectRatioTest", "1 / -9", "-webkit-a
spect-ratio")', 'none'); | |
39 shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / -4", "-webkit-
aspect-ratio")', 'none'); | |
40 </script> | |
41 </body> | |
42 </html> | |
OLD | NEW |