Changeset 240594 in webkit


Ignore:
Timestamp:
Jan 28, 2019 11:53:20 AM (5 years ago)
Author:
Matt Baker
Message:

REGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
https://bugs.webkit.org/show_bug.cgi?id=193808
<rdar://problem/47537734>

Reviewed by Devin Rousso.

  • UserInterface/Controllers/SelectionController.js:

(WI.SelectionController.prototype.didRemoveItems):

  • UserInterface/Views/TreeOutline.js:

(WI.TreeOutline.prototype._indexesForSubtree):
Fix a bug where no IndexSet was returned when passed a TreeElement with
no children. This caused the Timelines tree selection to be corrupted when
entering and exiting edit mode, as TreeElements are inserted and removed.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r240559 r240594  
     12019-01-28  Matt Baker  <mattbaker@apple.com>
     2
     3        REGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
     4        https://bugs.webkit.org/show_bug.cgi?id=193808
     5        <rdar://problem/47537734>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * UserInterface/Controllers/SelectionController.js:
     10        (WI.SelectionController.prototype.didRemoveItems):
     11
     12        * UserInterface/Views/TreeOutline.js:
     13        (WI.TreeOutline.prototype._indexesForSubtree):
     14        Fix a bug where no IndexSet was returned when passed a TreeElement with
     15        no children. This caused the Timelines tree selection to be corrupted when
     16        entering and exiting edit mode, as TreeElements are inserted and removed.
     17
    1182019-01-28  Nikita Vasilyev  <nvasilyev@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js

    r239405 r240594  
    222222    didRemoveItems(indexes)
    223223    {
     224        if (!indexes)
     225            return;
     226
    224227        console.assert(indexes instanceof WI.IndexSet);
    225228
    226         if (!this._selectedIndexes.size)
     229        if (!indexes.size || !this._selectedIndexes.size)
    227230            return;
    228231
  • trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

    r240051 r240594  
    10831083        let treeOutline = treeElement.treeOutline;
    10841084        if (!treeOutline)
    1085             return new WI.IndexSet;
     1085            return null;
    10861086
    10871087        let firstChild = treeElement.children[0];
    1088         if (!firstChild)
    1089             return new WI.IndexSet;
    1090 
    1091         let startIndex = treeOutline._indexOfTreeElement(firstChild);
     1088        if (treeElement.root && !firstChild)
     1089            return null;
     1090
     1091        let current = firstChild || treeElement;
     1092        let startIndex = treeOutline._indexOfTreeElement(current);
    10921093        let endIndex = startIndex;
    10931094
     
    10961097        const dontPopulate = true;
    10971098
    1098         let current = firstChild;
    10991099        while (current = current.traverseNextTreeElement(skipUnrevealed, stayWithin, dontPopulate))
    11001100            endIndex++;
    1101 
    1102         // Include the index of the subtree's root, unless it's the TreeOutline root.
    1103         if (!treeElement.root)
    1104             startIndex--;
    11051101
    11061102        let count = endIndex - startIndex + 1;
Note: See TracChangeset for help on using the changeset viewer.