Index: webkit/data/layout_tests/chrome/fast/events/contextmenu-event-ordering.html |
=================================================================== |
--- webkit/data/layout_tests/chrome/fast/events/contextmenu-event-ordering.html (revision 12362) |
+++ webkit/data/layout_tests/chrome/fast/events/contextmenu-event-ordering.html (working copy) |
@@ -1,71 +0,0 @@ |
-<html> |
- <head> |
- <title>Context menu event ordering</title> |
- <style> |
- #clickTarget { |
- width: 100%; |
- height: 50px; |
- background: red; |
- text-align: center; |
- } |
- </style> |
- <script> |
- |
- function startTest() { |
- var target = document.getElementById("clickTarget"); |
- |
- traceMouseEvent(target, "click"); |
- traceMouseEvent(target, "mousedown"); |
- traceMouseEvent(target, "mouseup"); |
- traceMouseEvent(target, "contextmenu"); |
- |
- if (window.layoutTestController) { |
- window.layoutTestController.dumpAsText(); |
- |
- // Right click inside clickTarget |
- window.eventSender.mouseMoveTo(20,20); |
- window.eventSender.mouseDown(2 /*right button*/); |
- window.eventSender.mouseUp(2 /*right button*/); |
- } |
- } |
- |
- function traceMouseEvent(target, eventName) { |
- |
- var callback = function(e) { |
- log ("Dispatched event " + e.type + " (button=" + e.button + ")"); |
- |
- if (eventName == "contextmenu") { |
- // Prevent the context menu from being displayed. |
- e.returnValue = false; |
- if (e.stopPropagation) { |
- e.stopPropagation(); |
- } |
- } |
- }; |
- |
- if (target.addEventListener) { |
- target.addEventListener(eventName, callback, false); |
- } else if (target.attachEvent) /*Internet Explorer*/ { |
- target.attachEvent("on" + eventName, callback); |
- } else { |
- log ("!!! Failed registering " + eventName); |
- } |
- } |
- |
- function log(msg) { |
- var log = document.getElementById("log"); |
- log.appendChild(document.createTextNode(msg)); |
- log.appendChild(document.createElement("br")); |
- } |
- </script> |
- </head> |
- |
- <body onload="startTest()"> |
- <div id=clickTarget> |
- [Click target] |
- </div> |
- |
- <p>Right click in the red box: the event sequence should match (mousedown, mouseup, contextmenu)</p> |
- <pre id=log></pre> |
- </body> |
-</html> |