summaryrefslogtreecommitdiffstats
path: root/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0_5.html
blob: 7f17ef146ed71d00a52fb484470277942b72b3e7 (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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>maximum-scale=0.5 in meta viewport</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <meta name="viewport" content="maximum-scale=0.5">
  <script src="viewport_helpers.js"></script>
</head>
<body>
  <p>maximum-scale=0.5</p>
  <script type="application/javascript">
    "use strict";

    add_task(async function maximum_scale_0_5() {
      await SpecialPowers.pushPrefEnv(scaleRatio(1.0));

      let info = getViewportInfo(800, 480);
      // In the case where the maximum-scale is less than 1 and there is no
      // initial-scale or initial-scale is NOT greater than the maximum-scale,
      // 'min-width' will be bigger than the display width.
      is(info.width, 1600, "width should be scaled by 1 / maximum-scale");
      is(info.height, 960, "height should be scaled by 1 / maximum-scale");
      is(info.maxZoom, 0.5, "maximum-scale should be 0.5");
    });
  </script>
</body>
</html>