Title: [224981] trunk/Source/WebInspectorUI
- Revision
- 224981
- Author
- [email protected]
- Date
- 2017-11-17 13:29:43 -0800 (Fri, 17 Nov 2017)
Log Message
Web Inspector: Remove WI.instanceForClass
https://bugs.webkit.org/show_bug.cgi?id=179746
Reviewed by Timothy Hatcher.
The implementations of DetailsSidebarPanel subclasses assume that panels
are closed and released when no longer needed. Keeping them alive with
instanceForClass isn't the right choice, since sidebar panels remove their
event listeners when closed.
* UserInterface/Base/Main.js:
(WI.instanceForClass): Deleted.
* UserInterface/Views/DebuggerTabContentView.js:
(WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/TabContentView.js:
(WI.TabContentView.prototype.get detailsSidebarPanels):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (224980 => 224981)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-11-17 21:11:46 UTC (rev 224980)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-11-17 21:29:43 UTC (rev 224981)
@@ -1,5 +1,24 @@
2017-11-17 Matt Baker <[email protected]>
+ Web Inspector: Remove WI.instanceForClass
+ https://bugs.webkit.org/show_bug.cgi?id=179746
+
+ Reviewed by Timothy Hatcher.
+
+ The implementations of DetailsSidebarPanel subclasses assume that panels
+ are closed and released when no longer needed. Keeping them alive with
+ instanceForClass isn't the right choice, since sidebar panels remove their
+ event listeners when closed.
+
+ * UserInterface/Base/Main.js:
+ (WI.instanceForClass): Deleted.
+ * UserInterface/Views/DebuggerTabContentView.js:
+ (WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
+ * UserInterface/Views/TabContentView.js:
+ (WI.TabContentView.prototype.get detailsSidebarPanels):
+
+2017-11-17 Matt Baker <[email protected]>
+
Web Inspector: ButtonNavigationItem should support image and text button style
https://bugs.webkit.org/show_bug.cgi?id=179625
<rdar://problem/35512238>
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (224980 => 224981)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2017-11-17 21:11:46 UTC (rev 224980)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2017-11-17 21:29:43 UTC (rev 224981)
@@ -502,24 +502,6 @@
this.runBootstrapOperations();
};
-// This function returns a lazily constructed instance of a class scoped to this WebInspector
-// instance. In the unlikely event that we ever need to construct multiple WebInspector instances
-// this allows us to scope objects within the WI.
-// Classes can prevent usage of this function via a static `disallowInstanceForClass` function that
-// returns true. It is then their responsibility to ensure that the returned value is tracked.
-// Currently it is only used for sidebars.
-WI.instanceForClass = function(constructor)
-{
- console.assert(typeof constructor === "function");
- if (typeof constructor.disallowInstanceForClass === "function" && constructor.disallowInstanceForClass())
- return new constructor;
-
- let key = `__${constructor.name}`;
- if (!WI[key])
- WI[key] = new constructor;
- return WI[key];
-};
-
WI.isTabTypeAllowed = function(tabType)
{
let tabClass = this._knownTabClassesByType.get(tabType);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js (224980 => 224981)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js 2017-11-17 21:11:46 UTC (rev 224980)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js 2017-11-17 21:29:43 UTC (rev 224981)
@@ -72,7 +72,10 @@
if (!this._showScopeChainDetailsSidebarPanel)
return;
- let scopeChainDetailsSidebarPanel = WI.instanceForClass(WI.ScopeChainDetailsSidebarPanel);
+ let scopeChainDetailsSidebarPanel = this.detailsSidebarPanels.find((item) => item instanceof WI.ScopeChainDetailsSidebarPanel);
+ if (!scopeChainDetailsSidebarPanel)
+ return;
+
let sidebar = scopeChainDetailsSidebarPanel.parentSidebar;
if (!sidebar)
return;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js (224980 => 224981)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js 2017-11-17 21:11:46 UTC (rev 224980)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js 2017-11-17 21:29:43 UTC (rev 224981)
@@ -189,7 +189,7 @@
get detailsSidebarPanels()
{
if (!this._detailsSidebarPanels)
- this._detailsSidebarPanels = this._detailsSidebarPanelConstructors.map(constructor => WI.instanceForClass(constructor));
+ this._detailsSidebarPanels = this._detailsSidebarPanelConstructors.map((constructor) => new constructor);
return this._detailsSidebarPanels;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes