Changeset 181184 in webkit
- Timestamp:
- Mar 6, 2015 2:33:27 PM (9 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r181119 r181184 1 2015-03-06 Jono Wells <jonowells@apple.com> 2 3 Web Inspector: Populate Debugger sidebar with all debuggable resources 4 https://bugs.webkit.org/show_bug.cgi?id=141232 5 6 Reviewed by Timothy Hatcher. 7 8 All debuggable resources now show in the debugger sidebar. The _resourceAdded handler now adds a script resource 9 to the sidebar regardless of whether it has any breakpoints set on it. The new function 10 _getTreeElementForSourceCodeAndAddToContentTreeOutline adds the element to the debugger sidebar before 11 _addBreakpointsForSourceCode is called. Removing all breakpoints from a resource no longer removes that 12 resource from the debugger sidebar. TreeOutline.prototype.removeChild has been updated so the disclosure 13 button will disappear and reappear correctly when removing/adding breakpoints. 14 15 * UserInterface/Views/DebuggerSidebarPanel.js: 16 (WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint): Expand resource if first breakpoint is added. 17 (WebInspector.DebuggerSidebarPanel.prototype._getTreeElementForSourceCodeAndAddToContentTreeOutline): Created. 18 (WebInspector.DebuggerSidebarPanel.prototype._resourceAdded): Checks resource type and adds scripts to sidebar. 19 (WebInspector.DebuggerSidebarPanel.prototype._mainResourceChanged): 20 (WebInspector.DebuggerSidebarPanel.prototype._scriptAdded): 21 (WebInspector.DebuggerSidebarPanel.prototype._removeBreakpointTreeElement): No longer removes empty parent. 22 (WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected): Displays scripts without breakpoints now. 23 24 * UserInterface/Views/GeneralTreeElement.js: 25 (WebInspector.GeneralTreeElement.prototype.get disclosureButton): Drive-by fix. Unused. Deleted. 26 27 * UserInterface/Views/TreeOutline.js: 28 (TreeOutline.prototype.removeChild): 29 Remove parent class and set hasChildren to false if necessary to properly hide and reveal disclosure button 30 for elements whose children have been removed. 31 1 32 2015-03-05 Joseph Pecoraro <pecoraro@apple.com> 2 33 -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
r180004 r181184 154 154 WebInspector.DebuggerSidebarPanel.prototype = { 155 155 constructor: WebInspector.DebuggerSidebarPanel, 156 __proto__: WebInspector.NavigationSidebarPanel.prototype, 156 157 157 158 // Public … … 279 280 return null; 280 281 281 var parentTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(sourceCode); 282 if (!parentTreeElement) { 283 if (sourceCode instanceof WebInspector.SourceMapResource) 284 parentTreeElement = new WebInspector.SourceMapResourceTreeElement(sourceCode); 285 else if (sourceCode instanceof WebInspector.Resource) 286 parentTreeElement = new WebInspector.ResourceTreeElement(sourceCode); 287 else if (sourceCode instanceof WebInspector.Script) 288 parentTreeElement = new WebInspector.ScriptTreeElement(sourceCode); 289 } 290 291 if (!parentTreeElement.parent) { 292 parentTreeElement.hasChildren = true; 293 parentTreeElement.expand(); 294 295 this._breakpointsContentTreeOutline.insertChild(parentTreeElement, insertionIndexForObjectInListSortedByFunction(parentTreeElement, this._breakpointsContentTreeOutline.children, this._compareTopLevelTreeElements.bind(this))); 296 } 282 var parentTreeElement = this._addTreeElementForSourceCodeToContentTreeOutline(sourceCode); 297 283 298 284 // Mark disabled breakpoints as resolved if there is source code loaded with that URL. … … 305 291 var breakpointTreeElement = new WebInspector.BreakpointTreeElement(breakpoint); 306 292 parentTreeElement.insertChild(breakpointTreeElement, insertionIndexForObjectInListSortedByFunction(breakpointTreeElement, parentTreeElement.children, this._compareBreakpointTreeElements)); 293 if (parentTreeElement.children.length === 1) 294 parentTreeElement.expand(); 307 295 return breakpointTreeElement; 308 296 }, … … 315 303 }, 316 304 305 _addTreeElementForSourceCodeToContentTreeOutline: function(sourceCode) 306 { 307 var treeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(sourceCode); 308 if (!treeElement) { 309 if (sourceCode instanceof WebInspector.SourceMapResource) 310 treeElement = new WebInspector.SourceMapResourceTreeElement(sourceCode); 311 else if (sourceCode instanceof WebInspector.Resource) 312 treeElement = new WebInspector.ResourceTreeElement(sourceCode); 313 else if (sourceCode instanceof WebInspector.Script) 314 treeElement = new WebInspector.ScriptTreeElement(sourceCode); 315 } 316 317 if (!treeElement.parent) { 318 treeElement.hasChildren = false; 319 treeElement.expand(); 320 321 this._breakpointsContentTreeOutline.insertChild(treeElement, insertionIndexForObjectInListSortedByFunction(treeElement, this._breakpointsContentTreeOutline.children, this._compareTopLevelTreeElements.bind(this))); 322 } 323 324 return treeElement; 325 }, 326 317 327 _resourceAdded: function(event) 318 328 { 319 329 var resource = event.data.resource; 330 331 if (![WebInspector.Resource.Type.Document, WebInspector.Resource.Type.Script].contains(resource.type)) 332 return; 333 334 this._addTreeElementForSourceCodeToContentTreeOutline(resource); 320 335 this._addBreakpointsForSourceCode(resource); 321 336 }, … … 324 339 { 325 340 var resource = event.target.mainResource; 341 this._addTreeElementForSourceCodeToContentTreeOutline(resource); 326 342 this._addBreakpointsForSourceCode(resource); 327 343 }, … … 330 346 { 331 347 var script = event.data.script; 348 349 // FIXME: Allow for scripts generated by eval statements to appear, but filter out JSC internals 350 // and other WebInspector internals lacking __WebInspector in the url attribute. 351 if (!script.url) 352 return; 353 354 // Exclude inspector scripts. 355 if (script.url && script.url.indexOf("__WebInspector") === 0) 356 return; 332 357 333 358 // Don't add breakpoints if the script is represented by a Resource. They were … … 336 361 return; 337 362 363 this._addTreeElementForSourceCodeToContentTreeOutline(script); 338 364 this._addBreakpointsForSourceCode(script); 339 365 }, … … 402 428 403 429 console.assert(parentTreeElement.parent === this._breakpointsContentTreeOutline); 404 405 if (!parentTreeElement.children.length)406 this._breakpointsContentTreeOutline.removeChild(parentTreeElement);407 430 }, 408 431 … … 561 584 562 585 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) { 563 // If the resource is being selected when it has no children it is in the process of being deleted, don't do anything.564 if (!treeElement.children.length)565 return;566 586 deselectCallStackContentTreeElements.call(this); 567 587 deselectPauseReasonContentTreeElements.call(this); … … 646 666 { 647 667 var pauseData = WebInspector.debuggerManager.pauseData; 648 668 649 669 switch (WebInspector.debuggerManager.pauseReason) { 650 670 case WebInspector.DebuggerManager.PauseReason.Assertion: … … 654 674 this._pauseReasonTextRow.text = WebInspector.UIString("Assertion with message: %s").format(pauseData.message); 655 675 return true; 656 } 676 } 657 677 658 678 this._pauseReasonTextRow.text = WebInspector.UIString("Assertion Failed"); … … 732 752 } 733 753 }; 734 735 WebInspector.DebuggerSidebarPanel.prototype.__proto__ = WebInspector.NavigationSidebarPanel.prototype; -
trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
r180486 r181184 62 62 }, 63 63 64 get disclosureButton()65 {66 this._createElementsIfNeeded();67 return this._disclosureButton;68 },69 70 64 get iconElement() 71 65 { -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r178544 r181184 193 193 194 194 this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling); 195 196 if (!this.children.length) { 197 this._listItemNode.classList.remove("parent"); 198 this.hasChildren = false; 199 } 195 200 }; 196 201
Note: See TracChangeset
for help on using the changeset viewer.