Changeset 89317 in webkit
- Timestamp:
- Jun 20, 2011 5:01:18 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89316 r89317 1 2011-06-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: CRASH if Expanding Event Listener on document 6 https://bugs.webkit.org/show_bug.cgi?id=61834 7 8 Add a test to list the event listeners in the sidebar. 9 This test includes event listeners on the document, and 10 it expands each of the sections which would have caused 11 the CRASH fixed by this patch. 12 13 * http/tests/inspector/elements-test.js: 14 (initialize_ElementTest.InspectorTest.expandAndDumpSelectedElementEventListeners): 15 (initialize_ElementTest.InspectorTest.expandSelectedElementEventListeners): 16 (initialize_ElementTest.InspectorTest.expandSelectedElementEventListenersSubsections): 17 (initialize_ElementTest.InspectorTest.expandSelectedElementEventListenersEventBars): 18 (initialize_ElementTest.InspectorTest.dumpSelectedElementEventListeners): 19 (initialize_ElementTest.InspectorTest.dumpObjectPropertySection): 20 * inspector/elements/event-listener-sidebar-expected.txt: Added. 21 * inspector/elements/event-listener-sidebar.html: Added. 22 * platform/chromium/inspector/elements/event-listener-sidebar-expected.txt: Added. 23 Chromium has slightly different results. It has more properties 24 and includes extra information, like line numbers, for functions. 25 1 26 2011-06-20 Joseph Pecoraro <joepeck@webkit.org> 2 27 -
trunk/LayoutTests/http/tests/inspector/elements-test.js
r88331 r89317 103 103 }; 104 104 105 InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback) 106 { 107 InspectorTest.expandSelectedElementEventListeners(function() { 108 InspectorTest.dumpSelectedElementEventListeners(callback); 109 }); 110 } 111 112 InspectorTest.expandSelectedElementEventListeners = function(callback) 113 { 114 var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; 115 sidebarPane.expand(); 116 117 InspectorTest.runAfterPendingDispatches(function() { 118 InspectorTest.expandSelectedElementEventListenersSubsections(callback); 119 }); 120 } 121 122 InspectorTest.expandSelectedElementEventListenersSubsections = function(callback) 123 { 124 var eventListenerSections = WebInspector.panels.elements.sidebarPanes.eventListeners.sections; 125 for (var i = 0; i < eventListenerSections.length; ++i) 126 eventListenerSections[i].expand(); 127 128 // Multiple sections may expand. 129 InspectorTest.runAfterPendingDispatches(function() { 130 InspectorTest.expandSelectedElementEventListenersEventBars(callback); 131 }); 132 } 133 134 InspectorTest.expandSelectedElementEventListenersEventBars = function(callback) 135 { 136 var eventListenerSections = WebInspector.panels.elements.sidebarPanes.eventListeners.sections; 137 for (var i = 0; i < eventListenerSections.length; ++i) { 138 var eventBarChildren = eventListenerSections[i].eventBars.children; 139 for (var j = 0; j < eventBarChildren.length; ++j) 140 eventBarChildren[j]._section.expand(); 141 } 142 143 // Multiple sections may expand. 144 InspectorTest.runAfterPendingDispatches(callback); 145 } 146 147 InspectorTest.dumpSelectedElementEventListeners = function(callback) 148 { 149 var eventListenerSections = WebInspector.panels.elements.sidebarPanes.eventListeners.sections; 150 for (var i = 0; i < eventListenerSections.length; ++i) { 151 var section = eventListenerSections[i]; 152 var eventType = section._title; 153 InspectorTest.addResult(""); 154 InspectorTest.addResult("======== " + eventType + " ========"); 155 var eventBarChildren = section.eventBars.children; 156 for (var j = 0; j < eventBarChildren.length; ++j) { 157 var objectPropertiesSection = eventBarChildren[j]._section; 158 InspectorTest.dumpObjectPropertySection(objectPropertiesSection); 159 } 160 } 161 162 callback(); 163 } 164 165 InspectorTest.dumpObjectPropertySection = function(section) 166 { 167 var expandedSubstring = section.expanded ? "[expanded]" : "[collapsed]"; 168 InspectorTest.addResult(expandedSubstring + " " + section.titleElement.textContent + " " + section.subtitleAsTextForTest); 169 if (!section.propertiesForTest) 170 return; 171 172 for (var i = 0; i < section.propertiesForTest.length; ++i) { 173 var property = section.propertiesForTest[i]; 174 var key = property.name; 175 var value = property.value._description; 176 InspectorTest.addResult(" " + key + ": " + value); 177 } 178 } 179 105 180 // FIXME: this returns the first tree item found (may fail for same-named properties in a style). 106 181 InspectorTest.getElementStylePropertyTreeItem = function(propertyName) -
trunk/Source/WebCore/ChangeLog
r89316 r89317 1 2011-06-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: CRASH if Expanding Event Listener on document 6 https://bugs.webkit.org/show_bug.cgi?id=61834 7 8 Node::ownerDocument returns null for a document node. So, in 9 the case of a document node in resolveNode, use Node::document 10 which returns the node, as a document. 11 12 * inspector/InspectorDOMAgent.cpp: 13 (WebCore::InspectorDOMAgent::resolveNode): 14 1 15 2011-06-20 Joseph Pecoraro <joepeck@webkit.org> 2 16 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r88950 r89317 1448 1448 PassRefPtr<InspectorObject> InspectorDOMAgent::resolveNode(Node* node) 1449 1449 { 1450 Document* document = node-> ownerDocument();1450 Document* document = node->isDocumentNode() ? node->document() : node->ownerDocument(); 1451 1451 Frame* frame = document ? document->frame() : 0; 1452 1452 if (!frame)
Note: See TracChangeset
for help on using the changeset viewer.