Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: LayoutTests/fast/css/image-orientation/image-orientation.html

Issue 1162793003: Add CSS image-orientation: from-image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add converter Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..dc4688cf08e840fa9261744806167cea436bcdf7
--- /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 img = document.createElement('img');
+document.body.appendChild(img);
+for (expected in expectations) {
+ expectations[expected].forEach(function(test) {
+ img.style.imageOrientation = '';
+ img.style.imageOrientation = test;
+ if (expected == '') {
+ shouldBe('img.style.cssText', '""');
+ shouldBe('getComputedStyle(img).imageOrientation', '"0deg"');
+ } else {
+ shouldBe('img.style.cssText', '"image-orientation: ' + test + ';"');
+ shouldBe('getComputedStyle(img).imageOrientation', '"' + expected + '"');
+ }
+ });
+}
+document.body.removeChild(img);
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698