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 img = document.createElement('img'); |
| 18 document.body.appendChild(img); |
| 19 for (expected in expectations) { |
| 20 expectations[expected].forEach(function(test) { |
| 21 img.style.imageOrientation = ''; |
| 22 img.style.imageOrientation = test; |
| 23 if (expected == '') { |
| 24 shouldBe('img.style.cssText', '""'); |
| 25 shouldBe('getComputedStyle(img).imageOrientation', '"0deg"'); |
| 26 } else { |
| 27 shouldBe('img.style.cssText', '"image-orientation: ' + test + ';"'); |
| 28 shouldBe('getComputedStyle(img).imageOrientation', '"' + expected +
'"'); |
| 29 } |
| 30 }); |
| 31 } |
| 32 document.body.removeChild(img); |
| 33 </script> |
| 34 </body> |
| 35 </html> |
OLD | NEW |