Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / inline-event-attributes-event-param-name.html
blob5693225035214c155c420e6949128c19bdfbaa1f
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <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);
14 var type;
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');
19 dispatchClick(div);
20 shouldBeEqualToString('type', 'object')
22 div.setAttribute('onclick', 'type = typeof evt');
23 dispatchClick(div);
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');
31 dispatchClick(svg);
32 shouldBeEqualToString('type', 'undefined')
34 svg.setAttribute('onclick', 'type = typeof evt');
35 dispatchClick(svg);
36 shouldBeEqualToString('type', 'object')
38 </script>