Title: [86660] trunk
Revision
86660
Author
[email protected]
Date
2011-05-17 01:59:56 -0700 (Tue, 17 May 2011)

Log Message

2011-05-17  Pavel Podivilov  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: merge ConsoleView into ConsolePanel.
        https://bugs.webkit.org/show_bug.cgi?id=54670

        * http/tests/inspector/change-iframe-src.html:
        * http/tests/inspector/console-resource-errors.html:
        * http/tests/inspector/inspector-test.js:
        (initialize_InspectorTest.InspectorTest.evaluateInConsole):
        (initialize_InspectorTest.InspectorTest.waitUntilConsoleMessageAdded):
        * http/tests/inspector/network/network-size-chunked.html:
        * http/tests/inspector/network/network-size-sync.html:
        * http/tests/inspector/network/network-size.html:
        * http/tests/inspector/network/network-timing.html:
        * http/tests/inspector/resource-tree/resource-tree-frame-add.html:
        * http/tests/inspector/resource-tree/resource-tree-frame-navigate.html:
        * inspector/console/console-assert.html:
        * inspector/console/console-trace-in-eval.html:
        * inspector/console/console-trace.html:
        * inspector/console/console-uncaught-exception.html:
        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
        * inspector/styles/styles-iframe.html:
        * inspector/timeline/timeline-network-resource.html:
        * inspector/timeline/timeline-script-tag-1.html:
        * inspector/timeline/timeline-script-tag-2.html:
2011-05-17  Pavel Podivilov  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: merge ConsoleView into ConsolePanel.
        https://bugs.webkit.org/show_bug.cgi?id=54670

        Console view in drawer looks exactly the same as console panel. Merging ConsoleView and ConsolePanel together
        will allow us to reuse panel's functionality (e.g. resizable sidebar) even when console is docked.

        * inspector/front-end/ConsoleView.js:
        (WebInspector.ConsolePanel.prototype.get toolbarItemLabel):
        (WebInspector.ConsolePanel.prototype.show):
        (WebInspector.ConsolePanel.prototype.hide):
        (WebInspector.ConsolePanel.prototype.showInDrawer):
        (WebInspector.ConsolePanel.prototype.afterShowInDrawer):
        (WebInspector.ConsolePanel.prototype.hideInDrawer):
        (WebInspector.ConsolePanel.prototype.addMessage):
        (WebInspector.ConsolePanel.prototype.clearMessages):
        * inspector/front-end/DebuggerPresentationModel.js:
        (WebInspector.DebuggerPresentationModel):
        * inspector/front-end/Drawer.js:
        (WebInspector.Drawer.prototype.set visibleView):
        (WebInspector.Drawer.prototype.show.animationFinished):
        (WebInspector.Drawer.prototype.show):
        * inspector/front-end/Panel.js:
        (WebInspector.Panel):
        * inspector/front-end/ResourceTreeModel.js:
        (WebInspector.ResourceTreeModel):
        * inspector/front-end/inspector.html:
        * inspector/front-end/inspector.js:
        (WebInspector._createPanels):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (86659 => 86660)


--- trunk/LayoutTests/ChangeLog	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/ChangeLog	2011-05-17 08:59:56 UTC (rev 86660)
@@ -1,3 +1,31 @@
+2011-05-17  Pavel Podivilov  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: merge ConsoleView into ConsolePanel.
+        https://bugs.webkit.org/show_bug.cgi?id=54670
+
+        * http/tests/inspector/change-iframe-src.html:
+        * http/tests/inspector/console-resource-errors.html:
+        * http/tests/inspector/inspector-test.js:
+        (initialize_InspectorTest.InspectorTest.evaluateInConsole):
+        (initialize_InspectorTest.InspectorTest.waitUntilConsoleMessageAdded):
+        * http/tests/inspector/network/network-size-chunked.html:
+        * http/tests/inspector/network/network-size-sync.html:
+        * http/tests/inspector/network/network-size.html:
+        * http/tests/inspector/network/network-timing.html:
+        * http/tests/inspector/resource-tree/resource-tree-frame-add.html:
+        * http/tests/inspector/resource-tree/resource-tree-frame-navigate.html:
+        * inspector/console/console-assert.html:
+        * inspector/console/console-trace-in-eval.html:
+        * inspector/console/console-trace.html:
+        * inspector/console/console-uncaught-exception.html:
+        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
+        * inspector/styles/styles-iframe.html:
+        * inspector/timeline/timeline-network-resource.html:
+        * inspector/timeline/timeline-script-tag-1.html:
+        * inspector/timeline/timeline-script-tag-2.html:
+
 2011-05-16  Yuta Kitamura  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/LayoutTests/http/tests/inspector/change-iframe-src.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/change-iframe-src.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/change-iframe-src.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -21,7 +21,7 @@
     function step1(node)
     {
         node.setAttribute("src", "src=""
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
     }
 
     function step2()

Modified: trunk/LayoutTests/http/tests/inspector/console-resource-errors.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/console-resource-errors.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/console-resource-errors.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -27,7 +27,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", addMessage, true);
+    InspectorTest.waitUntilConsoleMessageAdded(addMessage, true);
 
     var messageCount = 0;
     function addMessage(message)

Modified: trunk/LayoutTests/http/tests/inspector/inspector-test.js (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -26,7 +26,7 @@
     var event = document.createEvent("KeyboardEvent");
     event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
     WebInspector.console.promptElement.dispatchEvent(event);
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
+    InspectorTest.waitUntilConsoleMessageAdded(
         function(commandResult) {
             callback(commandResult.toMessageElement().textContent);
         });
@@ -44,6 +44,11 @@
     InspectorTest.evaluateInConsole(code, mycallback);
 }
 
+InspectorTest.waitUntilConsoleMessageAdded = function(callback, sticky)
+{
+    InspectorTest.addSniffer(WebInspector.ConsolePanel.prototype, "addMessage", callback, sticky);
+}
+
 InspectorTest.evaluateInPage = function(code, callback)
 {
     callback = InspectorTest.safeWrap(callback);

Modified: trunk/LayoutTests/http/tests/inspector/network/network-size-chunked.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/network/network-size-chunked.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/network/network-size-chunked.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -17,7 +17,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+    InspectorTest.waitUntilConsoleMessageAdded(step2);
     InspectorTest.evaluateInPage("loadImages()");
 
     function step2()

Modified: trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -21,7 +21,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+    InspectorTest.waitUntilConsoleMessageAdded(step2);
     InspectorTest.evaluateInPage("loadData()");
 
     function step2()

Modified: trunk/LayoutTests/http/tests/inspector/network/network-size.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/network/network-size.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/network/network-size.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -25,7 +25,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+    InspectorTest.waitUntilConsoleMessageAdded(step2);
     InspectorTest.evaluateInPage("loadImages()");
 
     function step2()

Modified: trunk/LayoutTests/http/tests/inspector/network/network-timing.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/network/network-timing.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/network/network-timing.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -24,7 +24,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+    InspectorTest.waitUntilConsoleMessageAdded(step2);
     InspectorTest.evaluateInPage("loadScripts()");
 
     function step2()

Modified: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-add.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-add.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-add.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -30,7 +30,7 @@
         InspectorTest.addResult("Before addition");
         InspectorTest.addResult("====================================");
         InspectorTest.dumpResourceTreeEverything();
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
         InspectorTest.evaluateInPage("createIframe()");
     }
 

Modified: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-navigate.html (86659 => 86660)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-navigate.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-navigate.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -31,7 +31,7 @@
         InspectorTest.addResult("Before navigation");
         InspectorTest.addResult("====================================");
         InspectorTest.dumpResourceTreeEverything();
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
         InspectorTest.evaluateInPage("navigateIframe()");
     }
 

Modified: trunk/LayoutTests/inspector/console/console-assert.html (86659 => 86660)


--- trunk/LayoutTests/inspector/console/console-assert.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/console/console-assert.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -27,7 +27,7 @@
         }
     }
     InspectorTest.evaluateInPage("setTimeout(a, 0)");
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback, true);
+    InspectorTest.waitUntilConsoleMessageAdded(callback, true);
 }
 
 </script>

Modified: trunk/LayoutTests/inspector/console/console-trace-in-eval.html (86659 => 86660)


--- trunk/LayoutTests/inspector/console/console-trace-in-eval.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/console/console-trace-in-eval.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -35,7 +35,7 @@
         InspectorTest.completeTest();
     }
     InspectorTest.evaluateInPage("doEvalSource()");
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+    InspectorTest.waitUntilConsoleMessageAdded(callback);
 }
 
 </script>

Modified: trunk/LayoutTests/inspector/console/console-trace.html (86659 => 86660)


--- trunk/LayoutTests/inspector/console/console-trace.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/console/console-trace.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -22,7 +22,7 @@
         InspectorTest.completeTest();
     }
     InspectorTest.evaluateInPage("setTimeout(a, 0)");
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+    InspectorTest.waitUntilConsoleMessageAdded(callback);
 }
 
 </script>

Modified: trunk/LayoutTests/inspector/console/console-uncaught-exception.html (86659 => 86660)


--- trunk/LayoutTests/inspector/console/console-uncaught-exception.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/console/console-uncaught-exception.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -6,7 +6,7 @@
 
 function test()
 {
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", addMessage, true);
+    InspectorTest.waitUntilConsoleMessageAdded(addMessage, true);
     InspectorTest.evaluateInPage("loadIframe()");
     function addMessage(message)
     {

Modified: trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html (86659 => 86660)


--- trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -19,7 +19,7 @@
     function step1()
     {
         DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
         InspectorTest.evaluateInPage("loadIframe()");
     }
 

Modified: trunk/LayoutTests/inspector/styles/styles-iframe.html (86659 => 86660)


--- trunk/LayoutTests/inspector/styles/styles-iframe.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/styles/styles-iframe.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -19,7 +19,7 @@
 function test()
 {
     InspectorTest.evaluateInPage("loadIframe()");
-    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step0);
+    InspectorTest.waitUntilConsoleMessageAdded(step0);
 
     function step0()
     {

Modified: trunk/LayoutTests/inspector/timeline/timeline-network-resource.html (86659 => 86660)


--- trunk/LayoutTests/inspector/timeline/timeline-network-resource.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/timeline/timeline-network-resource.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -23,7 +23,7 @@
     function step1()
     {
         InspectorTest.evaluateInPage("performActions()");
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
     }
 
     function step2()

Modified: trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html (86659 => 86660)


--- trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -16,7 +16,7 @@
     InspectorTest.startTimeline(step1);
     function step1()
     {
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
         InspectorTest.evaluateInPage("performActions()");
     }
 

Modified: trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html (86659 => 86660)


--- trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -16,7 +16,7 @@
     InspectorTest.startTimeline(step1);
     function step1()
     {
-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.waitUntilConsoleMessageAdded(step2);
         InspectorTest.evaluateInPage("performActions()");
     }
 

Modified: trunk/Source/WebCore/ChangeLog (86659 => 86660)


--- trunk/Source/WebCore/ChangeLog	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/ChangeLog	2011-05-17 08:59:56 UTC (rev 86660)
@@ -1,3 +1,36 @@
+2011-05-17  Pavel Podivilov  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: merge ConsoleView into ConsolePanel.
+        https://bugs.webkit.org/show_bug.cgi?id=54670
+
+        Console view in drawer looks exactly the same as console panel. Merging ConsoleView and ConsolePanel together
+        will allow us to reuse panel's functionality (e.g. resizable sidebar) even when console is docked.
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsolePanel.prototype.get toolbarItemLabel):
+        (WebInspector.ConsolePanel.prototype.show):
+        (WebInspector.ConsolePanel.prototype.hide):
+        (WebInspector.ConsolePanel.prototype.showInDrawer):
+        (WebInspector.ConsolePanel.prototype.afterShowInDrawer):
+        (WebInspector.ConsolePanel.prototype.hideInDrawer):
+        (WebInspector.ConsolePanel.prototype.addMessage):
+        (WebInspector.ConsolePanel.prototype.clearMessages):
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel):
+        * inspector/front-end/Drawer.js:
+        (WebInspector.Drawer.prototype.set visibleView):
+        (WebInspector.Drawer.prototype.show.animationFinished):
+        (WebInspector.Drawer.prototype.show):
+        * inspector/front-end/Panel.js:
+        (WebInspector.Panel):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel):
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._createPanels):
+
 2011-05-16  Yuta Kitamura  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -29,9 +29,9 @@
 
 const ExpressionStopCharacters = " =:[({;,!+-*/&|^<>";
 
