summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/images/exif-orientation-image-document.html
blob: 942869163302dd719a173cfce41dd5d1bc25a347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html>
<head>
<script>
if (window.testRunner) {
    // Note that this test only passes in DRT. In browsers, the cross-iframe dom inspection usually causes a security exception.
    testRunner.dumpAsTextWithPixelResults();
}

function log(str) {
    var li = document.createElement("li");
    li.appendChild(document.createTextNode(str));
    var console = document.getElementById("console");
    console.appendChild(li);
}

function imageSize(name) {
    var img = window.frames[name].document.querySelector('img');
    return [img.offsetWidth, img.offsetHeight];
}


function load() {
    var expected = [
      [100, 50], [100, 50], [100, 50], [100, 50], 
      [50, 100], [50, 100], [50, 100], [50, 100], 
      [100, 50],
    ];
    var success = true;
    for(var i = 1; i <= 9; i++) {
        var s = imageSize("img" + i);
        if (s[0] !== expected[i - 1][0] || s[1] !== expected[i - 1][1])
            success = false;
    }
    log(success ? "PASS" : "FAIL");
}

</script>
<style>
iframe { display: inline-block; margin-right: 20px; margin-bottom: 10px; width: 120px; height: 110px; vertical-align: top; border: 1px solid black; }
</style>
</head>
<body onload="load()">
<b>The images should be rotated respecting their EXIF orientation. In image documents, this happens independent of WebKitShouldRespectImageOrientation.</b><br><br>
<iframe name="img1" src="resources/exif-orientation-1-ul.jpg" frameborder=0></iframe>
<iframe name="img2" src="resources/exif-orientation-2-ur.jpg" frameborder=0></iframe>
<iframe name="img3" src="resources/exif-orientation-3-lr.jpg" frameborder=0></iframe>
<iframe name="img4" src="resources/exif-orientation-4-lol.jpg" frameborder=0></iframe>
<br>
<iframe name="img5" src="resources/exif-orientation-5-lu.jpg" frameborder=0></iframe>
<iframe name="img6" src="resources/exif-orientation-6-ru.jpg" frameborder=0></iframe>
<iframe name="img7" src="resources/exif-orientation-7-rl.jpg" frameborder=0></iframe>
<iframe name="img8" src="resources/exif-orientation-8-llo.jpg" frameborder=0></iframe>
<br>
<iframe name="img9" src="resources/exif-orientation-9-u.jpg" frameborder=0></iframe>
<br>
<ul id="console"></ul>
</body>
</html>