6 var element
= document
.createElement("p");
7 element
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("results").appendChild(element
);
12 if (window
.testRunner
)
13 testRunner
.dumpAsText();
14 if (document
.scrollingElement
.scrollTop
== 0)
15 log("PASS: Document is starting scrolled to top.");
17 log("FAIL: Document is starting scrolled to " + document
.scrollingElement
.scrollTop
+ ".");
18 document
.getElementById("area").focus();
19 if (document
.scrollingElement
.scrollTop
> 4000 && document
.scrollingElement
.scrollTop
< 6000)
20 log("PASS: Focusing area element caused the image to scroll into view.");
22 log("FAIL: Document is scrolled to " + document
.scrollingElement
.scrollTop
+ " after focusing area element.");
23 document
.scrollingElement
.scrollTop
= 0;
24 if (document
.scrollingElement
.scrollTop
== 0)
25 log("PASS: Document is scrolled to top once again.");
27 log("FAIL: Document should be scrolled to top but is scrolled to " + document
.scrollingElement
.scrollTop
+ ".");
28 document
.getElementById("area").blur();
29 if (document
.scrollingElement
.scrollTop
== 0)
30 log("PASS: Document is still scrolled to top after removing focus from area element.");
32 log("FAIL: Document is scrolled to " + document
.scrollingElement
.scrollTop
+ " after removing focus from area element.");
33 document
.scrollingElement
.scrollTop
= 0;
34 document
.body
.removeChild(document
.getElementById("test"));
39 <body onload=
"runTest()">
41 <p>This tests to be sure that focusing an area element triggers scrolling and removing focus from it does not.
</p>
44 <div style=
"height:5000px"></div>
46 <area id=
"area" shape=
"rect" coords=
"0,0,128,128" href=
"#dummy">
48 <img src=
"resources/mu.png" width=
"128" height=
"128" usemap=
"#imagemap" ismap
>
49 <div style=
"height:5000px"></div>