OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <script> | |
8 description('Apply image-orientation property and check computed style.'); | |
9 | |
10 var expectations = { | |
11 'from-image': ['from-image'], | |
12 '0deg': ['0deg'], | |
13 '': ['-360deg', '-315deg', '315deg', '360deg', '90deg', '-270deg', '-225deg' , '45deg', | |
14 '180deg', '-180deg', '-135deg', '135deg', '270deg', '-90deg', '-45deg', '225 deg', '0'] | |
15 }; | |
16 | |
17 var p = document.createElement('p'); | |
Noel Gordon
2015/06/19 07:41:25
Not following: are you testing that imageOrientati
rwlbuis
2015/06/19 16:03:15
It does not matter for the test from CSSComputedSt
| |
18 document.body.appendChild(p); | |
19 for (expected in expectations) { | |
20 expectations[expected].forEach(function(test) { | |
21 p.style.imageOrientation = ''; | |
22 p.style.imageOrientation = test; | |
23 if (expected == '') { | |
24 shouldBe('p.style.cssText', '""'); | |
25 shouldBe('getComputedStyle(p).imageOrientation', '"0deg"'); | |
26 } else { | |
27 shouldBe('p.style.cssText', '"image-orientation: ' + test + ';"'); | |
28 shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '" '); | |
29 } | |
30 }); | |
31 } | |
32 document.body.removeChild(p); | |
33 </script> | |
34 </body> | |
35 </html> | |
OLD | NEW |