content/base/test/test_meta_viewport5.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <meta charset="utf-8">
michael@0 5 <title>meta viewport test</title>
michael@0 6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 8 <meta name="viewport" content="user-scalable=NO">
michael@0 9 <script src="viewport_helpers.js"></script>
michael@0 10 </head>
michael@0 11 <body>
michael@0 12 <p>user-scalable=NO</p>
michael@0 13 <script type="application/javascript;version=1.7">
michael@0 14 "use strict";
michael@0 15
michael@0 16 SimpleTest.waitForExplicitFinish();
michael@0 17
michael@0 18 let tests = [];
michael@0 19
michael@0 20 tests.push(function test1() {
michael@0 21 let info = getViewportInfo(800, 480);
michael@0 22 is(info.allowZoom, true, "user-scalable values are case-sensitive; 'NO' is not valid");
michael@0 23
michael@0 24 nextTest();
michael@0 25 });
michael@0 26
michael@0 27 function getViewportInfo(aDisplayWidth, aDisplayHeight) {
michael@0 28 let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {},
michael@0 29 width = {}, height = {}, autoSize = {};
michael@0 30
michael@0 31 let cwu = SpecialPowers.getDOMWindowUtils(window);
michael@0 32 cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom,
michael@0 33 minZoom, maxZoom, width, height, autoSize);
michael@0 34 return {
michael@0 35 defaultZoom: defaultZoom.value,
michael@0 36 minZoom: minZoom.value,
michael@0 37 maxZoom: maxZoom.value,
michael@0 38 width: width.value,
michael@0 39 height: height.value,
michael@0 40 autoSize: autoSize.value,
michael@0 41 allowZoom: allowZoom.value
michael@0 42 };
michael@0 43 }
michael@0 44
michael@0 45 function nextTest() {
michael@0 46 if (tests.length)
michael@0 47 (tests.shift())();
michael@0 48 else
michael@0 49 SimpleTest.finish();
michael@0 50 }
michael@0 51 addEventListener("load", nextTest);
michael@0 52 </script>
michael@0 53 </body>
michael@0 54 </html>

mercurial