8 testRunner
.dumpAsText();
9 var d1
= document
.getElementById('d1');
10 var d2
= document
.getElementById('d2');
12 var style
= window
.getComputedStyle(d1
, null);
13 var computedWidth
= style
.getPropertyValue("width");
14 var computedHeight
= style
.getPropertyValue("height");
18 if (computedWidth
== size
&& computedHeight
== size
)
19 d1
.innerHTML
= "Test 1 Passed";
21 d1
.innerHTML
= "Test 1 Failed. Computed width = " + computedWidth
+ "<br> Computed height = " + computedHeight
;
23 style
= window
.getComputedStyle(d2
, null);
24 computedWidth
= style
.getPropertyValue("width");
25 computedHeight
= style
.getPropertyValue("height");
26 if (computedWidth
== size
&& computedHeight
== size
)
27 d2
.innerHTML
= "Test 2 Passed";
29 d2
.innerHTML
= "Test 2 Failed. Computed width = " + computedWidth
+ "<br> Computed height = " + computedHeight
;
36 border:
5px solid black;
40 -moz-box-sizing: border-box;
41 -webkit-box-sizing: border-box;
45 <body onload=
"test()">
46 This tests that getComputedStyle will take box-sizing into account when computing the width and height of a box.
<br>