https://bugs.webkit.org/show_bug.cgi?id=191622
<rdar://problem/
46052014>
Reviewed by Devin Rousso.
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.insertChildElement):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype.update):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.removeChildrenRecursive): Deleted.
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.removeChildren):
(WI.DataGridNode.prototype.removeChildrenRecursive): Deleted.
* UserInterface/Views/ErrorObjectView.css:
(.error-object:not(.expanded) .content):
(.error-object .content):
(.error-object:not(.expanded) .tree-outline): Deleted.
(.error-object .tree-outline): Deleted.
* UserInterface/Views/ErrorObjectView.js:
(WI.ErrorObjectView):
(WI.ErrorObjectView.prototype.get treeOutline): Deleted.
Use a simple container since TreeOutline features aren't used,
and remove unused property `treeOutline`.
* UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
(WI.RecordingTraceDetailsSidebarPanel):
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.removeChildren):
(WI.TreeElement.prototype.removeChildrenRecursive): Deleted.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.removeChildrenRecursive): Deleted.
(WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted.
Removed `element` parameter now that the only use case has been removed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238626
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-11-28 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Remove unused DataGrid and TreeOutline code
+ https://bugs.webkit.org/show_bug.cgi?id=191622
+ <rdar://problem/46052014>
+
+ Reviewed by Devin Rousso.
+
+ * UserInterface/Views/CanvasDetailsSidebarPanel.js:
+ (WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
+
+ * UserInterface/Views/DOMTreeElement.js:
+ (WI.DOMTreeElement.prototype.insertChildElement):
+
+ * UserInterface/Views/DOMTreeOutline.js:
+ (WI.DOMTreeOutline):
+ (WI.DOMTreeOutline.prototype.update):
+
+ * UserInterface/Views/DataGrid.js:
+ (WI.DataGrid.prototype.removeChildrenRecursive): Deleted.
+
+ * UserInterface/Views/DataGridNode.js:
+ (WI.DataGridNode.prototype.removeChildren):
+ (WI.DataGridNode.prototype.removeChildrenRecursive): Deleted.
+
+ * UserInterface/Views/ErrorObjectView.css:
+ (.error-object:not(.expanded) .content):
+ (.error-object .content):
+ (.error-object:not(.expanded) .tree-outline): Deleted.
+ (.error-object .tree-outline): Deleted.
+
+ * UserInterface/Views/ErrorObjectView.js:
+ (WI.ErrorObjectView):
+ (WI.ErrorObjectView.prototype.get treeOutline): Deleted.
+ Use a simple container since TreeOutline features aren't used,
+ and remove unused property `treeOutline`.
+
+ * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
+ (WI.RecordingTraceDetailsSidebarPanel):
+
+ * UserInterface/Views/TreeElement.js:
+ (WI.TreeElement.prototype.removeChildren):
+ (WI.TreeElement.prototype.removeChildrenRecursive): Deleted.
+
+ * UserInterface/Views/TreeOutline.js:
+ (WI.TreeOutline):
+ (WI.TreeOutline.prototype.removeChildrenRecursive): Deleted.
+ (WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted.
+ Removed `element` parameter now that the only use case has been removed.
+
2018-11-27 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements tab should allow selecting/deleting multiple DOM nodes
this._sections.push(this._cssCanvasSection);
const selectable = false;
- let backtraceTreeOutline = new WI.TreeOutline(null, selectable);
+ let backtraceTreeOutline = new WI.TreeOutline(selectable);
backtraceTreeOutline.disclosureButtons = false;
this._backtraceTreeController = new WI.CallFrameTreeController(backtraceTreeOutline);
insertChildElement(child, index, closingTag)
{
var newElement = new WI.DOMTreeElement(child, closingTag);
- newElement.selectable = this.treeOutline._selectEnabled;
+ newElement.selectable = this.treeOutline.selectable;
this.insertChild(newElement, index);
return newElement;
}
WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
{
- constructor(omitRootDOMNode, selectEnabled, excludeRevealElementContextMenu)
+ constructor(omitRootDOMNode, selectable, excludeRevealElementContextMenu)
{
- super();
+ super(selectable);
this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
this.element.classList.add("dom", WI.SyntaxHighlightedStyleClassName);
this._includeRootDOMNode = !omitRootDOMNode;
- this._selectEnabled = selectEnabled;
this._excludeRevealElementContextMenu = excludeRevealElementContextMenu;
this._rootDOMNode = null;
this._selectedDOMNode = null;
var treeElement;
if (this._includeRootDOMNode) {
treeElement = new WI.DOMTreeElement(this.rootDOMNode);
- treeElement.selectable = this._selectEnabled;
+ treeElement.selectable = this.selectable;
this.appendChild(treeElement);
} else {
// FIXME: this could use findTreeElement to reuse a tree element if it already exists
var node = this.rootDOMNode.firstChild;
while (node) {
treeElement = new WI.DOMTreeElement(node);
- treeElement.selectable = this._selectEnabled;
+ treeElement.selectable = this.selectable;
this.appendChild(treeElement);
node = node.nextSibling;
this.hasChildren = false;
}
- removeChildrenRecursive()
- {
- var childrenToRemove = this.children;
-
- var child = this.children[0];
- while (child) {
- if (child.children.length)
- childrenToRemove = childrenToRemove.concat(child.children);
- child = child.traverseNextNode(false, this, true);
- }
-
- for (var i = 0; i < childrenToRemove.length; ++i) {
- child = childrenToRemove[i];
- child.deselect();
- child._detach();
-
- child.children = [];
- child.dataGrid = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
- }
-
- this.children = [];
- }
-
findNode(comparator, skipHidden, stayWithin, dontPopulate)
{
console.assert(typeof comparator === "function");
insertChild() { return WI.DataGrid.prototype.insertChild.apply(this, arguments); }
removeChild() { return WI.DataGrid.prototype.removeChild.apply(this, arguments); }
removeChildren() { return WI.DataGrid.prototype.removeChildren.apply(this, arguments); }
- removeChildrenRecursive() { return WI.DataGrid.prototype.removeChildrenRecursive.apply(this, arguments); }
_recalculateSiblings(myIndex)
{
/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
display: none;
}
-.error-object:not(.expanded) .tree-outline {
+.error-object:not(.expanded) .content {
display: none;
}
-.error-object .tree-outline {
+.error-object .content {
padding-left: 16px
}
/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015, 2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
previewElement.addEventListener("click", this._handlePreviewOrTitleElementClick.bind(this));
this._outlineElement = this._element.appendChild(document.createElement("div"));
- this._outline = new WI.TreeOutline(this._outlineElement);
+ this._outlineElement.className = "content";
}
// Static
return this._element;
}
- get treeOutline()
- {
- return this._outline;
- }
-
get expanded()
{
return this._expanded;
super("recording-trace", WI.UIString("Trace"));
const selectable = false;
- this._backtraceTreeOutline = new WI.TreeOutline(null, selectable);
+ this._backtraceTreeOutline = new WI.TreeOutline(selectable);
this._backtraceTreeOutline.disclosureButtons = false;
this._backtraceTreeController = new WI.CallFrameTreeController(this._backtraceTreeOutline);
removeChild() { return WI.TreeOutline.prototype.removeChild.apply(this, arguments); }
removeChildAtIndex() { return WI.TreeOutline.prototype.removeChildAtIndex.apply(this, arguments); }
removeChildren() { return WI.TreeOutline.prototype.removeChildren.apply(this, arguments); }
- removeChildrenRecursive() { return WI.TreeOutline.prototype.removeChildrenRecursive.apply(this, arguments); }
selfOrDescendant() { return WI.TreeOutline.prototype.selfOrDescendant.apply(this, arguments); }
get arrowToggleWidth()
WI.TreeOutline = class TreeOutline extends WI.Object
{
- constructor(element, selectable = true)
+ constructor(selectable = true)
{
super();
- this.element = element || document.createElement("ol");
+ this.element = document.createElement("ol");
this.element.classList.add(WI.TreeOutline.ElementStyleClassName);
this.element.addEventListener("contextmenu", this._handleContextmenu.bind(this));
this.children = [];
}
- removeChildrenRecursive(suppressOnDeselect)
- {
- let childrenToRemove = this.children;
- let child = this.children[0];
- while (child) {
- if (child.children.length)
- childrenToRemove = childrenToRemove.concat(child.children);
- child = child.traverseNextTreeElement(false, this, true);
- }
-
- for (let child of childrenToRemove) {
- child.deselect(suppressOnDeselect);
-
- let treeOutline = child.treeOutline;
- if (treeOutline)
- treeOutline._forgetTreeElement(child);
-
- child._detach();
- child.children = [];
- child.treeOutline = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
-
- if (treeOutline)
- treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRemoved, {element: child});
- }
-
- this.children = [];
- }
-
- reattachIfIndexChanged(treeElement, insertionIndex)
- {
- if (this.children[insertionIndex] === treeElement)
- return;
-
- let wasSelected = treeElement.selected;
-
- console.assert(!treeElement.parent || treeElement.parent === this);
- if (treeElement.parent === this)
- this.removeChild(treeElement);
-
- this.insertChild(treeElement, insertionIndex);
-
- if (wasSelected)
- treeElement.select();
- }
-
_rememberTreeElement(element)
{
this._treeElementIndexCache.clear();