Bug 1880216 - Migrate Fenix docs into Sphinx. r=owlish,geckoview-reviewers,android...
[gecko.git] / dom / html / test / test_bug1414077.html
blobaa430c2737191e26ef650dad9f9adddbb7d54bb1
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1414077
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 1414077</title>
9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
13 /** Test for Bug 1414077 **/
15 add_task(async function() {
16 await SpecialPowers.pushPrefEnv({"set": [["browser.enable_automatic_image_resizing", true]]});
18 return new Promise(resolve => {
19 var testWin = document.querySelector("iframe");
20 testWin.src = "image.png";
21 testWin.onload = function() {
22 var testDoc = testWin.contentDocument;
24 // testDoc should be a image document.
25 ok(testDoc.imageIsOverflowing, "image is overflowing");
26 ok(testDoc.imageIsResized, "image is resized to fit visible area by default");
28 // Restore image to original size.
29 testDoc.restoreImage();
30 ok(testDoc.imageIsOverflowing, "image is overflowing");
31 ok(!testDoc.imageIsResized, "image is restored to original size");
33 // Resize the image to fit visible area
34 testDoc.shrinkToFit();
35 ok(testDoc.imageIsOverflowing, "image is overflowing");
36 ok(testDoc.imageIsResized, "image is resized to fit visible area");
38 resolve();
41 });
43 </script>
44 </head>
46 <body>
47 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414077">Mozilla Bug 1414077</a>
48 <iframe width="0" height="0"></iframe>
49 </body>
50 </html>