4 <title>Insert and delete @viewport rule
</title>
5 <script src=
"../../resources/testharness.js"></script>
6 <script src=
"../../resources/testharnessreport.js"></script>
8 html { width:
100%; height:
100%; }
11 if (window
.testRunner
) {
12 internals
.settings
.setViewportEnabled(true);
15 var t1
= async_test("Check that added @viewport rule is applied.");
16 var t2
= async_test("Check that @viewport rule is not applied after removal.");
20 var origWidth
= document
.documentElement
.offsetWidth
;
21 var origHeight
= document
.documentElement
.offsetHeight
;
23 document
.styleSheets
[0].insertRule("@viewport { width: 400px; height: 400px; }", 0);
26 assert_equals(document
.documentElement
.offsetWidth
, 400, "Width is 400px.");
27 assert_equals(document
.documentElement
.offsetHeight
, 400, "Height is 400px.");
31 document
.styleSheets
[0].deleteRule(0);
34 assert_equals(document
.documentElement
.offsetWidth
, origWidth
, "Width is default width.");
35 assert_equals(document
.documentElement
.offsetHeight
, origHeight
, "Height is default height.");
41 <body style=
"overflow: hidden">