[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
joepeck at webkit.org
joepeck at webkit.org
Thu Dec 3 13:41:24 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit b61962c14b63c7f885b755b775d16579d8cf3843
Author: joepeck at webkit.org <joepeck at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 20 19:11:32 2009 +0000
2009-11-19 Joseph Pecoraro <joepeck at webkit.org>
Reviewed by Timothy Hatcher.
Web Inspector: Add Console Only Layout Mode
https://bugs.webkit.org/show_bug.cgi?id=30282
Adds a Console Panel, which allows for a Full size Console. This
extends the Drawer to the size of a Panel. This also fixes previous
resize issues with the Drawer.
* inspector/front-end/ConsolePanel.js: added.
(WebInspector.ConsolePanel):
(WebInspector.ConsolePanel.prototype.toolbarItemClass.get toolbarItemLabel):
(WebInspector.ConsolePanel.prototype.show):
(WebInspector.ConsolePanel.prototype.hide):
* inspector/front-end/Drawer.js:
(WebInspector.Drawer):
(WebInspector.Drawer.prototype.set visibleView):
(WebInspector.Drawer.prototype.get savedHeight): access the saved height of the variable console.
(WebInspector.Drawer.prototype.show.animationFinished):
(WebInspector.Drawer.prototype.show):
(WebInspector.Drawer.prototype.hide.animationFinished):
(WebInspector.Drawer.prototype.hide):
(WebInspector.Drawer.prototype.resize): resize appropriately if full/non-full
(WebInspector.Drawer.prototype.enterPanelMode):
(WebInspector.Drawer.prototype.exitPanelMode):
(WebInspector.Drawer.prototype.immediatelyExitPanelMode):
(WebInspector.Drawer.prototype._cancelAnimationIfNeeded):
(WebInspector.Drawer.prototype._animateDrawerHeight.animationFinished):
(WebInspector.Drawer.prototype._animateDrawerHeight):
(WebInspector.Drawer.prototype._animationDuration):
(WebInspector.Drawer.prototype._startStatusBarDragging):
(WebInspector.Drawer.prototype._statusBarDragging):
(WebInspector.Drawer.prototype._endStatusBarDragging):
Miscellaneous changes and cleanup.
* English.lproj/localizedStrings.js: "Console" toolbar title.
* inspector/front-end/ConsoleView.js: removed unnecessary element reordering
* inspector/front-end/Images/consoleIcon.png: added.
* inspector/front-end/inspector.css: added icon.
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector._createPanels): create console panel
(WebInspector.windowResize): resize drawer if necessary
(WebInspector.documentKeyDown): esc should not toggle the console when in panel mode
(WebInspector.animateStyle): start animation interval, returns the interval key
(WebInspector.toggleAttach): resize drawer if necessary
(WebInspector.showConsolePanel): restore the panel when the inspector restarts
(WebInspector.showProfileForURL): style fix
Restore the panel when the inspector restarts.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setWindowVisible):
(WebCore::InspectorController::specialPanelForJSName):
* inspector/InspectorFrontend.cpp:
(WebCore::InspectorFrontend::showPanel):
Build files.
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/front-end/WebKit.qrc:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 52a1b26..80049e6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,69 @@
+2009-11-19 Joseph Pecoraro <joepeck at webkit.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Add Console Only Layout Mode
+ https://bugs.webkit.org/show_bug.cgi?id=30282
+
+ Adds a Console Panel, which allows for a Full size Console. This
+ extends the Drawer to the size of a Panel. This also fixes previous
+ resize issues with the Drawer.
+
+ * inspector/front-end/ConsolePanel.js: added.
+ (WebInspector.ConsolePanel):
+ (WebInspector.ConsolePanel.prototype.toolbarItemClass.get toolbarItemLabel):
+ (WebInspector.ConsolePanel.prototype.show):
+ (WebInspector.ConsolePanel.prototype.hide):
+ * inspector/front-end/Drawer.js:
+ (WebInspector.Drawer):
+ (WebInspector.Drawer.prototype.set visibleView):
+ (WebInspector.Drawer.prototype.get savedHeight): access the saved height of the variable console.
+ (WebInspector.Drawer.prototype.show.animationFinished):
+ (WebInspector.Drawer.prototype.show):
+ (WebInspector.Drawer.prototype.hide.animationFinished):
+ (WebInspector.Drawer.prototype.hide):
+ (WebInspector.Drawer.prototype.resize): resize appropriately if full/non-full
+ (WebInspector.Drawer.prototype.enterPanelMode):
+ (WebInspector.Drawer.prototype.exitPanelMode):
+ (WebInspector.Drawer.prototype.immediatelyExitPanelMode):
+ (WebInspector.Drawer.prototype._cancelAnimationIfNeeded):
+ (WebInspector.Drawer.prototype._animateDrawerHeight.animationFinished):
+ (WebInspector.Drawer.prototype._animateDrawerHeight):
+ (WebInspector.Drawer.prototype._animationDuration):
+ (WebInspector.Drawer.prototype._startStatusBarDragging):
+ (WebInspector.Drawer.prototype._statusBarDragging):
+ (WebInspector.Drawer.prototype._endStatusBarDragging):
+
+ Miscellaneous changes and cleanup.
+
+ * English.lproj/localizedStrings.js: "Console" toolbar title.
+ * inspector/front-end/ConsoleView.js: removed unnecessary element reordering
+ * inspector/front-end/Images/consoleIcon.png: added.
+ * inspector/front-end/inspector.css: added icon.
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels): create console panel
+ (WebInspector.windowResize): resize drawer if necessary
+ (WebInspector.documentKeyDown): esc should not toggle the console when in panel mode
+ (WebInspector.animateStyle): start animation interval, returns the interval key
+ (WebInspector.toggleAttach): resize drawer if necessary
+ (WebInspector.showConsolePanel): restore the panel when the inspector restarts
+ (WebInspector.showProfileForURL): style fix
+
+ Restore the panel when the inspector restarts.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::setWindowVisible):
+ (WebCore::InspectorController::specialPanelForJSName):
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::showPanel):
+
+ Build files.
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/WebKit.qrc:
+
2009-11-20 Brian Weinstein <bweinstein at apple.com>
Reviewed by Tim Hatcher.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index b6b05c5..ef981c7 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 8c51a60..6c49885 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3616,6 +3616,7 @@
'inspector/front-end/CallStackSidebarPane.js',
'inspector/front-end/ChangesView.js',
'inspector/front-end/Color.js',
+ 'inspector/front-end/ConsolePanel.js',
'inspector/front-end/ConsoleView.js',
'inspector/front-end/CookieItemsView.js',
'inspector/front-end/Database.js',
@@ -3684,6 +3685,7 @@
'inspector/front-end/Images/clearConsoleButtonGlyph.png',
'inspector/front-end/Images/closeButtons.png',
'inspector/front-end/Images/consoleButtonGlyph.png',
+ 'inspector/front-end/Images/consoleIcon.png',
'inspector/front-end/Images/cookie.png',
'inspector/front-end/Images/database.png',
'inspector/front-end/Images/databaseTable.png',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 85c5f6e..591d350 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42282,6 +42282,9 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\ConsolePanel.js"
+ >
+ <File
RelativePath="..\inspector\front-end\ConsoleView.js"
>
</File>
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 920c3f0..52436ee 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -315,10 +315,7 @@ void InspectorController::setWindowVisible(bool visible, bool attached)
setAttachedWindow(attached);
populateScriptObjects();
- // Console panel is implemented as a 'fast view', so there should be
- // real panel opened along with it.
- bool showConsole = m_showAfterVisible == ConsolePanel;
- if (m_showAfterVisible == CurrentPanel || showConsole) {
+ if (m_showAfterVisible == CurrentPanel) {
Setting lastActivePanelSetting = setting(lastActivePanelSettingName);
if (lastActivePanelSetting.type() == Setting::StringType)
m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting.string());
@@ -333,8 +330,6 @@ void InspectorController::setWindowVisible(bool visible, bool attached)
enableDebugger();
#endif
showPanel(m_showAfterVisible);
- if (showConsole)
- showPanel(ConsolePanel);
} else {
#if ENABLE(JAVASCRIPT_DEBUGGER)
// If the window is being closed with the debugger enabled,
@@ -1811,6 +1806,8 @@ InspectorController::SpecialPanels InspectorController::specialPanelForJSName(co
return ProfilesPanel;
else if (panelName == "storage" || panelName == "databases")
return StoragePanel;
+ else if (panelName == "console")
+ return ConsolePanel;
else
return ElementsPanel;
}
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index 6942d02..6e02db1 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -151,7 +151,7 @@ void InspectorFrontend::showPanel(int panel)
const char* showFunctionName;
switch (panel) {
case InspectorController::ConsolePanel:
- showFunctionName = "showConsole";
+ showFunctionName = "showConsolePanel";
break;
case InspectorController::ElementsPanel:
showFunctionName = "showElementsPanel";
diff --git a/WebCore/inspector/front-end/ConsolePanel.js b/WebCore/inspector/front-end/ConsolePanel.js
new file mode 100644
index 0000000..15ec615
--- /dev/null
+++ b/WebCore/inspector/front-end/ConsolePanel.js
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.ConsolePanel = function()
+{
+ WebInspector.Panel.call(this);
+}
+
+WebInspector.ConsolePanel.prototype = {
+ toolbarItemClass: "console",
+
+ get toolbarItemLabel()
+ {
+ return WebInspector.UIString("Console");
+ },
+
+ show: function()
+ {
+ WebInspector.Panel.prototype.show.call(this);
+
+ this._previousConsoleState = WebInspector.drawer.state;
+ WebInspector.drawer.enterPanelMode();
+ WebInspector.showConsole();
+ },
+
+ hide: function()
+ {
+ WebInspector.Panel.prototype.hide.call(this);
+
+ if (this._previousConsoleState === WebInspector.Drawer.State.Hidden)
+ WebInspector.drawer.immediatelyExitPanelMode();
+ else
+ WebInspector.drawer.exitPanelMode();
+ delete this._previousConsoleState;
+ }
+}
+
+WebInspector.ConsolePanel.prototype.__proto__ = WebInspector.Panel.prototype;
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index f97720b..1170b2b 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -57,9 +57,6 @@ WebInspector.ConsoleView = function(drawer)
this.toggleConsoleButton.title = WebInspector.UIString("Show console.");
this.toggleConsoleButton.addEventListener("click", this._toggleConsoleButtonClicked.bind(this), false);
- var anchoredStatusBar = document.getElementById("anchored-status-bar-items");
- anchoredStatusBar.appendChild(this.toggleConsoleButton);
-
// Will hold the list of filter elements
this.filterBarElement = document.getElementById("console-filter");
diff --git a/WebCore/inspector/front-end/Drawer.js b/WebCore/inspector/front-end/Drawer.js
index 1b50f91..0426a39 100644
--- a/WebCore/inspector/front-end/Drawer.js
+++ b/WebCore/inspector/front-end/Drawer.js
@@ -7,13 +7,13 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -31,6 +31,12 @@ WebInspector.Drawer = function()
{
WebInspector.View.call(this, document.getElementById("drawer"));
+ this._savedHeight = 200; // Default.
+ this.state = WebInspector.Drawer.State.Hidden;
+ this.fullPanel = false;
+
+ this.mainElement = document.getElementById("main");
+ this.toolbarElement = document.getElementById("toolbar");
this.mainStatusBar = document.getElementById("main-status-bar");
this.mainStatusBar.addEventListener("mousedown", this._startStatusBarDragging.bind(this), true);
this.viewStatusBar = document.getElementById("other-drawer-status-bar-items");
@@ -45,6 +51,8 @@ WebInspector.Drawer.prototype = {
set visibleView(x)
{
if (this._visibleView === x) {
+ if (this.visible && this.fullPanel)
+ return;
this.visible = !this.visible;
return;
}
@@ -64,6 +72,12 @@ WebInspector.Drawer.prototype = {
}
},
+ get savedHeight()
+ {
+ var height = this._savedHeight || this.element.offsetHeight;
+ return Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - this.mainElement.totalOffsetTop - Preferences.minConsoleHeight);
+ },
+
showView: function(view)
{
if (!this.visible || this.visibleView !== view)
@@ -85,15 +99,16 @@ WebInspector.Drawer.prototype = {
document.body.addStyleClass("drawer-visible");
var anchoredItems = document.getElementById("anchored-status-bar-items");
-
+ var height = (this.fullPanel ? window.innerHeight - this.toolbarElement.offsetHeight : this.savedHeight);
var animations = [
- {element: document.getElementById("main"), end: {bottom: this.element.offsetHeight}},
+ {element: this.element, end: {height: height}},
+ {element: document.getElementById("main"), end: {bottom: height}},
{element: document.getElementById("main-status-bar"), start: {"padding-left": anchoredItems.offsetWidth - 1}, end: {"padding-left": 0}},
{element: document.getElementById("other-drawer-status-bar-items"), start: {opacity: 0}, end: {opacity: 1}}
];
- var consoleStatusBar = document.getElementById("drawer-status-bar");
- consoleStatusBar.insertBefore(anchoredItems, consoleStatusBar.firstChild);
+ var drawerStatusBar = document.getElementById("drawer-status-bar");
+ drawerStatusBar.insertBefore(anchoredItems, drawerStatusBar.firstChild);
function animationFinished()
{
@@ -102,9 +117,11 @@ WebInspector.Drawer.prototype = {
if (this.visibleView.afterShow)
this.visibleView.afterShow();
delete this._animating;
+ delete this._currentAnimationInterval;
+ this.state = (this.fullPanel ? WebInspector.Drawer.State.Full : WebInspector.Drawer.State.Variable);
}
- WebInspector.animateStyle(animations, window.event && window.event.shiftKey ? 2000 : 250, animationFinished.bind(this));
+ this._currentAnimationInterval = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));
},
hide: function()
@@ -113,20 +130,23 @@ WebInspector.Drawer.prototype = {
return;
WebInspector.View.prototype.hide.call(this);
-
+
if (this.visibleView)
this.visibleView.hide();
this._animating = true;
+ if (!this.fullPanel)
+ this._savedHeight = this.element.offsetHeight;
+
if (this.element === WebInspector.currentFocusElement || this.element.isAncestor(WebInspector.currentFocusElement))
WebInspector.currentFocusElement = WebInspector.previousFocusElement;
var anchoredItems = document.getElementById("anchored-status-bar-items");
- // Temporally set properties and classes to mimic the post-animation values so panels
+ // Temporarily set properties and classes to mimic the post-animation values so panels
// like Elements in their updateStatusBarItems call will size things to fit the final location.
- document.getElementById("main-status-bar").style.setProperty("padding-left", (anchoredItems.offsetWidth - 1) + "px");
+ this.mainStatusBar.style.setProperty("padding-left", (anchoredItems.offsetWidth - 1) + "px");
document.body.removeStyleClass("drawer-visible");
if ("updateStatusBarItems" in WebInspector.currentPanel)
WebInspector.currentPanel.updateStatusBarItems();
@@ -145,9 +165,96 @@ WebInspector.Drawer.prototype = {
mainStatusBar.style.removeProperty("padding-left");
document.body.removeStyleClass("drawer-visible");
delete this._animating;
+ delete this._currentAnimationInterval;
+ this.state = WebInspector.Drawer.State.Hidden;
+ }
+
+ this._currentAnimationInterval = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));
+ },
+
+ resize: function()
+ {
+ if (this.state === WebInspector.Drawer.State.Hidden)
+ return;
+
+ var height;
+ var mainElement = document.getElementById("main");
+ if (this.state === WebInspector.Drawer.State.Variable) {
+ height = parseInt(this.element.style.height);
+ height = Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - mainElement.totalOffsetTop - Preferences.minConsoleHeight);
+ } else
+ height = window.innerHeight - this.toolbarElement.offsetHeight;
+
+ mainElement.style.bottom = height + "px";
+ this.element.style.height = height + "px";
+ },
+
+ enterPanelMode: function()
+ {
+ this._cancelAnimationIfNeeded();
+ this.fullPanel = true;
+
+ if (this.visible) {
+ this._savedHeight = this.element.offsetHeight;
+ var height = window.innerHeight - this.toolbarElement.offsetHeight;
+ this._animateDrawerHeight(height, WebInspector.Drawer.State.Full);
+ }
+ },
+
+ exitPanelMode: function()
+ {
+ this._cancelAnimationIfNeeded();
+ this.fullPanel = false;
+
+ if (this.visible) {
+ // If this animation gets cancelled, we want the state of the drawer to be Variable,
+ // so that the new animation can't do an immediate transition between Hidden/Full states.
+ this.state = WebInspector.Drawer.State.Variable;
+ var height = this.savedHeight;
+ this._animateDrawerHeight(height, WebInspector.Drawer.State.Variable);
+ }
+ },
+
+ immediatelyExitPanelMode: function()
+ {
+ this.visible = false;
+ this.fullPanel = false;
+ },
+
+ _cancelAnimationIfNeeded: function()
+ {
+ if (this._animating) {
+ clearInterval(this._currentAnimationInterval);
+ delete this._animating;
+ delete this._currentAnimationInterval;
+ }
+ },
+
+ _animateDrawerHeight: function(height, finalState)
+ {
+ this._animating = true;
+ var animations = [
+ {element: this.element, end: {height: height}},
+ {element: document.getElementById("main"), end: {bottom: height}}
+ ];
+
+ function animationFinished()
+ {
+ delete this._animating;
+ delete this._currentAnimationInterval;
+ this.state = finalState;
}
- WebInspector.animateStyle(animations, window.event && window.event.shiftKey ? 2000 : 250, animationFinished.bind(this));
+ this._currentAnimationInterval = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));
+ },
+
+ _animationDuration: function()
+ {
+ // Immediate if going between Hidden and Full in full panel mode
+ if (this.fullPanel && (this.state === WebInspector.Drawer.State.Hidden || this.state === WebInspector.Drawer.State.Full))
+ return 0;
+
+ return (window.event && window.event.shiftKey ? 2000 : 250);
},
_safelyRemoveChildren: function()
@@ -165,10 +272,10 @@ WebInspector.Drawer.prototype = {
_startStatusBarDragging: function(event)
{
- if (!this.visible || event.target !== document.getElementById("main-status-bar"))
+ if (!this.visible || event.target !== this.mainStatusBar)
return;
- WebInspector.elementDragStart(document.getElementById("main-status-bar"), this._statusBarDragging.bind(this), this._endStatusBarDragging.bind(this), event, "row-resize");
+ WebInspector.elementDragStart(this.mainStatusBar, this._statusBarDragging.bind(this), this._endStatusBarDragging.bind(this), event, "row-resize");
this._statusBarDragOffset = event.pageY - this.element.totalOffsetTop;
@@ -178,7 +285,6 @@ WebInspector.Drawer.prototype = {
_statusBarDragging: function(event)
{
var mainElement = document.getElementById("main");
-
var height = window.innerHeight - event.pageY + this._statusBarDragOffset;
height = Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - mainElement.totalOffsetTop - Preferences.minConsoleHeight);
@@ -193,6 +299,7 @@ WebInspector.Drawer.prototype = {
{
WebInspector.elementDragEnd(event);
+ this._savedHeight = this.element.offsetHeight;
delete this._statusBarDragOffset;
event.stopPropagation();
@@ -200,3 +307,9 @@ WebInspector.Drawer.prototype = {
}
WebInspector.Drawer.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.Drawer.State = {
+ Hidden: 0,
+ Variable: 1,
+ Full: 2
+};
diff --git a/WebCore/inspector/front-end/Images/.DS_Store b/WebCore/inspector/front-end/Images/.DS_Store
new file mode 100644
index 0000000..49cede5
Binary files /dev/null and b/WebCore/inspector/front-end/Images/.DS_Store differ
diff --git a/WebCore/inspector/front-end/Images/consoleIcon.png b/WebCore/inspector/front-end/Images/consoleIcon.png
new file mode 100644
index 0000000..94ffa95
Binary files /dev/null and b/WebCore/inspector/front-end/Images/consoleIcon.png differ
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 53917f6..dbf406c 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -9,6 +9,7 @@
<file>CallStackSidebarPane.js</file>
<file>ChangesView.js</file>
<file>Color.js</file>
+ <file>ConsolePanel.js</file>
<file>ConsoleView.js</file>
<file>CookieItemsView.js</file>
<file>Database.js</file>
@@ -75,6 +76,7 @@
<file>Images/closeButtons.png</file>
<file>Images/consoleButtonGlyph.png</file>
<file>Images/cookie.png</file>
+ <file>Images/consoleIcon.png</file>
<file>Images/database.png</file>
<file>Images/databaseTable.png</file>
<file>Images/debuggerContinue.png</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 035dc13..50e7ef6 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -215,6 +215,10 @@ body.attached #search-results-matches {
background-image: url(Images/profilesIcon.png);
}
+.toolbar-item.console .toolbar-icon {
+ background-image: url(Images/consoleIcon.png);
+}
+
#close-button-left, #close-button-right {
width: 14px;
height: 14px;
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index a609f89..489996c 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -79,6 +79,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ScriptsPanel.js"></script>
<script type="text/javascript" src="StoragePanel.js"></script>
<script type="text/javascript" src="ProfilesPanel.js"></script>
+ <script type="text/javascript" src="ConsolePanel.js"></script>
<script type="text/javascript" src="ResourceView.js"></script>
<script type="text/javascript" src="SourceFrame.js"></script>
<script type="text/javascript" src="SourceView.js"></script>
@@ -108,7 +109,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
<div id="main">
<div id="main-panels" tabindex="0" spellcheck="false"></div>
- <div id="main-status-bar" class="status-bar"><div id="anchored-status-bar-items"><button id="dock-status-bar-item" class="status-bar-item toggled"><div class="glyph"></div><div class="glyph shadow"></div></button><button id="console-status-bar-item" class="status-bar-item"><div class="glyph"></div><div class="glyph shadow"></div></button><button id="changes-status-bar-item" class="status-bar-item hidden"></button><div id="count-items"><div id="changes-count" class="hidden"></div><div id="error-warning-count" class="hidden"></div></div></div></div>
+ <div id="main-status-bar" class="status-bar"><div id="anchored-status-bar-items"><button id="dock-status-bar-item" class="status-bar-item"><div class="glyph"></div><div class="glyph shadow"></div></button><button id="console-status-bar-item" class="status-bar-item"><div class="glyph"></div><div class="glyph shadow"></div></button><button id="changes-status-bar-item" class="status-bar-item hidden"></button><div id="count-items"><div id="changes-count" class="hidden"></div><div id="error-warning-count" class="hidden"></div></div></div></div>
</div>
<div id="drawer">
<div id="console-view"><div id="console-messages"><div id="console-prompt" spellcheck="false"><br></div></div></div>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index c38583a..e62d6c2 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -72,20 +72,21 @@ var WebInspector = {
resourceURLMap: {},
cookieDomains: {},
missingLocalizedStrings: {},
-
+ pendingDispatches: 0,
+
get platform()
{
if (!("_platform" in this))
this._platform = InspectorController.platform();
-
+
return this._platform;
},
-
+
get port()
{
if (!("_port" in this))
this._port = InspectorController.port();
-
+
return this._port;
},
@@ -186,6 +187,8 @@ var WebInspector = {
if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
this.panels.storage = new WebInspector.StoragePanel();
+ if (hiddenPanels.indexOf("console") === -1)
+ this.panels.console = new WebInspector.ConsolePanel();
},
_loadPreferences: function()
@@ -412,7 +415,6 @@ WebInspector.loaded = function()
document.body.addStyleClass("port-" + port);
this._loadPreferences();
- this.pendingDispatches = 0;
this.drawer = new WebInspector.Drawer();
this.console = new WebInspector.ConsoleView(this.drawer);
@@ -551,6 +553,7 @@ WebInspector.windowResize = function(event)
{
if (this.currentPanel && this.currentPanel.resize)
this.currentPanel.resize();
+ this.drawer.resize();
}
WebInspector.windowFocused = function(event)
@@ -640,8 +643,11 @@ WebInspector.documentKeyDown = function(event)
switch (event.keyIdentifier) {
case "U+001B": // Escape key
- this.drawer.visible = !this.drawer.visible;
event.preventDefault();
+ if (this.drawer.fullPanel)
+ return;
+
+ this.drawer.visible = !this.drawer.visible;
break;
case "U+0046": // F key
@@ -765,29 +771,31 @@ WebInspector.mainCopy = function(event)
this.currentPanel.handleCopyEvent(event);
}
-WebInspector.animateStyle = function(animations, duration, callback, complete)
+WebInspector.animateStyle = function(animations, duration, callback)
{
- if (complete === undefined)
- complete = 0;
- var slice = (1000 / 30); // 30 frames per second
+ var interval;
+ var complete = 0;
+
+ const intervalDuration = (1000 / 30); // 30 frames per second.
+ const animationsLength = animations.length;
+ const propertyUnit = {opacity: ""};
+ const defaultUnit = "px";
- var defaultUnit = "px";
- var propertyUnit = {opacity: ""};
+ function cubicInOut(t, b, c, d)
+ {
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
+ return c/2*((t-=2)*t*t + 2) + b;
+ }
- for (var i = 0; i < animations.length; ++i) {
+ // Pre-process animations.
+ for (var i = 0; i < animationsLength; ++i) {
var animation = animations[i];
- var element = null;
- var start = null;
- var current = null;
- var end = null;
- var key = null;
+ var element = null, start = null, end = null, key = null;
for (key in animation) {
if (key === "element")
element = animation[key];
else if (key === "start")
start = animation[key];
- else if (key === "current")
- current = animation[key];
else if (key === "end")
end = animation[key];
}
@@ -795,49 +803,54 @@ WebInspector.animateStyle = function(animations, duration, callback, complete)
if (!element || !end)
continue;
- var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element);
if (!start) {
+ var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element);
start = {};
for (key in end)
start[key] = parseInt(computedStyle.getPropertyValue(key));
animation.start = start;
- } else if (complete == 0)
+ } else
for (key in start)
element.style.setProperty(key, start[key] + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ }
- if (!current) {
- current = {};
- for (key in start)
- current[key] = start[key];
- animation.current = current;
- }
-
- function cubicInOut(t, b, c, d)
- {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
+ function animateLoop()
+ {
+ // Advance forward.
+ complete += intervalDuration;
+ var next = complete + intervalDuration;
+
+ // Make style changes.
+ for (var i = 0; i < animationsLength; ++i) {
+ var animation = animations[i];
+ var element = animation.element;
+ var start = animation.start;
+ var end = animation.end;
+ if (!element || !end)
+ continue;
+
+ var style = element.style;
+ for (key in end) {
+ var endValue = end[key];
+ if (next < duration) {
+ var startValue = start[key];
+ var newValue = cubicInOut(complete, startValue, endValue - startValue, duration);
+ style.setProperty(key, newValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ } else
+ style.setProperty(key, endValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ }
}
- var style = element.style;
- for (key in end) {
- var startValue = start[key];
- var currentValue = current[key];
- var endValue = end[key];
- if ((complete + slice) < duration) {
- var delta = (endValue - startValue) / (duration / slice);
- var newValue = cubicInOut(complete, startValue, endValue - startValue, duration);
- style.setProperty(key, newValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
- current[key] = newValue;
- } else {
- style.setProperty(key, endValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
- }
+ // End condition.
+ if (complete >= duration) {
+ clearInterval(interval);
+ if (callback)
+ callback();
}
}
- if (complete < duration)
- setTimeout(WebInspector.animateStyle, slice, animations, duration, callback, complete + slice);
- else if (callback)
- callback();
+ interval = setInterval(animateLoop, intervalDuration);
+ return interval;
}
WebInspector.updateSearchLabel = function()
@@ -857,6 +870,7 @@ WebInspector.updateSearchLabel = function()
WebInspector.toggleAttach = function()
{
this.attached = !this.attached;
+ this.drawer.resize();
}
WebInspector.toolbarDragStart = function(event)
@@ -980,6 +994,11 @@ WebInspector.showStoragePanel = function()
this.currentPanel = this.panels.storage;
}
+WebInspector.showConsolePanel = function()
+{
+ this.currentPanel = this.panels.console;
+}
+
WebInspector.addResource = function(identifier, payload)
{
var resource = new WebInspector.Resource(
@@ -1070,7 +1089,7 @@ WebInspector.updateResource = function(identifier, payload)
resource.responseReceivedTime = payload.responseReceivedTime;
if (payload.endTime)
resource.endTime = payload.endTime;
-
+
if (payload.loadEventTime) {
// This loadEventTime is for the main resource, and we want to show it
// for all resources on this page. This means we want to set it as a member
@@ -1078,7 +1097,7 @@ WebInspector.updateResource = function(identifier, payload)
if (this.panels.resources)
this.panels.resources.mainResourceLoadTime = payload.loadEventTime;
}
-
+
if (payload.domContentEventTime) {
// This domContentEventTime is for the main resource, so it should go in
// the resources panel for the same reasons as above.
@@ -1264,23 +1283,23 @@ WebInspector.log = function(message)
{
// remember 'this' for setInterval() callback
var self = this;
-
+
// return indication if we can actually log a message
function isLogAvailable()
{
return WebInspector.ConsoleMessage && WebInspector.ObjectProxy && self.console;
}
-
+
// flush the queue of pending messages
function flushQueue()
{
var queued = WebInspector.log.queued;
- if (!queued)
+ if (!queued)
return;
-
+
for (var i = 0; i < queued.length; ++i)
logMessage(queued[i]);
-
+
delete WebInspector.log.queued;
}
@@ -1290,26 +1309,26 @@ WebInspector.log = function(message)
{
if (!isLogAvailable())
return;
-
+
clearInterval(WebInspector.log.interval);
delete WebInspector.log.interval;
-
+
flushQueue();
}
-
+
// actually log the message
function logMessage(message)
{
var repeatCount = 1;
if (message == WebInspector.log.lastMessage)
repeatCount = WebInspector.log.repeatCount + 1;
-
+
WebInspector.log.lastMessage = message;
WebInspector.log.repeatCount = repeatCount;
-
+
// ConsoleMessage expects a proxy object
message = new WebInspector.ObjectProxy(null, [], 0, message, false);
-
+
// post the message
var msg = new WebInspector.ConsoleMessage(
WebInspector.ConsoleMessage.MessageSource.Other,
@@ -1320,20 +1339,20 @@ WebInspector.log = function(message)
null,
repeatCount,
message);
-
+
self.console.addMessage(msg);
}
-
+
// if we can't log the message, queue it
if (!isLogAvailable()) {
if (!WebInspector.log.queued)
WebInspector.log.queued = [];
-
+
WebInspector.log.queued.push(message);
-
+
if (!WebInspector.log.interval)
WebInspector.log.interval = setInterval(flushQueueIfAvailable, 1000);
-
+
return;
}
@@ -1473,7 +1492,8 @@ WebInspector.linkifyStringAsFragment = function(string)
return container;
}
-WebInspector.showProfileForURL = function(url) {
+WebInspector.showProfileForURL = function(url)
+{
WebInspector.showProfilesPanel();
WebInspector.panels.profiles.showProfileForURL(url);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list