gecko-dev/dom/html/test/test_bug1414077.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 строка
1.5 KiB
HTML
Исходник Обычный вид История

<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1414077
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1414077</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1414077 **/
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set":[["browser.enable_automatic_image_resizing", true]]}, function() {
var testWin = document.querySelector("iframe");
testWin.height = 0;
testWin.width = 0;
testWin.src = "image.png";
testWin.onload = function() {
var testDoc = testWin.contentDocument;
// testDoc should be a image document.
ok(testDoc.imageIsOverflowing, "image is overflowing");
ok(testDoc.imageIsResized, "image is resized to fit visible area by default");
// Restore image to original size.
testDoc.restoreImage();
ok(testDoc.imageIsOverflowing, "image is overflowing");
ok(!testDoc.imageIsResized, "image is restored to original size");
// Resize the image to fit visible area
testDoc.shrinkToFit();
ok(testDoc.imageIsOverflowing, "image is overflowing");
ok(testDoc.imageIsResized, "image is resized to fit visible area");
SimpleTest.finish();
};
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414077">Mozilla Bug 1414077</a>
<iframe></iframe>
</body>
</html>