| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function documentClickHandler(event) { console.log("click - document - attribute
"); } | 6 function documentClickHandler(event) { console.log("click - document - attribute
"); } |
| 7 | 7 |
| 8 function setupEventListeners() | 8 function setupEventListeners() |
| 9 { | 9 { |
| 10 function f() {} | 10 function f() {} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 document.body.addEventListener("custom event", f, true); | 23 document.body.addEventListener("custom event", f, true); |
| 24 | 24 |
| 25 function ObjectHandler() { document.addEventListener("click", this, true); } | 25 function ObjectHandler() { document.addEventListener("click", this, true); } |
| 26 ObjectHandler.prototype.toString = function() { return "ObjectHandler"; } | 26 ObjectHandler.prototype.toString = function() { return "ObjectHandler"; } |
| 27 new ObjectHandler(); | 27 new ObjectHandler(); |
| 28 | 28 |
| 29 function EventListenerImpl() { document.addEventListener("click", this, true
); } | 29 function EventListenerImpl() { document.addEventListener("click", this, true
); } |
| 30 EventListenerImpl.prototype.toString = function() { return "EventListenerImp
l"; } | 30 EventListenerImpl.prototype.toString = function() { return "EventListenerImp
l"; } |
| 31 EventListenerImpl.prototype.handleEvent = function() { console.log("click -
document - handleEvent"); } | 31 EventListenerImpl.prototype.handleEvent = function() { console.log("click -
document - handleEvent"); } |
| 32 new EventListenerImpl(); | 32 new EventListenerImpl(); |
| 33 |
| 34 window.addEventListener("scroll", function(event) { console.log("scroll - wi
ndow"); }, false); |
| 33 } | 35 } |
| 34 | 36 |
| 35 function test() | 37 function test() |
| 36 { | 38 { |
| 37 var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; | 39 var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; |
| 38 | 40 |
| 39 WebInspector.settingForTest("eventListenersFilter").set("all"); | 41 WebInspector.settingForTest("eventListenersFilter").set("all"); |
| 40 InspectorTest.selectNodeWithId("node", step1); | 42 InspectorTest.selectNodeWithId("node", step1); |
| 41 | 43 |
| 42 function step1() | 44 function step1() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 64 } | 66 } |
| 65 } | 67 } |
| 66 | 68 |
| 67 function onloadHandler() | 69 function onloadHandler() |
| 68 { | 70 { |
| 69 setupEventListeners(); | 71 setupEventListeners(); |
| 70 runTest(); | 72 runTest(); |
| 71 } | 73 } |
| 72 </script> | 74 </script> |
| 73 </head> | 75 </head> |
| 74 | |
| 75 <body onload="onloadHandler()"> | 76 <body onload="onloadHandler()"> |
| 76 <p> | 77 <p> |
| 77 Tests event listeners output in the Elements sidebar panel. | 78 Tests event listeners output in the Elements sidebar panel. |
| 78 </p> | 79 </p> |
| 79 | 80 |
| 80 <button id="node">Inspect Me</button> | 81 <button id="node">Inspect Me</button> |
| 81 | 82 |
| 82 <div id="node-without-listeners"></div> | 83 <div id="node-without-listeners"></div> |
| 83 | 84 |
| 84 </body> | 85 </body> |
| 85 </html> | 86 </html> |
| OLD | NEW |