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

Side by Side 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 unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698