| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 To test manually, click on all the form elements (except the textbox) and the de
tails/summary | 2 To test manually, click on all the form elements (except the textbox) and the de
tails/summary |
| 3 element. The anchor shouldn't be activated (i.e. you shouldn't see any "anchor a
ctivated" messages). | 3 element. The anchor shouldn't be activated (i.e. you shouldn't see any "anchor a
ctivated" messages). |
| 4 <a href="javascript:anchorActivated()"> | 4 <a href="javascript:anchorActivated()"> |
| 5 <form action="javascript:formSubmitted()"> | 5 <form action="javascript:formSubmitted()"> |
| 6 <input type=text> | 6 <input type=text> |
| 7 <input type=submit> | 7 <input type=submit> |
| 8 <input src="resources/abe.png" type=image> | 8 <input src="resources/abe.png" type=image> |
| 9 <button>button</button> | 9 <button>button</button> |
| 10 <input type=reset> | 10 <input type=reset> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 element.addEventListener("click", function () { | 37 element.addEventListener("click", function () { |
| 38 log("Activated " + this + " type=" + this.type); | 38 log("Activated " + this + " type=" + this.type); |
| 39 }, false); | 39 }, false); |
| 40 | 40 |
| 41 if (!window.eventSender) | 41 if (!window.eventSender) |
| 42 continue; | 42 continue; |
| 43 | 43 |
| 44 if (element.type == "text") { | 44 if (element.type == "text") { |
| 45 log("Focusing " + element + " type=" + element.type + " and pressing
enter"); | 45 log("Focusing " + element + " type=" + element.type + " and pressing
enter"); |
| 46 element.focus(); | 46 element.focus(); |
| 47 eventSender.keyDown("\n"); | 47 eventSender.keyDown("Enter"); |
| 48 continue; | 48 continue; |
| 49 } | 49 } |
| 50 | 50 |
| 51 eventSender.mouseMoveTo(element.offsetLeft + element.clientWidth / 2, el
ement.offsetTop + element.clientHeight / 2); | 51 eventSender.mouseMoveTo(element.offsetLeft + element.clientWidth / 2, el
ement.offsetTop + element.clientHeight / 2); |
| 52 eventSender.mouseDown(); | 52 eventSender.mouseDown(); |
| 53 eventSender.mouseUp(); | 53 eventSender.mouseUp(); |
| 54 | 54 |
| 55 if (element.type == "radio" || element.type == "checkbox") | 55 if (element.type == "radio" || element.type == "checkbox") |
| 56 continue; | 56 continue; |
| 57 | 57 |
| 58 log("Focusing " + element + " type=" + element.type + " and pressing ent
er"); | 58 log("Focusing " + element + " type=" + element.type + " and pressing ent
er"); |
| 59 element.focus(); | 59 element.focus(); |
| 60 eventSender.keyDown("\n"); | 60 eventSender.keyDown("Enter"); |
| 61 } | 61 } |
| 62 | 62 |
| 63 if (window.eventSender) { | 63 if (window.eventSender) { |
| 64 var details = document.querySelector("details"); | 64 var details = document.querySelector("details"); |
| 65 eventSender.mouseMoveTo(details.offsetLeft + details.clientWidth / 2, de
tails.offsetTop + details.clientHeight / 2); | 65 eventSender.mouseMoveTo(details.offsetLeft + details.clientWidth / 2, de
tails.offsetTop + details.clientHeight / 2); |
| 66 eventSender.mouseDown(); | 66 eventSender.mouseDown(); |
| 67 eventSender.mouseUp(); | 67 eventSender.mouseUp(); |
| 68 log("\nThe details element was " + (details.open ? "" : "not ") + "opene
d"); | 68 log("\nThe details element was " + (details.open ? "" : "not ") + "opene
d"); |
| 69 } | 69 } |
| 70 | 70 |
| 71 if (window.testRunner) | 71 if (window.testRunner) |
| 72 document.querySelector("a").style.display = "none"; | 72 document.querySelector("a").style.display = "none"; |
| 73 }); | 73 }); |
| 74 </script> | 74 </script> |
| OLD | NEW |