Changeset 238626 in webkit


Ignore:
Timestamp:
Nov 28, 2018 11:47:01 AM (5 years ago)
Author:
Matt Baker
Message:

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.

Location:
trunk/Source/WebInspectorUI
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r238602 r238626  
     12018-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
    1512018-11-27  Matt Baker  <mattbaker@apple.com>
    252
  • trunk/Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js

    r228301 r238626  
    137137
    138138        const selectable = false;
    139         let backtraceTreeOutline = new WI.TreeOutline(null, selectable);
     139        let backtraceTreeOutline = new WI.TreeOutline(selectable);
    140140        backtraceTreeOutline.disclosureButtons = false;
    141141        this._backtraceTreeController = new WI.CallFrameTreeController(backtraceTreeOutline);
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js

    r238602 r238626  
    424424    {
    425425        var newElement = new WI.DOMTreeElement(child, closingTag);
    426         newElement.selectable = this.treeOutline._selectEnabled;
     426        newElement.selectable = this.treeOutline.selectable;
    427427        this.insertChild(newElement, index);
    428428        return newElement;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js

    r238602 r238626  
    3131WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
    3232{
    33     constructor(omitRootDOMNode, selectEnabled, excludeRevealElementContextMenu)
    34     {
    35         super();
     33    constructor(omitRootDOMNode, selectable, excludeRevealElementContextMenu)
     34    {
     35        super(selectable);
    3636
    3737        this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
     
    4747
    4848        this._includeRootDOMNode = !omitRootDOMNode;
    49         this._selectEnabled = selectEnabled;
    5049        this._excludeRevealElementContextMenu = excludeRevealElementContextMenu;
    5150        this._rootDOMNode = null;
     
    166165        if (this._includeRootDOMNode) {
    167166            treeElement = new WI.DOMTreeElement(this.rootDOMNode);
    168             treeElement.selectable = this._selectEnabled;
     167            treeElement.selectable = this.selectable;
    169168            this.appendChild(treeElement);
    170169        } else {
     
    173172            while (node) {
    174173                treeElement = new WI.DOMTreeElement(node);
    175                 treeElement.selectable = this._selectEnabled;
     174                treeElement.selectable = this.selectable;
    176175                this.appendChild(treeElement);
    177176                node = node.nextSibling;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r235997 r238626  
    12381238        this.children = [];
    12391239        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 = [];
    12661240    }
    12671241
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js

    r224303 r238626  
    410410    removeChild() { return WI.DataGrid.prototype.removeChild.apply(this, arguments); }
    411411    removeChildren() { return WI.DataGrid.prototype.removeChildren.apply(this, arguments); }
    412     removeChildrenRecursive() { return WI.DataGrid.prototype.removeChildrenRecursive.apply(this, arguments); }
    413412
    414413    _recalculateSiblings(myIndex)
  • trunk/Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.css

    r195303 r238626  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5454}
    5555
    56 .error-object:not(.expanded) .tree-outline {
     56.error-object:not(.expanded) .content {
    5757    display: none;
    5858}
    5959
    60 .error-object .tree-outline {
     60.error-object .content {
    6161    padding-left: 16px
    6262}
  • trunk/Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js

    r237571 r238626  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015, 2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4444
    4545        this._outlineElement = this._element.appendChild(document.createElement("div"));
    46         this._outline = new WI.TreeOutline(this._outlineElement);
     46        this._outlineElement.className = "content";
    4747    }
    4848
     
    7979    {
    8080        return this._element;
    81     }
    82 
    83     get treeOutline()
    84     {
    85         return this._outline;
    8681    }
    8782
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.js

    r228301 r238626  
    3131
    3232        const selectable = false;
    33         this._backtraceTreeOutline = new WI.TreeOutline(null, selectable);
     33        this._backtraceTreeOutline = new WI.TreeOutline(selectable);
    3434        this._backtraceTreeOutline.disclosureButtons = false;
    3535        this._backtraceTreeController = new WI.CallFrameTreeController(this._backtraceTreeOutline);
  • trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js

    r238599 r238626  
    6363    removeChildAtIndex() { return WI.TreeOutline.prototype.removeChildAtIndex.apply(this, arguments); }
    6464    removeChildren() { return WI.TreeOutline.prototype.removeChildren.apply(this, arguments); }
    65     removeChildrenRecursive() { return WI.TreeOutline.prototype.removeChildrenRecursive.apply(this, arguments); }
    6665    selfOrDescendant() { return WI.TreeOutline.prototype.selfOrDescendant.apply(this, arguments); }
    6766
  • trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

    r238602 r238626  
    2929WI.TreeOutline = class TreeOutline extends WI.Object
    3030{
    31     constructor(element, selectable = true)
     31    constructor(selectable = true)
    3232    {
    3333        super();
    3434
    35         this.element = element || document.createElement("ol");
     35        this.element = document.createElement("ol");
    3636        this.element.classList.add(WI.TreeOutline.ElementStyleClassName);
    3737        this.element.addEventListener("contextmenu", this._handleContextmenu.bind(this));
     
    392392    }
    393393
    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 
    442394    _rememberTreeElement(element)
    443395    {
Note: See TracChangeset for help on using the changeset viewer.