WebKit Bugzilla
Attachment 361235 Details for
Bug 194300
: Web Inspector: Elements tab: selection is broken after deleting the selected node
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194300-20190205160625.patch (text/plain), 3.15 KB, created by
Matt Baker
on 2019-02-05 16:06:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2019-02-05 16:06:25 PST
Size:
3.15 KB
patch
obsolete
>Subversion Revision: 240999 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 56b33836d3711b63b4aac1da93ac2c96d705de23..af27efaa1d806922ca3e3246b3b6a93c448efd6b 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2019-02-05 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: Elements tab: selection is broken after deleting the selected node >+ https://bugs.webkit.org/show_bug.cgi?id=194300 >+ <rdar://problem/47829275> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Deleting a TreeElement can cause an IndexSet including indexes >+ outside the deleted range to be passed to SelectionController, >+ corrupting the internal selection state. >+ >+ * UserInterface/Views/TreeOutline.js: >+ (WI.TreeOutline.prototype._indexesForSubtree.numberOfElementsInSubtree): Added. >+ (WI.TreeOutline.prototype._indexesForSubtree): >+ Finding the last (rightmost leaf) TreeElement in the subtree used >+ TreeElement.prototype.traverseNextElement to do a depth first traversal. >+ This method did not stay within the subtree rooted at `treeElement`. >+ > 2019-02-05 Matt Baker <mattbaker@apple.com> > > Web Inspector: REGRESSION (r240947): Resources tab: can't select main frame after refreshing page >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >index 4ef3e86eea233d28261b1381a0ff310c76bb79b0..9f21a2c55a78e12673bf49d9570ec5a0485f6a9b 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >@@ -1089,26 +1089,25 @@ WI.TreeOutline = class TreeOutline extends WI.Object > if (!treeOutline) > return null; > >- let firstChild = treeElement.children[0]; >- if (treeElement.root && !firstChild) >- return null; >- >- let current = firstChild || treeElement; >- let startIndex = treeOutline._indexOfTreeElement(current); >- let endIndex = startIndex; >- >- const skipUnrevealed = false; >- const stayWithin = treeElement; >- const dontPopulate = true; >- >- while (current = current.traverseNextTreeElement(skipUnrevealed, stayWithin, dontPopulate)) >- endIndex++; >+ function numberOfElementsInSubtree(treeElement) { >+ let elements = treeElement.root ? Array.from(treeElement.children) : [treeElement]; >+ let count = 0; >+ while (elements.length) { >+ let child = elements.pop(); >+ if (child.hidden) >+ continue; > >- let count = endIndex - startIndex + 1; >+ count++; >+ elements = elements.concat(child.children); >+ } >+ return count; >+ } > >+ let firstChild = treeElement.root ? treeElement.children[0] : treeElement; >+ let startIndex = treeOutline._indexOfTreeElement(firstChild); >+ let count = numberOfElementsInSubtree(treeElement); > let indexes = new WI.IndexSet; > indexes.addRange(startIndex, count); >- > return indexes; > } > };
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 194300
:
361217
|
361224
|
361233
| 361235