| <script src="../../resources/js-test-pre.js"></script> |
| description('Tests the name of the event parameter for inline event attributes'); |
| function dispatchClick(element) |
| var clickEvent = document.createEvent('MouseEvent'); |
| clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); |
| element.dispatchEvent(clickEvent); |
| var div = document.createElement('div'); |
| // Clear out window.event so that we get the local event and not the global event. |
| div.setAttribute('onclick', 'window.event = undefined; type = typeof event'); |
| shouldBeEqualToString('type', 'object') |
| div.setAttribute('onclick', 'type = typeof evt'); |
| shouldBeEqualToString('type', 'undefined') |
| var SVG_NS = 'http://www.w3.org/2000/svg'; |
| var svg = document.createElementNS(SVG_NS, 'circle'); |
| // Clear out window.event so that we get the local event and not the global event. |
| svg.setAttribute('onclick', 'window.event = undefined; type = typeof event'); |
| shouldBeEqualToString('type', 'undefined') |
| svg.setAttribute('onclick', 'type = typeof evt'); |
| shouldBeEqualToString('type', 'object') |
| <script src="../../resources/js-test-post.js"></script> |