2 <script src="../../resources/js-test.js"></script>
5 description('Tests the name of the event parameter for inline event attributes');
7 function dispatchClick(element)
9 var clickEvent = document.createEvent('MouseEvent');
10 clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
11 element.dispatchEvent(clickEvent);
15 var div = document.createElement('div');
17 // Clear out window.event so that we get the local event and not the global event.
18 div.setAttribute('onclick', 'window.event = undefined; type = typeof event');
20 shouldBeEqualToString('type', 'object')
22 div.setAttribute('onclick', 'type = typeof evt');
24 shouldBeEqualToString('type', 'undefined')
26 var SVG_NS = 'http://www.w3.org/2000/svg';
27 var svg = document.createElementNS(SVG_NS, 'circle');
29 // Clear out window.event so that we get the local event and not the global event.
30 svg.setAttribute('onclick', 'window.event = undefined; type = typeof event');
32 shouldBeEqualToString('type', 'undefined')
34 svg.setAttribute('onclick', 'type = typeof evt');
36 shouldBeEqualToString('type', 'object')