1 <html xmlns='http://www.w3.org/
1999/xhtml'
>
7 border:
1px solid black;
12 <svg id=
"background" xmlns=
"http://www.w3.org/2000/svg" width=
"100" height=
"100">
13 <path id=
"circle" d='M50,
50 z' stroke='green' stroke-width='
100' stroke-linecap='round'
/>
16 if (window
.testRunner
) {
17 window
.testRunner
.dumpAsText();
20 var resultString
= "";
22 var hitElementExpected1
= document
.elementFromPoint(5, 50);
23 var hitSuccess1
= hitElementExpected1
&& hitElementExpected1
== document
.getElementById("circle");
24 resultString
+= hitSuccess1
? "PASSED; " : "FAIL, hit " + hitElementExpected1
+ " @ 5, 50; ";
26 var hitElementExpected2
= document
.elementFromPoint(95, 50);
27 var hitSuccess2
= hitElementExpected2
&& hitElementExpected2
== document
.getElementById("circle");
28 resultString
+= hitSuccess2
? "PASSED; " : "FAIL, hit " + hitElementExpected2
+ " @ 95, 50; ";
30 var hitElementExpected3
= document
.elementFromPoint(50, 5);
31 var hitSuccess3
= hitElementExpected3
&& hitElementExpected3
== document
.getElementById("circle");
32 resultString
+= hitSuccess3
? "PASSED; " : "FAIL, hit " + hitElementExpected3
+ " @ 50, 5; ";
34 var hitElementExpected4
= document
.elementFromPoint(50, 95);
35 var hitSuccess4
= hitElementExpected4
&& hitElementExpected4
== document
.getElementById("circle");
36 resultString
+= hitSuccess4
? "PASSED; " : "FAIL, hit " + hitElementExpected4
+ " @ 50, 95; ";
38 hitElementExpected1
= document
.elementFromPoint(5, 5);
39 hitSuccess1
= hitElementExpected1
&& hitElementExpected1
== document
.getElementById("background");
40 resultString
+= hitSuccess1
? "PASSED; " : "FAIL, hit " + hitElementExpected1
+ " @ 5, 5; ";
42 hitElementExpected2
= document
.elementFromPoint(95, 5);
43 hitSuccess2
= hitElementExpected2
&& hitElementExpected2
== document
.getElementById("background");
44 resultString
+= hitSuccess2
? "PASSED; " : "FAIL, hit " + hitElementExpected2
+ " @ 95, 5; ";
46 hitElementExpected3
= document
.elementFromPoint(5, 95);
47 hitSuccess3
= hitElementExpected3
&& hitElementExpected3
== document
.getElementById("background");
48 resultString
+= hitSuccess3
? "PASSED; " : "FAIL, hit " + hitElementExpected3
+ " @ 5, 95; ";
50 hitElementExpected4
= document
.elementFromPoint(95, 95);
51 hitSuccess4
= hitElementExpected4
&& hitElementExpected4
== document
.getElementById("background");
52 resultString
+= hitSuccess4
? "PASSED; " : "FAIL, hit " + hitElementExpected4
+ " @ 95, 95; ";
54 document
.body
.innerHTML
= resultString
;