4 <script type=
"text/javascript">
5 var completed
= 0, failures
= 0, failuresDetail
= "";
6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
10 function printResult() {
11 document
.getElementById("result").innerText
= failures
? "FAIL: " + failures
+ " cases failed\n" + failuresDetail
: "PASS";
12 if (window
.testRunner
)
13 testRunner
.notifyDone();
15 function imageCheckForMax(image
) {
16 if (image
.src
.match("greenbox.png") != null)
17 image
.src
= "resources/greenbox-100px.png";
20 if (image
.width
!= 100) {
22 failuresDetail
+= image
.id
+ ": " + image
.width
+ " (expected: " + 100 + ")\n";
32 <div id=
"result"></div>
37 <img id=
"percentWidthInTable" style=
"width:100%;" src=
"resources/greenbox.png" onload=
"imageCheckForMax(this)">
46 <img id=
"percentMaxWidthInTable" style=
"max-width:100%;" src=
"resources/greenbox.png" onload=
"imageCheckForMax(this)">
51 <div style=
"position:absolute;top:110px;left:110px">
52 <img id=
"percentWidthInAbsolute" style=
"width:100%;" src=
"resources/greenbox.png" onload=
"imageCheckForMax(this)">
54 <div style=
"position:absolute;top:220px;left:110px">
55 <img id=
"percentMaxWidthInAbsolute" style=
"max-width:100%;" src=
"resources/greenbox.png" onload=
"imageCheckForMax(this)">