⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239405 in webkit


Ignore:
Timestamp:
Dec 19, 2018, 4:46:10 PM (8 years ago)
Author:
Matt Baker
Message:

Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element
​https://bugs.webkit.org/show_bug.cgi?id=192871
<rdar://problem/46849060>

Reviewed by Devin Rousso.

Undoing a DOM node removal reinserts the node into the DOMTreeOutline.
When the reinserted node precedes the selected node in the tree, the
SelectionController should update _lastSelectedIndex.

  • UserInterface/Controllers/SelectionController.js:

(WI.SelectionController.prototype.didInsertItem):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r239404 r239405  
     12018-12-19  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element
     4        https://bugs.webkit.org/show_bug.cgi?id=192871
     5        <rdar://problem/46849060>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Undoing a DOM node removal reinserts the node into the DOMTreeOutline.
     10        When the reinserted node precedes the selected node in the tree, the
     11        SelectionController should update `_lastSelectedIndex`.
     12
     13        * UserInterface/Controllers/SelectionController.js:
     14        (WI.SelectionController.prototype.didInsertItem):
     15
    1162018-12-19  Devin Rousso  <drousso@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js

    r239178 r239405  
    213213            current = this._selectedIndexes.indexLessThan(current);
    214214        }
     215
     216        if (this._lastSelectedIndex >= index)
     217            this._lastSelectedIndex += 1;
     218        if (this._shiftAnchorIndex >= index)
     219            this._shiftAnchorIndex += 1;
    215220    }
    216221
  • trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

    r239246 r239405  
    407407
    408408        let index = this._indexOfTreeElement(element);
    409         if (index >= 0)
     409        if (index >= 0) {
     410            console.assert(!element.selected, "TreeElement should not be selected before being inserted.");
    410411            this._selectionController.didInsertItem(index);
     412        }
    411413    }
    412414
Note: See TracChangeset for help on using the changeset viewer.