Changeset 238626 in webkit
- Timestamp:
- Nov 28, 2018 11:47:01 AM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r238602 r238626 1 2018-11-28 Matt Baker <mattbaker@apple.com> 2 3 Web Inspector: Remove unused DataGrid and TreeOutline code 4 https://bugs.webkit.org/show_bug.cgi?id=191622 5 <rdar://problem/46052014> 6 7 Reviewed by Devin Rousso. 8 9 * UserInterface/Views/CanvasDetailsSidebarPanel.js: 10 (WI.CanvasDetailsSidebarPanel.prototype.initialLayout): 11 12 * UserInterface/Views/DOMTreeElement.js: 13 (WI.DOMTreeElement.prototype.insertChildElement): 14 15 * UserInterface/Views/DOMTreeOutline.js: 16 (WI.DOMTreeOutline): 17 (WI.DOMTreeOutline.prototype.update): 18 19 * UserInterface/Views/DataGrid.js: 20 (WI.DataGrid.prototype.removeChildrenRecursive): Deleted. 21 22 * UserInterface/Views/DataGridNode.js: 23 (WI.DataGridNode.prototype.removeChildren): 24 (WI.DataGridNode.prototype.removeChildrenRecursive): Deleted. 25 26 * UserInterface/Views/ErrorObjectView.css: 27 (.error-object:not(.expanded) .content): 28 (.error-object .content): 29 (.error-object:not(.expanded) .tree-outline): Deleted. 30 (.error-object .tree-outline): Deleted. 31 32 * UserInterface/Views/ErrorObjectView.js: 33 (WI.ErrorObjectView): 34 (WI.ErrorObjectView.prototype.get treeOutline): Deleted. 35 Use a simple container since TreeOutline features aren't used, 36 and remove unused property `treeOutline`. 37 38 * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js: 39 (WI.RecordingTraceDetailsSidebarPanel): 40 41 * UserInterface/Views/TreeElement.js: 42 (WI.TreeElement.prototype.removeChildren): 43 (WI.TreeElement.prototype.removeChildrenRecursive): Deleted. 44 45 * UserInterface/Views/TreeOutline.js: 46 (WI.TreeOutline): 47 (WI.TreeOutline.prototype.removeChildrenRecursive): Deleted. 48 (WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted. 49 Removed `element` parameter now that the only use case has been removed. 50 1 51 2018-11-27 Matt Baker <mattbaker@apple.com> 2 52 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js
r228301 r238626 137 137 138 138 const selectable = false; 139 let backtraceTreeOutline = new WI.TreeOutline( null,selectable);139 let backtraceTreeOutline = new WI.TreeOutline(selectable); 140 140 backtraceTreeOutline.disclosureButtons = false; 141 141 this._backtraceTreeController = new WI.CallFrameTreeController(backtraceTreeOutline); -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r238602 r238626 424 424 { 425 425 var newElement = new WI.DOMTreeElement(child, closingTag); 426 newElement.selectable = this.treeOutline. _selectEnabled;426 newElement.selectable = this.treeOutline.selectable; 427 427 this.insertChild(newElement, index); 428 428 return newElement; -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
r238602 r238626 31 31 WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline 32 32 { 33 constructor(omitRootDOMNode, select Enabled, excludeRevealElementContextMenu)34 { 35 super( );33 constructor(omitRootDOMNode, selectable, excludeRevealElementContextMenu) 34 { 35 super(selectable); 36 36 37 37 this.element.addEventListener("mousedown", this._onmousedown.bind(this), false); … … 47 47 48 48 this._includeRootDOMNode = !omitRootDOMNode; 49 this._selectEnabled = selectEnabled;50 49 this._excludeRevealElementContextMenu = excludeRevealElementContextMenu; 51 50 this._rootDOMNode = null; … … 166 165 if (this._includeRootDOMNode) { 167 166 treeElement = new WI.DOMTreeElement(this.rootDOMNode); 168 treeElement.selectable = this. _selectEnabled;167 treeElement.selectable = this.selectable; 169 168 this.appendChild(treeElement); 170 169 } else { … … 173 172 while (node) { 174 173 treeElement = new WI.DOMTreeElement(node); 175 treeElement.selectable = this. _selectEnabled;174 treeElement.selectable = this.selectable; 176 175 this.appendChild(treeElement); 177 176 node = node.nextSibling; -
trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js
r235997 r238626 1238 1238 this.children = []; 1239 1239 this.hasChildren = false; 1240 }1241 1242 removeChildrenRecursive()1243 {1244 var childrenToRemove = this.children;1245 1246 var child = this.children[0];1247 while (child) {1248 if (child.children.length)1249 childrenToRemove = childrenToRemove.concat(child.children);1250 child = child.traverseNextNode(false, this, true);1251 }1252 1253 for (var i = 0; i < childrenToRemove.length; ++i) {1254 child = childrenToRemove[i];1255 child.deselect();1256 child._detach();1257 1258 child.children = [];1259 child.dataGrid = null;1260 child.parent = null;1261 child.nextSibling = null;1262 child.previousSibling = null;1263 }1264 1265 this.children = [];1266 1240 } 1267 1241 -
trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js
r224303 r238626 410 410 removeChild() { return WI.DataGrid.prototype.removeChild.apply(this, arguments); } 411 411 removeChildren() { return WI.DataGrid.prototype.removeChildren.apply(this, arguments); } 412 removeChildrenRecursive() { return WI.DataGrid.prototype.removeChildrenRecursive.apply(this, arguments); }413 412 414 413 _recalculateSiblings(myIndex) -
trunk/Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.css
r195303 r238626 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 54 54 } 55 55 56 .error-object:not(.expanded) . tree-outline{56 .error-object:not(.expanded) .content { 57 57 display: none; 58 58 } 59 59 60 .error-object . tree-outline{60 .error-object .content { 61 61 padding-left: 16px 62 62 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js
r237571 r238626 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015, 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 45 45 this._outlineElement = this._element.appendChild(document.createElement("div")); 46 this._outline = new WI.TreeOutline(this._outlineElement);46 this._outlineElement.className = "content"; 47 47 } 48 48 … … 79 79 { 80 80 return this._element; 81 }82 83 get treeOutline()84 {85 return this._outline;86 81 } 87 82 -
trunk/Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.js
r228301 r238626 31 31 32 32 const selectable = false; 33 this._backtraceTreeOutline = new WI.TreeOutline( null,selectable);33 this._backtraceTreeOutline = new WI.TreeOutline(selectable); 34 34 this._backtraceTreeOutline.disclosureButtons = false; 35 35 this._backtraceTreeController = new WI.CallFrameTreeController(this._backtraceTreeOutline); -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js
r238599 r238626 63 63 removeChildAtIndex() { return WI.TreeOutline.prototype.removeChildAtIndex.apply(this, arguments); } 64 64 removeChildren() { return WI.TreeOutline.prototype.removeChildren.apply(this, arguments); } 65 removeChildrenRecursive() { return WI.TreeOutline.prototype.removeChildrenRecursive.apply(this, arguments); }66 65 selfOrDescendant() { return WI.TreeOutline.prototype.selfOrDescendant.apply(this, arguments); } 67 66 -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r238602 r238626 29 29 WI.TreeOutline = class TreeOutline extends WI.Object 30 30 { 31 constructor( element,selectable = true)31 constructor(selectable = true) 32 32 { 33 33 super(); 34 34 35 this.element = element ||document.createElement("ol");35 this.element = document.createElement("ol"); 36 36 this.element.classList.add(WI.TreeOutline.ElementStyleClassName); 37 37 this.element.addEventListener("contextmenu", this._handleContextmenu.bind(this)); … … 392 392 } 393 393 394 removeChildrenRecursive(suppressOnDeselect)395 {396 let childrenToRemove = this.children;397 let child = this.children[0];398 while (child) {399 if (child.children.length)400 childrenToRemove = childrenToRemove.concat(child.children);401 child = child.traverseNextTreeElement(false, this, true);402 }403 404 for (let child of childrenToRemove) {405 child.deselect(suppressOnDeselect);406 407 let treeOutline = child.treeOutline;408 if (treeOutline)409 treeOutline._forgetTreeElement(child);410 411 child._detach();412 child.children = [];413 child.treeOutline = null;414 child.parent = null;415 child.nextSibling = null;416 child.previousSibling = null;417 418 if (treeOutline)419 treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRemoved, {element: child});420 }421 422 this.children = [];423 }424 425 reattachIfIndexChanged(treeElement, insertionIndex)426 {427 if (this.children[insertionIndex] === treeElement)428 return;429 430 let wasSelected = treeElement.selected;431 432 console.assert(!treeElement.parent || treeElement.parent === this);433 if (treeElement.parent === this)434 this.removeChild(treeElement);435 436 this.insertChild(treeElement, insertionIndex);437 438 if (wasSelected)439 treeElement.select();440 }441 442 394 _rememberTreeElement(element) 443 395 {
Note: See TracChangeset
for help on using the changeset viewer.