[V8] Use implicit references instead of object groups to keep registered MutationObse...
[WebKit-https.git] / ManualTests / DOMContextMenuEvent.html
1 <html>\r
2 <script type="text/javascript">\r
3 \r
4 function context_event(event)\r
5 {\r
6   if (window.event)\r
7   {\r
8     event = window.event;\r
9   }\r
10   var swallow = document.getElementById("swallow_context").checked;\r
11 \r
12   var str =\r
13          "EVENT PROPERTIES<br>"                       +\r
14          "cancelable      = "+event.cancelable+"<br>" +\r
15          "ctrlKey         = "+event.ctrlKey+"<br>"    +\r
16          "metaKey         = "+event.metaKey+"<br>"    +\r
17          "shiftKey        = "+event.shiftKey+"<br>"   +\r
18          "<br>"                                       +\r
19          "TEST PROPERTIES<br>"                        +\r
20          "prevent default = "+swallow+"<br>"          +\r
21          "event time      = "+new Date()+"<br>"       +\r
22          "";\r
23   document.getElementById("event_info").innerHTML=str;\r
24 \r
25   if (swallow)\r
26   {\r
27     if ((typeof event.cancelBubble) != "undefined")\r
28       event.cancelBubble=true;\r
29 \r
30     if ((typeof event.preventDefault) != "undefined")\r
31       event.preventDefault();\r
32 \r
33     if ((typeof event.returnValue) != "undefined")\r
34       event.returnValue = false;\r
35 \r
36     if ((typeof event.stopPropagation) != "undefined")\r
37       event.stopPropagation();\r
38 \r
39     return false;\r
40   }\r
41 \r
42   return true;\r
43 }\r
44 \r
45 </script>\r
46 \r
47 <body oncontextmenu="return context_event(event)">\r
48 <div>To activate context menu, right-click or ctrl-click anywhere on the page.</div>\r
49 <div>&nbsp;</div>\r
50 <div><input type="checkbox" value="1" name="swallow_context" id="swallow_context"> Prevent default context menu</div>\r
51 <div>&nbsp;</div>\r
52 <tt id="event_info" style='background-color:#eeeeee'>\r
53  -- No event captured --\r
54 </tt>\r
55 </body>\r
56 </html>