-WebInspector.ConsoleView = function(drawer)
+WebInspector.ConsolePanel = function(drawer)
 {
-    WebInspector.View.call(this, document.getElementById("console-view"));
+    WebInspector.Panel.call(this, "console", document.getElementById("console-view"));
 
     this.messages = [];
     this.drawer = drawer;
@@ -101,13 +101,13 @@
     this._registerConsoleDomainDispatcher();
 }
 
-WebInspector.ConsoleView.Events = {
+WebInspector.ConsolePanel.Events = {
   ConsoleCleared: "console-cleared",
   EntryAdded: "console-entry-added",
   MessageAdded: "console-message-added"
 }
 
-WebInspector.ConsoleView.prototype = {
+WebInspector.ConsolePanel.prototype = {
     _registerConsoleDomainDispatcher: function() {
         var console = this;
         var dispatcher = {
@@ -242,20 +242,73 @@
         statusBarElement.appendChild(this.filterBarElement);
     },
 
+    get toolbarItemLabel()
+    {
+        return WebInspector.UIString("Console");
+    },
+
     show: function()
     {
+        WebInspector.Panel.prototype.show.call(this);
+
+        this._previousConsoleState = WebInspector.drawer.state;
+        WebInspector.drawer.enterPanelMode();
+        WebInspector.showConsole();
+
+        // Move the scope bar to the top of the messages, like the resources filter.
+        var scopeBar = document.getElementById("console-filter");
+        var consoleMessages = document.getElementById("console-messages");
+
+        scopeBar.parentNode.removeChild(scopeBar);
+        document.getElementById("console-view").insertBefore(scopeBar, consoleMessages);
+
+        // Update styles, and give console-messages a top margin so it doesn't overwrite the scope bar.
+        scopeBar.addStyleClass("console-filter-top");
+        scopeBar.removeStyleClass("status-bar-item");
+
+        consoleMessages.addStyleClass("console-filter-top");
+    },
+
+    hide: function()
+    {
+        if (this._previousConsoleState === WebInspector.Drawer.State.Hidden) {
+            WebInspector.Panel.prototype.hide.call(this);
+            WebInspector.drawer.immediatelyExitPanelMode();
+        } else {
+            if ("_toolbarItem" in this)
+                this._toolbarItem.removeStyleClass("toggled-on");
+            WebInspector.drawer.exitPanelMode();
+        }
+        delete this._previousConsoleState;
+
+        // Move the scope bar back to the bottom bar, next to Clear Console.
+        var scopeBar = document.getElementById("console-filter");
+
+        scopeBar.parentNode.removeChild(scopeBar);
+        document.getElementById("other-drawer-status-bar-items").appendChild(scopeBar);
+
+        // Update styles, and remove the top margin on console-messages.
+        scopeBar.removeStyleClass("console-filter-top");
+        scopeBar.addStyleClass("status-bar-item");
+
+        document.getElementById("console-messages").removeStyleClass("console-filter-top");
+    },
+
+    showInDrawer: function()
+    {
+        WebInspector.View.prototype.show.call(this);
         this.toggleConsoleButton.addStyleClass("toggled-on");
         this.toggleConsoleButton.title = WebInspector.UIString("Hide console.");
         if (!this.prompt.isCaretInsidePrompt())
             this.prompt.moveCaretToEndOfPrompt();
     },
 
-    afterShow: function()
+    afterShowInDrawer: function()
     {
         WebInspector.currentFocusElement = this.promptElement;
     },
 
-    hide: function()
+    hideInDrawer: function()
     {
         this.toggleConsoleButton.removeStyleClass("toggled-on");
         this.toggleConsoleButton.title = WebInspector.UIString("Show console.");
@@ -280,7 +333,7 @@
 
         if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {
             this._incrementErrorWarningCount(msg);
-            this.dispatchEventToListeners(WebInspector.ConsoleView.Events.MessageAdded, msg);
+            this.dispatchEventToListeners(WebInspector.ConsolePanel.Events.MessageAdded, msg);
             this.commandSincePreviousMessage = false;
             this.previousMessage = msg;
         } else if (msg instanceof WebInspector.ConsoleCommand) {
@@ -309,7 +362,7 @@
         if (shouldScrollToLastMessage || (msg instanceof WebInspector.ConsoleCommandResult))
             this._scheduleScrollIntoView();
 
-        this.dispatchEventToListeners(WebInspector.ConsoleView.Events.EntryAdded, msg);
+        this.dispatchEventToListeners(WebInspector.ConsolePanel.Events.EntryAdded, msg);
     },
 
     _incrementErrorWarningCount: function(msg)
@@ -331,7 +384,7 @@
 
     clearMessages: function()
     {
-        this.dispatchEventToListeners(WebInspector.ConsoleView.Events.ConsoleCleared);
+        this.dispatchEventToListeners(WebInspector.ConsolePanel.Events.ConsoleCleared);
 
         this.messages = [];
 
@@ -677,7 +730,7 @@
     }
 }
 
-WebInspector.ConsoleView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.ConsolePanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
 WebInspector.ConsoleMessage = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, requestId)
 {

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -46,8 +46,8 @@
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Reset, this._debuggerReset, this);
 
-    WebInspector.console.addEventListener(WebInspector.ConsoleView.Events.MessageAdded, this._consoleMessageAdded, this);
-    WebInspector.console.addEventListener(WebInspector.ConsoleView.Events.ConsoleCleared, this._consoleCleared, this);
+    WebInspector.console.addEventListener(WebInspector.ConsolePanel.Events.MessageAdded, this._consoleMessageAdded, this);
+    WebInspector.console.addEventListener(WebInspector.ConsolePanel.Events.ConsoleCleared, this._consoleCleared, this);
 
     new WebInspector.DebuggerPresentationModelResourceBinding(this);
 }

Modified: trunk/Source/WebCore/inspector/front-end/Drawer.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/Drawer.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/Drawer.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -61,7 +61,7 @@
 
         var firstTime = !this._visibleView;
         if (this._visibleView)
-            this._visibleView.hide();
+            this._visibleView.hideInDrawer();
 
         this._visibleView = x;
 
@@ -69,7 +69,7 @@
             this._safelyRemoveChildren();
             this._viewStatusBar.removeChildren(); // optimize this? call old.detach()
             x.attach(this.element, this._viewStatusBar);
-            x.show();
+            x.showInDrawer();
             this.visible = true;
         }
     },
