Title: [225280] trunk/Source/WebInspectorUI
Revision
225280
Author
joep...@webkit.org
Date
2017-11-29 11:07:11 -0800 (Wed, 29 Nov 2017)

Log Message

Web Inspector: Console Tab navigation bar sometimes does not include filter bar, clear console sometimes does not work
https://bugs.webkit.org/show_bug.cgi?id=180124
<rdar://problem/35740353>

Reviewed by Brian Burg.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.closed):
Avoid removing event listeners if this LogContentView singleton is ever closed.
The singleton will always be alive so we don't want to remove the event listeners
without a way to add them back.

* UserInterface/Base/Main.js:
(WI.showSplitConsole):
* UserInterface/Views/ConsoleTabContentView.js:
(WI.ConsoleTabContentView.prototype.shown):
When showing the ConsoleTab immediately collapse the split console so that any
following code that checks WI.isShowingSplitConsole will get the expected value.
It is also now possible to share a ContentView across ContentBrowsers via
tombstones, so remove the old code that would frequently close the LogContentView.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (225279 => 225280)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-11-29 19:05:10 UTC (rev 225279)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-11-29 19:07:11 UTC (rev 225280)
@@ -1,3 +1,26 @@
+2017-11-29  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Console Tab navigation bar sometimes does not include filter bar, clear console sometimes does not work
+        https://bugs.webkit.org/show_bug.cgi?id=180124
+        <rdar://problem/35740353>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/LogContentView.js:
+        (WI.LogContentView.prototype.closed):
+        Avoid removing event listeners if this LogContentView singleton is ever closed.
+        The singleton will always be alive so we don't want to remove the event listeners
+        without a way to add them back.
+
+        * UserInterface/Base/Main.js:
+        (WI.showSplitConsole):
+        * UserInterface/Views/ConsoleTabContentView.js:
+        (WI.ConsoleTabContentView.prototype.shown):
+        When showing the ConsoleTab immediately collapse the split console so that any
+        following code that checks WI.isShowingSplitConsole will get the expected value.
+        It is also now possible to share a ContentView across ContentBrowsers via
+        tombstones, so remove the old code that would frequently close the LogContentView.
+
 2017-11-28  Devin Rousso  <web...@devinrousso.com>
 
         Web Inspector: remove extra space before call frames in Canvas backtraces

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (225279 => 225280)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-11-29 19:05:10 UTC (rev 225279)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-11-29 19:07:11 UTC (rev 225280)
@@ -886,10 +886,6 @@
     if (this.consoleDrawer.currentContentView === this.consoleContentView)
         return;
 
-    // Be sure to close the view in the tab content browser before showing it in the
-    // split content browser. We can only show a content view in one browser at a time.
-    if (this.consoleContentView.parentContainer)
-        this.consoleContentView.parentContainer.closeContentView(this.consoleContentView);
     this.consoleDrawer.showContentView(this.consoleContentView);
 };
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleTabContentView.js (225279 => 225280)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleTabContentView.js	2017-11-29 19:05:10 UTC (rev 225279)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleTabContentView.js	2017-11-29 19:07:11 UTC (rev 225280)
@@ -52,18 +52,13 @@
     {
         super.shown();
 
-        WI.consoleContentView.prompt.focus();
+        WI.hideSplitConsole();
 
-        if (this.contentBrowser.currentContentView === WI.consoleContentView)
-            return;
+        this.contentBrowser.showContentView(WI.consoleContentView);
+        WI.consoleContentView.dispatchEventToListeners(WI.ContentView.Event.NavigationItemsDidChange);
 
-        // Be sure to close the view in the split content browser before showing it in the
-        // tab content browser. We can only show a content view in one browser at a time.
-        if (WI.consoleContentView.parentContainer)
-            WI.consoleContentView.parentContainer.closeContentView(WI.consoleContentView);
+        WI.consoleContentView.prompt.focus();
 
-        this.contentBrowser.showContentView(WI.consoleContentView);
-
         console.assert(this.contentBrowser.currentContentView === WI.consoleContentView);
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js (225279 => 225280)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js	2017-11-29 19:05:10 UTC (rev 225279)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js	2017-11-29 19:07:11 UTC (rev 225280)
@@ -170,8 +170,10 @@
 
     closed()
     {
-        WI.logManager.removeEventListener(null, null, this);
-        WI.Frame.removeEventListener(null, null, this);
+        // While it may be possible to get here, this is a singleton ContentView instance
+        // that is often re-inserted back into different ContentBrowsers, so we shouldn't
+        // remove the event listeners. The singleton will never go away anyways.
+        console.assert(this === WI.consoleContentView);
 
         super.closed();
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to