OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 function print(message, color) { | 4 function print(message, color) { |
5 var paragraph = document.createElement("div"); | 5 var paragraph = document.createElement("div"); |
6 paragraph.appendChild(document.createTextNode(message)); | 6 paragraph.appendChild(document.createTextNode(message)); |
7 paragraph.style.fontFamily = "monospace"; | 7 paragraph.style.fontFamily = "monospace"; |
8 if (color) | 8 if (color) |
9 paragraph.style.color = color; | 9 paragraph.style.color = color; |
10 document.getElementById("console").appendChild(paragraph); | 10 document.getElementById("console").appendChild(paragraph); |
11 } | 11 } |
12 function shouldBe(description, actual, expected) | 12 function shouldBe(description, actual, expected) |
13 { | 13 { |
14 if (expected === actual) { | 14 if (expected === actual) { |
15 print("PASS: " + description + " should be " + expected + | 15 print("PASS: " + description + " should be " + expected + |
16 " and is\n", | 16 " and is\n", |
17 "green"); | 17 "green"); |
18 } else { | 18 } else { |
19 print("FAIL: " + description + " should be " + expected + | 19 print("FAIL: " + description + " should be " + expected + |
20 " but instead is " + actual + "\n", | 20 " but instead is " + actual + "\n", |
21 "red"); | 21 "red"); |
22 } | 22 } |
23 } | 23 } |
24 function mouseeventverify(event, x, y, target, type) | 24 function mouseeventverify(event, x, y, offsetX, offsetY, target, type) |
25 { | 25 { |
26 shouldBe("event type", event.type, type); | 26 shouldBe("event type", event.type, type); |
27 shouldBe("event target", event.target, target); | 27 shouldBe("event target", event.target, target); |
28 shouldBe("event.pageX", event.pageX, x); | |
29 shouldBe("event.pageY", event.pageY, y); | |
30 shouldBe("event.offsetX", event.offsetX, x); | |
31 shouldBe("event.offsetY", event.offsetY, y); | |
32 shouldBe("event.x", event.x, x); | |
33 shouldBe("event.y", event.y, y); | |
34 } | |
35 function mouseeventverify2(event, x, y, offsetX, offsetY, target, type) | |
36 { | |
37 shouldBe("event type", event.type, type); | |
38 shouldBe("event target", event.target, target); | |
39 shouldBe("event.pageX", event.pageX, x); | 28 shouldBe("event.pageX", event.pageX, x); |
40 shouldBe("event.pageY", event.pageY, y); | 29 shouldBe("event.pageY", event.pageY, y); |
41 shouldBe("event.offsetX", event.offsetX, offsetX); | 30 shouldBe("event.offsetX", event.offsetX, offsetX); |
42 shouldBe("event.offsetY", event.offsetY, offsetY); | 31 shouldBe("event.offsetY", event.offsetY, offsetY); |
43 shouldBe("event.x", event.x, x); | 32 shouldBe("event.x", event.x, x); |
44 shouldBe("event.y", event.y, y); | 33 shouldBe("event.y", event.y, y); |
45 } | 34 } |
46 function test() { | 35 function test() { |
47 if (window.testRunner) { | 36 if (window.testRunner) { |
48 testRunner.dumpAsText(); | 37 testRunner.dumpAsText(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (window.testRunner) | 75 if (window.testRunner) |
87 testRunner.notifyDone(); | 76 testRunner.notifyDone(); |
88 } | 77 } |
89 </script> | 78 </script> |
90 </head> | 79 </head> |
91 <body onload="test();"> | 80 <body onload="test();"> |
92 <p>This page tests whether a click event on a list box item propogates with the
correct target and positioning values.<br> | 81 <p>This page tests whether a click event on a list box item propogates with the
correct target and positioning values.<br> |
93 Bug 3248: Mouse events on OPTION element seem to be ignored<br> | 82 Bug 3248: Mouse events on OPTION element seem to be ignored<br> |
94 <a href="https://bugs.webkit.org/show_bug.cgi?id=3248">https://bugs.webkit.org/s
how_bug.cgi?id=3248</a></p> | 83 <a href="https://bugs.webkit.org/show_bug.cgi?id=3248">https://bugs.webkit.org/s
how_bug.cgi?id=3248</a></p> |
95 <form action="" method="post"> | 84 <form action="" method="post"> |
96 <select style="position:absolute; top: 84;" size="2" onmousedown="mouseeventveri
fy(event, 22, 104, document.getElementById('o1'), 'mousedown')"> | 85 <select style="position:absolute; top: 84;" size="2" onmousedown="mouseeventveri
fy(event, 22, 104, 13, 5, document.getElementById('o1'), 'mousedown')"> |
97 <option>One | 86 <option>One |
98 <option id="o1" onmousedown="mouseeventverify(event, 22, 104, this, 'mousedown')
">Two | 87 <option id="o1" onmousedown="mouseeventverify(event, 22, 104, 13, 5, this, 'mous
edown')">Two |
99 </select> | 88 </select> |
100 </form> | 89 </form> |
101 <form action="" method="post"> | 90 <form action="" method="post"> |
102 <select style="position:absolute; top: 164;" size="2" onmouseup="mouseeventverif
y(event, 22, 184, document.getElementById('o2'), 'mouseup')"> | 91 <select style="position:absolute; top: 164;" size="2" onmouseup="mouseeventverif
y(event, 22, 184, 13, 5, document.getElementById('o2'), 'mouseup')"> |
103 <option>One | 92 <option>One |
104 <option id="o2" onmouseup="mouseeventverify(event, 22, 184, this, 'mouseup')">Tw
o | 93 <option id="o2" onmouseup="mouseeventverify(event, 22, 184, 13, 5, this, 'mouseu
p')">Two |
105 </select> | 94 </select> |
106 </form> | 95 </form> |
107 <form action="" method="post"> | 96 <form action="" method="post"> |
108 <select style="position:absolute; top: 242;" size="2" onclick="mouseeventverify(
event, 22, 262, document.getElementById('o3'), 'click')"> | 97 <select style="position:absolute; top: 242;" size="2" onclick="mouseeventverify(
event, 22, 262, 13, 5, document.getElementById('o3'), 'click')"> |
109 <option>One | 98 <option>One |
110 <option id="o3" onclick="mouseeventverify(event, 22, 262, this, 'click')">Two | 99 <option id="o3" onclick="mouseeventverify(event, 22, 262, 13, 5, this, 'click')"
>Two |
111 </select> | 100 </select> |
112 </form> | 101 </form> |
113 <form action="" method="post"> | 102 <form action="" method="post"> |
114 <select style="position:absolute; top: 324;" size="2" ondblclick="mouseeventveri
fy(event, 22, 344, document.getElementById('o4'), 'dblclick')"> | 103 <select style="position:absolute; top: 324;" size="2" ondblclick="mouseeventveri
fy(event, 22, 344, 13, 5, document.getElementById('o4'), 'dblclick')"> |
115 <option>One | 104 <option>One |
116 <option id="o4" ondblclick="mouseeventverify(event, 22, 344, this, 'dblclick')">
Two | 105 <option id="o4" ondblclick="mouseeventverify(event, 22, 344, 13, 5, this, 'dblcl
ick')">Two |
117 </select> | 106 </select> |
118 </form> | 107 </form> |
119 <select style="position:absolute; top: 408;" size="3" onmousedown="mouseeventver
ify2(event, 22, 448, 12, 38, this, 'mousedown')"> | 108 <select style="position:absolute; top: 408;" size="3" onmousedown="mouseeventver
ify(event, 22, 448, 12, 38, this, 'mousedown')"> |
120 <option>One | 109 <option>One |
121 <option id="o5" onmousedown="mouseeventverify2(event, 22, 448, 12, 38, this, 'mo
usedown')">Two | 110 <option id="o5" onmousedown="mouseeventverify(event, 22, 448, 12, 38, this, 'mou
sedown')">Two |
122 </select> | 111 </select> |
123 </form> | 112 </form> |
124 <div style="position:absolute; top: 550;" id='console'></div> | 113 <div style="position:absolute; top: 550;" id='console'></div> |
125 </body> | 114 </body> |
126 </html> | 115 </html> |
OLD | NEW |