@@ -92,7 +92,7 @@
             return;
 
         if (this.visibleView)
-            this.visibleView.show();
+            this.visibleView.showInDrawer();
 
         WebInspector.View.prototype.show.call(this);
 
@@ -124,8 +124,8 @@
         {
             if ("updateStatusBarItems" in WebInspector.currentPanel)
                 WebInspector.currentPanel.updateStatusBarItems();
-            if (this.visibleView.afterShow)
-                this.visibleView.afterShow();
+            if (this.visibleView.afterShowInDrawer)
+                this.visibleView.afterShowInDrawer();
             delete this._animating;
             delete this._currentAnimation;
             this.state = (this.fullPanel ? WebInspector.Drawer.State.Full : WebInspector.Drawer.State.Variable);
@@ -144,7 +144,7 @@
         WebInspector.View.prototype.hide.call(this);
 
         if (this.visibleView)
-            this.visibleView.hide();
+            this.visibleView.hideInDrawer();
 
         this._animating = true;
 

Modified: trunk/Source/WebCore/inspector/front-end/Panel.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/Panel.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/Panel.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -26,9 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.Panel = function(name)
+WebInspector.Panel = function(name, element)
 {
-    WebInspector.View.call(this);
+    WebInspector.View.call(this, element);
 
     this.element.addStyleClass("panel");
     this.element.addStyleClass(name);

Modified: trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -35,8 +35,8 @@
     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);
     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);
 
