WebKit Bugzilla
Attachment 356988 Details for
Bug 192487
: Web Inspector: Move TreeOutlineGroup coordination out of TreeElement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-192487-20181210132214.patch (text/plain), 5.46 KB, created by
Matt Baker
on 2018-12-10 13:22:27 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2018-12-10 13:22:27 PST
Size:
5.46 KB
patch
obsolete
>Subversion Revision: 239035 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 698900f5b78315bdfa783156075faab1e48711a6..be26ccc239cf4f8b8367a89701447ad29af4f7bb 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,26 @@ >+2018-12-10 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: Move TreeOutlineGroup coordination out of TreeElement >+ https://bugs.webkit.org/show_bug.cgi?id=192487 >+ <rdar://problem/46543431> >+ >+ Reviewed by Devin Rousso. >+ >+ * UserInterface/Views/TreeElement.js: >+ (WI.TreeElement.prototype.select): >+ (WI.TreeElement.prototype.deselect): >+ >+ * UserInterface/Views/TreeOutlineGroup.js: >+ (WI.TreeOutlineGroup): >+ (WI.TreeOutlineGroup.prototype.itemAdded): >+ (WI.TreeOutlineGroup.prototype.itemRemoved): >+ (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections): >+ (WI.TreeOutlineGroup.prototype._treeOutlineSelectionDidChange): >+ (WI.TreeOutlineGroup.groupForTreeOutline): Deleted. >+ (WI.TreeOutlineGroup.prototype.didSelectTreeElement): Deleted. >+ make the group responsible for listening to selection changes from the >+ TreeOutlines it manages, and synchronizing the selection between them. >+ > 2018-12-06 Matt Baker <mattbaker@apple.com> > > Web Inspector: REGRESSION(r238602): Elements: collapsing a DOM node with the left arrow doesn't work >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeElement.js b/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >index 6d79a9ec89b76eb599c0b4af64fb537bc9421637..7af88394cc1b906df54e00c09d29a12aab3b1c47 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >@@ -516,12 +516,6 @@ WI.TreeElement = class TreeElement extends WI.Object > > this.selected = true; > treeOutline.selectTreeElementInternal(this, suppressNotification, selectedByUser); >- >- let treeOutlineGroup = WI.TreeOutlineGroup.groupForTreeOutline(treeOutline); >- if (!treeOutlineGroup) >- return; >- >- treeOutlineGroup.didSelectTreeElement(this); > } > > revealAndSelect(omitFocus, selectedByUser, suppressNotification) >@@ -535,8 +529,6 @@ WI.TreeElement = class TreeElement extends WI.Object > if (!this.treeOutline || !this.selected) > return false; > >- console.assert(this.treeOutline.selectedTreeElements.includes(this)); >- > this.selected = false; > this.treeOutline.selectTreeElementInternal(null, suppressNotification); > >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js b/Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js >index b9195c17b4a79000526b34e2faa1f103ccf6ae6b..9b6616bd1fae6e4cb2fa7f65a423e2ad49004382 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017, 2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,13 +25,6 @@ > > WI.TreeOutlineGroup = class TreeOutlineGroup extends WI.Collection > { >- // Static >- >- static groupForTreeOutline(treeOutline) >- { >- return treeOutline[WI.TreeOutlineGroup.GroupForTreeOutlineSymbol] || null; >- } >- > // Public > > objectIsRequiredType(object) >@@ -53,36 +46,21 @@ WI.TreeOutlineGroup = class TreeOutlineGroup extends WI.Collection > > itemAdded(treeOutline) > { >- console.assert(!treeOutline[WI.TreeOutlineGroup.GroupForTreeOutlineSymbol]); >- treeOutline[WI.TreeOutlineGroup.GroupForTreeOutlineSymbol] = this; >- > if (treeOutline.selectedTreeElement) >- this._removeConflictingTreeSelections(treeOutline.selectedTreeElement); >+ this._removeConflictingTreeSelections(treeOutline); >+ >+ treeOutline.addEventListener(WI.TreeOutline.Event.SelectionDidChange, this._treeOutlineSelectionDidChange, this); > } > > itemRemoved(treeOutline) > { >- console.assert(treeOutline[WI.TreeOutlineGroup.GroupForTreeOutlineSymbol] === this); >- treeOutline[WI.TreeOutlineGroup.GroupForTreeOutlineSymbol] = null; >- } >- >- didSelectTreeElement(treeElement) >- { >- // Called by TreeOutline. >- >- if (!treeElement) >- return; >- >- this._removeConflictingTreeSelections(treeElement); >+ treeOutline.removeEventListener(null, null, this); > } > > // Private > >- _removeConflictingTreeSelections(treeElement) >+ _removeConflictingTreeSelections(selectedTreeOutline) > { >- let selectedTreeOutline = treeElement.treeOutline; >- console.assert(selectedTreeOutline, "Should have a parent tree outline."); >- > for (let treeOutline of this) { > if (selectedTreeOutline === treeOutline) > continue; >@@ -90,6 +68,13 @@ WI.TreeOutlineGroup = class TreeOutlineGroup extends WI.Collection > treeOutline.selectedTreeElement = null; > } > } >-}; > >-WI.TreeOutlineGroup.GroupForTreeOutlineSymbol = Symbol("group-for-tree-outline"); >+ _treeOutlineSelectionDidChange(event) >+ { >+ let treeOutline = event.target; >+ if (!treeOutline.selectedTreeElement) >+ return; >+ >+ this._removeConflictingTreeSelections(treeOutline); >+ } >+};
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 192487
:
356775
|
356777
| 356988