WebKit Bugzilla
Attachment 358026 Details for
Bug 192917
: Web Inspector: REGRESSION: deleting an audit puts selection in a selected but invisible state
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192917-20181222155706.patch (text/plain), 5.19 KB, created by
Matt Baker
on 2018-12-22 15:57:07 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2018-12-22 15:57:07 PST
Size:
5.19 KB
patch
obsolete
>Subversion Revision: 239513 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 0e46844587d5a3636397aad1c9d13c1dcc8c8db7..e6d5d3cc6c5aebc31b0bced3474f71d14a558def 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,26 @@ >+2018-12-22 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: REGRESSION: deleting an audit puts selection in a selected but invisible state >+ https://bugs.webkit.org/show_bug.cgi?id=192917 >+ <rdar://problem/46875285> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ SelectionController should not be notified of removed children until the >+ child items have been removed from the TreeOutline. Doing so at this stage >+ is unsafe, since this method checks `this.selectedTreeElement`, which could >+ return the adjusted index from the SelectionController before anything has >+ actually been removed from the TreeOutline. >+ >+ The number of calls to SelectionController.prototype.didRemoveItems is also >+ reduced somewhat, since we're no longer calling it for every TreeElement. >+ >+ * UserInterface/Views/TreeOutline.js: >+ (WI.TreeOutline.prototype.removeChildAtIndex): >+ (WI.TreeOutline.prototype.removeChildren): >+ (WI.TreeOutline.prototype._forgetTreeElement): >+ (WI.TreeOutline.prototype._indexesForSubtree): Added. >+ > 2018-12-20 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Dark Mode: Type profiler popovers have black text on dark background >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >index 22840a1e435e375b2135ff01395f9be4b22ecbd8..9a0183e7d6cae2e0171700227c27bec544dd868d 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >@@ -329,6 +329,8 @@ WI.TreeOutline = class TreeOutline extends WI.Object > treeOutline._forgetChildrenRecursive(child); > } > >+ let removedIndexes = this._indexesForSubtree(child); >+ > if (child.previousSibling) > child.previousSibling.nextSibling = child.nextSibling; > if (child.nextSibling) >@@ -342,8 +344,10 @@ WI.TreeOutline = class TreeOutline extends WI.Object > child.nextSibling = null; > child.previousSibling = null; > >- if (treeOutline) >+ if (treeOutline) { >+ treeOutline._selectionController.didRemoveItems(removedIndexes); > treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRemoved, {element: child}); >+ } > } > > removeChild(child, suppressOnDeselect, suppressSelectSibling) >@@ -378,16 +382,20 @@ WI.TreeOutline = class TreeOutline extends WI.Object > treeOutline._forgetChildrenRecursive(child); > } > >+ let removedIndexes = treeOutline._indexesForSubtree(child); >+ > child._detach(); > child.treeOutline = null; > child.parent = null; > child.nextSibling = null; > child.previousSibling = null; > >- if (treeOutline) >- treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRemoved, {element: child}); >- > this.children.shift(); >+ >+ if (treeOutline) { >+ treeOutline._selectionController.didRemoveItems(removedIndexes); >+ treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRemoved, {element: child}); >+ } > } > } > >@@ -419,10 +427,6 @@ WI.TreeOutline = class TreeOutline extends WI.Object > this.selectedTreeElement = null; > } > if (this._knownTreeElements[element.identifier]) { >- let index = this._indexOfTreeElement(element); >- if (index >= 0) >- this._selectionController.didRemoveItems(new WI.IndexSet([index])); >- > this._knownTreeElements[element.identifier].remove(element, true); > this._cachedNumberOfDescendents--; > } >@@ -1072,6 +1076,39 @@ WI.TreeOutline = class TreeOutline extends WI.Object > > this.dispatchEventToListeners(WI.TreeOutline.Event.SelectionDidChange, {selectedByUser}); > } >+ >+ _indexesForSubtree(treeElement) >+ { >+ let treeOutline = treeElement.treeOutline; >+ if (!treeOutline) >+ return new WI.IndexSet; >+ >+ let firstChild = treeElement.children[0]; >+ if (!firstChild) >+ return new WI.IndexSet; >+ >+ let startIndex = treeOutline._indexOfTreeElement(firstChild); >+ let endIndex = startIndex; >+ >+ const skipUnrevealed = false; >+ const stayWithin = treeElement; >+ const dontPopulate = true; >+ >+ let current = firstChild; >+ while (current = current.traverseNextTreeElement(skipUnrevealed, stayWithin, dontPopulate)) >+ endIndex++; >+ >+ // Include the index of the subtree's root, unless it's the TreeOutline root. >+ if (!treeElement.root) >+ startIndex--; >+ >+ let count = endIndex - startIndex + 1; >+ >+ let indexes = new WI.IndexSet; >+ indexes.addRange(startIndex, count); >+ >+ return indexes; >+ } > }; > > WI.TreeOutline._styleElement = null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192917
: 358026