-    WebInspector.console.addEventListener(WebInspector.ConsoleView.Events.MessageAdded, this._consoleMessageAdded, this);
-    WebInspector.console.addEventListener(WebInspector.ConsoleView.Events.ConsoleCleared, this._consoleCleared, this);
+    WebInspector.console.addEventListener(WebInspector.ConsolePanel.Events.MessageAdded, this._consoleMessageAdded, this);
+    WebInspector.console.addEventListener(WebInspector.ConsolePanel.Events.ConsoleCleared, this._consoleCleared, this);
 
     this.frontendReused();
     InspectorBackend.registerDomainDispatcher("Page", new WebInspector.PageDispatcher(this));

Modified: trunk/Source/WebCore/inspector/front-end/inspector.html (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/inspector.html	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/inspector.html	2011-05-17 08:59:56 UTC (rev 86660)
@@ -57,7 +57,6 @@
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
-    <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""    
     <script type="text/_javascript_" src=""
@@ -107,7 +106,7 @@
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
-    <script type="text/_javascript_" src=""
+    <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (86659 => 86660)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2011-05-17 07:37:11 UTC (rev 86659)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2011-05-17 08:59:56 UTC (rev 86660)
@@ -151,14 +151,13 @@
         }
     },
 
-    _createPanels: function()
+    _createPanels: function(hiddenPanels)
     {
         if (WebInspector.WorkerManager.isWorkerFrontend()) {
             this.panels.scripts = new WebInspector.ScriptsPanel();
             this.panels.console = new WebInspector.ConsolePanel();
             return;
         }
-        var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
         if (hiddenPanels.indexOf("elements") === -1)
             this.panels.elements = new WebInspector.ElementsPanel();
         if (hiddenPanels.indexOf("resources") === -1)
@@ -173,8 +172,6 @@
             this.panels.profiles = new WebInspector.ProfilesPanel();
         if (hiddenPanels.indexOf("audits") === -1)
             this.panels.audits = new WebInspector.AuditsPanel();
-        if (hiddenPanels.indexOf("console") === -1)
-            this.panels.console = new WebInspector.ConsolePanel();
     },
 
     get attached()
@@ -417,7 +414,7 @@
     WebInspector.shortcutsHelp.section(WebInspector.UIString("Elements Panel"));
 
     this.drawer = new WebInspector.Drawer();
-    this.console = new WebInspector.ConsoleView(this.drawer);
+    this.console = new WebInspector.ConsolePanel(this.drawer);
     this.drawer.visibleView = this.console;
     this.networkManager = new WebInspector.NetworkManager();
     this.resourceTreeModel = new WebInspector.ResourceTreeModel();
@@ -442,8 +439,12 @@
     this.searchController = new WebInspector.SearchController();
     this.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane();
 
+    var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
     this.panels = {};
-    this._createPanels();
+    this._createPanels(hiddenPanels);
+    if (hiddenPanels.indexOf("console") === -1)
+        this.panels.console = this.console;
+
     this._panelHistory = new WebInspector.PanelHistory();
     this.toolbar = new WebInspector.Toolbar();
     this.toolbar.attached = WebInspector.attached;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to