Chromium Code Reviews| Index: LayoutTests/fast/css/image-orientation/image-orientation.html |
| diff --git a/LayoutTests/fast/css/image-orientation/image-orientation.html b/LayoutTests/fast/css/image-orientation/image-orientation.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4e46888351c6098b76f3da6957329d6a573dee4b |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/image-orientation/image-orientation.html |
| @@ -0,0 +1,35 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<script> |
| +description('Apply image-orientation property and check computed style.'); |
| + |
| +var expectations = { |
| + 'from-image': ['from-image'], |
| + '0deg': ['0deg'], |
| + '': ['-360deg', '-315deg', '315deg', '360deg', '90deg', '-270deg', '-225deg', '45deg', |
| + '180deg', '-180deg', '-135deg', '135deg', '270deg', '-90deg', '-45deg', '225deg', '0'] |
| +}; |
| + |
| +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
|
| +document.body.appendChild(p); |
| +for (expected in expectations) { |
| + expectations[expected].forEach(function(test) { |
| + p.style.imageOrientation = ''; |
| + p.style.imageOrientation = test; |
| + if (expected == '') { |
| + shouldBe('p.style.cssText', '""'); |
| + shouldBe('getComputedStyle(p).imageOrientation', '"0deg"'); |
| + } else { |
| + shouldBe('p.style.cssText', '"image-orientation: ' + test + ';"'); |
| + shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '"'); |
| + } |
| + }); |
| +} |
| +document.body.removeChild(p); |
| +</script> |
| +</body> |
| +</html> |