| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 var clicks = 0; | 2 var clicks = 0; |
| 3 var console = document.getElementById('console'); | 3 var console = document.getElementById('console'); |
| 4 var x, y; | 4 var x, y; |
| 5 | 5 |
| 6 function log(message) { | 6 function log(message) { |
| 7 var console = document.getElementById('console'); | 7 var console = document.getElementById('console'); |
| 8 var text = document.createTextNode(message); | 8 var text = document.createTextNode(message); |
| 9 console.appendChild(text); | 9 console.appendChild(text); |
| 10 console.appendChild(document.createElement("br")); | 10 console.appendChild(document.createElement("br")); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 eventSender.mouseMoveTo(x, y); | 54 eventSender.mouseMoveTo(x, y); |
| 55 eventSender.mouseDown(); | 55 eventSender.mouseDown(); |
| 56 eventSender.mouseUp(); | 56 eventSender.mouseUp(); |
| 57 | 57 |
| 58 li.style.listStylePosition = "outside"; | 58 li.style.listStylePosition = "outside"; |
| 59 // WebCore renders an outside list marker at offsetLeft minus an offset, whi
ch is equal on a | 59 // WebCore renders an outside list marker at offsetLeft minus an offset, whi
ch is equal on a |
| 60 // magic number, 7, plus the ascent of the font * 2/3. Since we can't get t
he ascent from JS, just make sure that | 60 // magic number, 7, plus the ascent of the font * 2/3. Since we can't get t
he ascent from JS, just make sure that |
| 61 // the list marker is hit at some point between the left edge of the list it
em and the left edge of the list. | 61 // the list marker is hit at some point between the left edge of the list it
em and the left edge of the list. |
| 62 | 62 |
| 63 li.onclick = clickCounter; | 63 li.onclick = clickCounter; |
| 64 ul.onclick = 0; | 64 ul.onclick = null; |
| 65 | 65 |
| 66 for (x = ul.offsetLeft; x < li.offsetLeft; x += 5) { | 66 for (x = ul.offsetLeft; x < li.offsetLeft; x += 5) { |
| 67 eventSender.mouseMoveTo(x, y); | 67 eventSender.mouseMoveTo(x, y); |
| 68 eventSender.mouseDown(); | 68 eventSender.mouseDown(); |
| 69 eventSender.mouseUp(); | 69 eventSender.mouseUp(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (clicks == 0) | 72 if (clicks == 0) |
| 73 log("Failure, the list marker wasn't hit during any of the mouse clicks
between the left edge of the list item and the left edge of the list."); | 73 log("Failure, the list marker wasn't hit during any of the mouse clicks
between the left edge of the list item and the left edge of the list."); |
| 74 } | 74 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 96 <ul id="ul" onclick="clickHandler('ul');"> | 96 <ul id="ul" onclick="clickHandler('ul');"> |
| 97 <li id="li" onclick="clickHandler('li');"><span id="span" onclick="clickHandler(
'span')">text</span></li> | 97 <li id="li" onclick="clickHandler('li');"><span id="span" onclick="clickHandler(
'span')">text</span></li> |
| 98 </ul> | 98 </ul> |
| 99 | 99 |
| 100 <p>This is a testcase for hit testing over list markers. It uses the eventSende
r to do mouse clicks and programmatically adjusts the left margin of the span in
side the list item and the list-style-position: of the list item.</p> | 100 <p>This is a testcase for hit testing over list markers. It uses the eventSende
r to do mouse clicks and programmatically adjusts the left margin of the span in
side the list item and the list-style-position: of the list item.</p> |
| 101 | 101 |
| 102 <p id="console"></p> | 102 <p id="console"></p> |
| 103 | 103 |
| 104 <script> | 104 <script> |
| 105 runTest(); | 105 runTest(); |
| 106 </script> | 106 </script> |
| OLD | NEW |