blob: e384818be938e5df8b1cda8fd3ecc596cf343de7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Apply image-orientation property and check computed style.');
var expectations = {
'0deg': ['-360deg', '-315deg', '0deg', '315deg', '360deg'],
'90deg': ['-270deg', '-225deg', '45deg', '90deg'],
'180deg': ['-180deg', '-135deg', '135deg', '-180deg'],
'270deg': ['-90deg', '-45deg', '225deg', '270deg']};
var p = document.createElement('p');
document.body.appendChild(p);
for (expected in expectations) {
expectations[expected].forEach(function(test) {
p.style.imageOrientation = '';
p.style.imageOrientation = test;
shouldBe('p.style.cssText', '"image-orientation: ' + test + ';"');
shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '"');
});
}
document.body.removeChild(p);
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>