4 function print(message
, color
)
6 var paragraph
= document
.createElement("div");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 paragraph
.style
.fontFamily
= "monospace";
10 paragraph
.style
.color
= color
;
11 document
.getElementById("console").appendChild(paragraph
);
16 if (window
.testRunner
) {
17 testRunner
.dumpAsText();
18 testRunner
.waitUntilDone();
20 var img1
= document
.getElementById('img1');
21 img1
.onerror = function (error
) {
22 print("PASS: caught image load error: " + error
, "green");
23 if (window
.testRunner
) {
24 testRunner
.notifyDone();
27 img1
.src
= "invalidinvalid.jpg";
31 <body onload=
"test();">
32 <p>This page tests setting onerror handlers through the DOM. If it passes, you will
33 see
"PASS" message below.
</p>
35 <div id='console'
></div>
36 <img style=
"display:none" id=
"img1">