summaryrefslogtreecommitdiffstats
path: root/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_negative_height.html
blob: e458cbc8dd7fb9b4d8e118274b1049a7d4029b2e (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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>negative width and height 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="width=-400, height=-240">
  <script src="viewport_helpers.js"></script>
</head>
<body>
  <p>width=-400, height=-240</p>
  <script type="application/javascript">
    "use strict";

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

      let info = getViewportInfo(800, 480);
      // negative width and height should be ignored, then display width and
      // height are used for viewport.
      is(info.width, 800, "width should be the display width");
      is(info.height, 480, "height should be the display height");
    });
  </script>
</body>
</html>