<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>negative width and valid 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=-300,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_valid_height() {
      await SpecialPowers.pushPrefEnv(scaleRatio(1.0));

      let info = getViewportInfo(800, 480);
      is(info.width, 980, "width should be default when specified width is invalid");
      is(info.height, 240, "height should be 240");
    });
  </script>
</body>
</html>
