Diff
Modified: trunk/Source/WebCore/ChangeLog (131935 => 131936)
--- trunk/Source/WebCore/ChangeLog 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/ChangeLog 2012-10-19 20:03:57 UTC (rev 131936)
@@ -1,3 +1,34 @@
+2012-10-19 Pavel Feldman <[email protected]>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ Otherwise, it is hard to manage these inter-dependent flags.
+
+ * inspector/InspectorFrontendClient.h:
+ (InspectorFrontendClient):
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::requestSetDockSide):
+ (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
+ * inspector/InspectorFrontendClientLocal.h:
+ (InspectorFrontendClientLocal):
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::requestSetDockSide):
+ * inspector/InspectorFrontendHost.h:
+ (InspectorFrontendHost):
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/front-end/DockController.js:
+ (WebInspector.DockController):
+ (WebInspector.DockController.prototype._updateUI.get sides):
+ (WebInspector.DockController.prototype._updateUI):
+ (WebInspector.DockController.prototype._toggleDockState):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.setAttachedWindow):
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide):
+
2012-10-19 Joshua Bell <[email protected]>
[V8] IndexedDB: Crash when lazy-indexing Date keys
Modified: trunk/Source/WebCore/WebCore.exp.in (131935 => 131936)
--- trunk/Source/WebCore/WebCore.exp.in 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-10-19 20:03:57 UTC (rev 131936)
@@ -2306,8 +2306,7 @@
__ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
__ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
__ZN7WebCore28InspectorFrontendClientLocal18isDebuggingEnabledEv
-__ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv
-__ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv
+__ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE
__ZN7WebCore28InspectorFrontendClientLocal19setDebuggingEnabledEb
__ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv
__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE
Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h 2012-10-19 20:03:57 UTC (rev 131936)
@@ -41,6 +41,12 @@
class InspectorFrontendClient {
public:
+ enum DockSide {
+ UNDOCKED = 0,
+ DOCKED_TO_RIGHT,
+ DOCKED_TO_BOTTOM
+ };
+
virtual ~InspectorFrontendClient() { }
virtual void windowObjectCleared() = 0;
@@ -54,9 +60,7 @@
virtual void bringToFront() = 0;
virtual void closeWindow() = 0;
- virtual void requestAttachWindow() = 0;
- virtual void requestDetachWindow() = 0;
- virtual void requestSetDockSide(const String&) = 0;
+ virtual void requestSetDockSide(DockSide) = 0;
virtual void changeAttachedWindowHeight(unsigned) = 0;
virtual void openInNewTab(const String& url) = 0;
virtual bool canSave() = 0;
Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp 2012-10-19 20:03:57 UTC (rev 131936)
@@ -148,20 +148,17 @@
m_evaluateOnLoad.clear();
}
-void InspectorFrontendClientLocal::requestAttachWindow()
+void InspectorFrontendClientLocal::requestSetDockSide(DockSide dockSide)
{
- if (!canAttachWindow())
- return;
- attachWindow();
- setAttachedWindow(true);
+ if (dockSide == UNDOCKED) {
+ detachWindow();
+ setAttachedWindow(false);
+ } else if (canAttachWindow()) {
+ attachWindow();
+ setAttachedWindow(true);
+ }
}
-void InspectorFrontendClientLocal::requestDetachWindow()
-{
- detachWindow();
- setAttachedWindow(false);
-}
-
bool InspectorFrontendClientLocal::canAttachWindow()
{
// Don't allow the attach if the window would be too small to accommodate the minimum inspector height.
@@ -214,7 +211,7 @@
void InspectorFrontendClientLocal::setAttachedWindow(bool attached)
{
- evaluateOnLoad(String::format("[\"setAttachedWindow\", %s]", attached ? "true" : "false"));
+ evaluateOnLoad(String::format("[\"setDockSide\", %s]", attached ? "bottom" : "undocked"));
}
void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h 2012-10-19 20:03:57 UTC (rev 131936)
@@ -63,9 +63,7 @@
virtual void moveWindowBy(float x, float y);
- virtual void requestAttachWindow();
- virtual void requestDetachWindow();
- virtual void requestSetDockSide(const String&) { }
+ virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void openInNewTab(const String& url);
virtual bool canSave() { return false; }
Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2012-10-19 20:03:57 UTC (rev 131936)
@@ -149,22 +149,16 @@
m_client->frontendLoaded();
}
-void InspectorFrontendHost::requestAttachWindow()
-{
- if (m_client)
- m_client->requestAttachWindow();
-}
-
-void InspectorFrontendHost::requestDetachWindow()
-{
- if (m_client)
- m_client->requestDetachWindow();
-}
-
void InspectorFrontendHost::requestSetDockSide(const String& side)
{
- if (m_client)
- m_client->requestSetDockSide(side);
+ if (!m_client)
+ return;
+ if (side == "undocked")
+ m_client->requestSetDockSide(InspectorFrontendClient::UNDOCKED);
+ else if (side == "right")
+ m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_RIGHT);
+ else if (side == "bottom")
+ m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_BOTTOM);
}
void InspectorFrontendHost::closeWindow()
Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h 2012-10-19 20:03:57 UTC (rev 131936)
@@ -57,8 +57,6 @@
void disconnectClient();
void loaded();
- void requestAttachWindow();
- void requestDetachWindow();
void requestSetDockSide(const String&);
void closeWindow();
void bringToFront();
Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.idl (131935 => 131936)
--- trunk/Source/WebCore/inspector/InspectorFrontendHost.idl 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.idl 2012-10-19 20:03:57 UTC (rev 131936)
@@ -39,8 +39,6 @@
void setZoomFactor(in float zoom);
void inspectedURLChanged(in DOMString newURL);
- void requestAttachWindow();
- void requestDetachWindow();
void requestSetDockSide(in DOMString side);
void setAttachedWindowHeight(in unsigned long height);
void moveWindowBy(in float x, in float y);
Modified: trunk/Source/WebCore/inspector/front-end/DockController.js (131935 => 131936)
--- trunk/Source/WebCore/inspector/front-end/DockController.js 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/front-end/DockController.js 2012-10-19 20:03:57 UTC (rev 131936)
@@ -40,8 +40,7 @@
if (Preferences.showDockToRight)
this._dockToggleButton.makeLongClickEnabled(this._createDockOptions.bind(this));
- this._dockSide = WebInspector.queryParamsObject["dockSide"];
- this._innerSetDocked(WebInspector.queryParamsObject["docked"] === "true");
+ this.setDockSide(WebInspector.queryParamsObject["dockSide"]);
}
WebInspector.DockController.State = {
@@ -60,33 +59,18 @@
},
/**
- * @param {boolean} docked
+ * @param {string} dockSide
*/
- setDocked: function(docked)
+ setDockSide: function(dockSide)
{
- var isDocked = this._state !== WebInspector.DockController.State.Undocked;
- if (docked !== isDocked)
- this._innerSetDocked(docked);
- },
+ if (this._dockSide)
+ WebInspector.settings.lastDockState.set(this._dockSide);
- /**
- * @param {boolean} docked
- */
- _innerSetDocked: function(docked)
- {
- if (this._state)
- WebInspector.settings.lastDockState.set(this._state);
-
- if (!docked) {
- this._state = WebInspector.DockController.State.Undocked;
+ this._dockSide = dockSide;
+ if (dockSide === WebInspector.DockController.State.Undocked)
WebInspector.userMetrics.WindowDocked.record();
- } else if (this._dockSide === "right") {
- this._state = WebInspector.DockController.State.DockedToRight;
+ else
WebInspector.userMetrics.WindowUndocked.record();
- } else {
- this._state = WebInspector.DockController.State.DockedToBottom;
- WebInspector.userMetrics.WindowUndocked.record();
- }
this._updateUI();
},
@@ -102,7 +86,7 @@
_updateUI: function()
{
var body = document.body;
- switch (this._state) {
+ switch (this._dockSide) {
case WebInspector.DockController.State.DockedToBottom:
body.removeStyleClass("undocked");
body.removeStyleClass("dock-to-right");
@@ -129,17 +113,17 @@
this._dockToggleButton.disabled = false;
// Choose different last state based on the current one if missing or if is the same.
- var states = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight];
- states.remove(this._state);
+ var sides = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight];
+ sides.remove(this._dockSide);
var lastState = WebInspector.settings.lastDockState.get();
- states.remove(lastState);
- if (states.length === 2) { // last state was not from the list of potential values
- lastState = states[0];
- states.remove(lastState);
+ sides.remove(lastState);
+ if (sides.length === 2) { // last state was not from the list of potential values
+ lastState = sides[0];
+ sides.remove(lastState);
}
this._decorateButtonForTargetState(this._dockToggleButton, lastState);
- this._decorateButtonForTargetState(this._dockToggleButtonOption, states[0]);
+ this._decorateButtonForTargetState(this._dockToggleButtonOption, sides[0]);
},
/**
@@ -174,22 +158,13 @@
*/
_toggleDockState: function(e)
{
- var state = e.target.state;
- switch (state) {
- case "undock":
- InspectorFrontendHost.requestDetachWindow();
- WebInspector.userMetrics.WindowUndocked.record();
- break;
- case "right":
- case "bottom":
- this._dockSide = state;
- InspectorFrontendHost.requestSetDockSide(this._dockSide);
- if (this._state === WebInspector.DockController.State.Undocked)
- InspectorFrontendHost.requestAttachWindow();
- else
- this._innerSetDocked(true);
- break;
+ var action;
+ switch (e.target.state) {
+ case "bottom": action = "" break;
+ case "right": action = "" break;
+ case "undock": action = "" break;
}
+ InspectorFrontendHost.requestSetDockSide(action);
},
/**
Modified: trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js (131935 => 131936)
--- trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js 2012-10-19 20:03:57 UTC (rev 131936)
@@ -74,14 +74,15 @@
WebInspector.CPUProfileType.instance.stopRecordingProfile();
},
- setAttachedWindow: function(attached)
+ setAttachedWindow: function(side)
{
- if (WebInspector.dockController)
- WebInspector.dockController.setDocked(attached);
+
},
- setDockSide: function(dockSide)
+ setDockSide: function(side)
{
+ if (WebInspector.dockController)
+ WebInspector.dockController.setDockSide(side);
},
showConsole: function()
Modified: trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js (131935 => 131936)
--- trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js 2012-10-19 20:03:57 UTC (rev 131936)
@@ -69,20 +69,11 @@
this._windowVisible = false;
},
- requestAttachWindow: function()
+ requestSetDockSide: function(side)
{
- InspectorFrontendAPI.setAttachedWindow(true);
+ InspectorFrontendAPI.setDockSide(side);
},
- requestDetachWindow: function()
- {
- InspectorFrontendAPI.setAttachedWindow(false);
- },
-
- requestSetDockSide: function()
- {
- },
-
setAttachedWindowHeight: function(height)
{
},
Modified: trunk/Source/WebCore/inspector/front-end/externs.js (131935 => 131936)
--- trunk/Source/WebCore/inspector/front-end/externs.js 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebCore/inspector/front-end/externs.js 2012-10-19 20:03:57 UTC (rev 131936)
@@ -123,8 +123,6 @@
InspectorFrontendHostAPI.prototype.port = function() {}
InspectorFrontendHostAPI.prototype.bringToFront = function() {}
InspectorFrontendHostAPI.prototype.closeWindow = function() {}
-InspectorFrontendHostAPI.prototype.requestAttachWindow = function() {}
-InspectorFrontendHostAPI.prototype.requestDetachWindow = function() {}
InspectorFrontendHostAPI.prototype.requestSetDockSide = function(dockSide) {}
InspectorFrontendHostAPI.prototype.setAttachedWindowHeight = function(height) {}
InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y) {}
Modified: trunk/Source/WebKit/chromium/ChangeLog (131935 => 131936)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-10-19 20:03:57 UTC (rev 131936)
@@ -1,3 +1,16 @@
+2012-10-19 Pavel Feldman <[email protected]>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ * public/WebDevToolsFrontendClient.h:
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::requestSetDockSide):
+ * src/InspectorFrontendClientImpl.h:
+ (InspectorFrontendClientImpl):
+
2012-09-08 Alpha Lam <[email protected]>
[chromium] Implement deferred image decoding
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h (131935 => 131936)
--- trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h 2012-10-19 20:03:57 UTC (rev 131936)
@@ -45,8 +45,6 @@
virtual void activateWindow() { }
virtual void closeWindow() { }
- virtual void requestDockWindow() { }
- virtual void requestUndockWindow() { }
virtual void requestSetDockSide(const WebString& side) { }
virtual void moveWindowBy(const WebFloatPoint&) { }
virtual void openInNewTab(const WebString& side) { }
Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp (131935 => 131936)
--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2012-10-19 20:03:57 UTC (rev 131936)
@@ -103,21 +103,17 @@
m_client->closeWindow();
}
-void InspectorFrontendClientImpl::requestAttachWindow()
+void InspectorFrontendClientImpl::requestSetDockSide(DockSide side)
{
- m_client->requestDockWindow();
+ String sideString = "undocked";
+ switch (side) {
+ case DOCKED_TO_RIGHT: sideString = "right"; break;
+ case DOCKED_TO_BOTTOM: sideString = "bottom"; break;
+ case UNDOCKED: sideString = "undocked"; break;
+ }
+ m_client->requestSetDockSide(sideString);
}
-void InspectorFrontendClientImpl::requestDetachWindow()
-{
- m_client->requestUndockWindow();
-}
-
-void InspectorFrontendClientImpl::requestSetDockSide(const String& side)
-{
- m_client->requestSetDockSide(side);
-}
-
void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned)
{
// Do nothing;
Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h (131935 => 131936)
--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h 2012-10-19 20:03:57 UTC (rev 131936)
@@ -62,9 +62,7 @@
virtual void bringToFront();
virtual void closeWindow();
- virtual void requestAttachWindow();
- virtual void requestDetachWindow();
- virtual void requestSetDockSide(const String&);
+ virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void openInNewTab(const String& url);
Modified: trunk/Source/WebKit2/win/WebKit2.def (131935 => 131936)
--- trunk/Source/WebKit2/win/WebKit2.def 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit2/win/WebKit2.def 2012-10-19 20:03:57 UTC (rev 131936)
@@ -304,8 +304,7 @@
?moveWindowBy@InspectorFrontendClientLocal@WebCore@@UAEXMM@Z
?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0PAV12@2@Z
?openInNewTab@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
- ?requestAttachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
- ?requestDetachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
+ ?requestSetDockSide@InspectorFrontendClientLocal@WebCore@@UAEXW4DockSide@InspectorFrontendClient@2@@Z
?sendMessageToBackend@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
?setInspectorFrontendClient@InspectorController@WebCore@@QAEXV?$PassOwnPtr@VInspectorFrontendClient@WebCore@@@WTF@@@Z
?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z
Modified: trunk/Source/WebKit2/win/WebKit2CFLite.def (131935 => 131936)
--- trunk/Source/WebKit2/win/WebKit2CFLite.def 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/WebKit2/win/WebKit2CFLite.def 2012-10-19 20:03:57 UTC (rev 131936)
@@ -293,8 +293,7 @@
?moveWindowBy@InspectorFrontendClientLocal@WebCore@@UAEXMM@Z
?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0PAV12@2@Z
?openInNewTab@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
- ?requestAttachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
- ?requestDetachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
+ ?requestSetDockSide@InspectorFrontendClientLocal@WebCore@@UAEXW4DockSide@InspectorFrontendClient@2@@Z
?sendMessageToBackend@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
?setInspectorFrontendClient@InspectorController@WebCore@@QAEXV?$PassOwnPtr@VInspectorFrontendClient@WebCore@@@WTF@@@Z
?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z
Modified: trunk/Source/autotools/symbols.filter (131935 => 131936)
--- trunk/Source/autotools/symbols.filter 2012-10-19 19:55:42 UTC (rev 131935)
+++ trunk/Source/autotools/symbols.filter 2012-10-19 20:03:57 UTC (rev 131936)
@@ -99,8 +99,7 @@
_ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff;
_ZN7WebCore28InspectorFrontendClientLocal12openInNewTabERKN3WTF6StringE;
_ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv;
-_ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv;
-_ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv;
+_ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE;
_ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv;
_ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE;
_ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj;