Diff
Modified: trunk/Source/WebCore/ChangeLog (92383 => 92384)
--- trunk/Source/WebCore/ChangeLog 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/ChangeLog 2011-08-04 17:45:31 UTC (rev 92384)
@@ -1,3 +1,22 @@
+2011-08-01 Brian Weinstein <[email protected]>
+
+ WebKit2: Web Inspector always starts in undocked mode
+ https://bugs.webkit.org/show_bug.cgi?id=65493
+ <rdar://problem/9353114>
+
+ Reviewed by Adam Roben.
+
+ Expose some methods on InspectorFrontendClient through the InspectorController so WebKit2
+ can request the inspector be docked, or ask whether or not it can be docked.
+
+ * WebCore.exp.in: Export needed methods.
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::requestAttachWindow): Call through to InspectorFrontendClient.
+ (WebCore::InspectorController::canAttachWindow): Ditto.
+ * inspector/InspectorController.h:
+ * inspector/InspectorFrontendClient.h:
+ * inspector/InspectorFrontendClientLocal.h:
+
2011-08-04 Luke Macpherson <[email protected]>
Support cast between CSSPrimitiveValue and EborderFit, use in CSSStyleSelector.
Modified: trunk/Source/WebCore/WebCore.exp.in (92383 => 92384)
--- trunk/Source/WebCore/WebCore.exp.in 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-08-04 17:45:31 UTC (rev 92384)
@@ -1586,11 +1586,13 @@
#if ENABLE(INSPECTOR)
__ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
__ZN7WebCore19InspectorController14enableProfilerEv
+__ZN7WebCore19InspectorController15canAttachWindowEv
__ZN7WebCore19InspectorController15debuggerEnabledEv
__ZN7WebCore19InspectorController15disableDebuggerEv
__ZN7WebCore19InspectorController15disableProfilerEv
__ZN7WebCore19InspectorController15profilerEnabledEv
__ZN7WebCore19InspectorController18disconnectFrontendEv
+__ZN7WebCore19InspectorController19requestAttachWindowEv
__ZN7WebCore19InspectorController20stopTimelineProfilerEv
__ZN7WebCore19InspectorController21showAndEnableDebuggerEv
__ZN7WebCore19InspectorController11showConsoleEv
Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (92383 => 92384)
--- trunk/Source/WebCore/inspector/InspectorController.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -509,6 +509,22 @@
m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize);
}
+void InspectorController::requestAttachWindow()
+{
+ if (!m_inspectorFrontendClient)
+ return;
+
+ m_inspectorFrontendClient->requestAttachWindow();
+}
+
+bool InspectorController::canAttachWindow()
+{
+ if (!m_inspectorFrontendClient)
+ return false;
+
+ return m_inspectorFrontendClient->canAttachWindow();
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/inspector/InspectorController.h (92383 => 92384)
--- trunk/Source/WebCore/inspector/InspectorController.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/inspector/InspectorController.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -121,6 +121,9 @@
#endif
void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
+
+ void requestAttachWindow();
+ bool canAttachWindow();
private:
friend class PostWorkerNotificationToFrontendTask;
Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (92383 => 92384)
--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -58,6 +58,7 @@
virtual void requestAttachWindow() = 0;
virtual void requestDetachWindow() = 0;
virtual void changeAttachedWindowHeight(unsigned) = 0;
+ virtual bool canAttachWindow() = 0;
virtual void saveAs(const WTF::String& fileName, const WTF::String& content) = 0;
virtual void inspectedURLChanged(const String&) = 0;
Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (92383 => 92384)
--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -64,11 +64,11 @@
virtual void requestAttachWindow();
virtual void requestDetachWindow();
virtual void changeAttachedWindowHeight(unsigned);
+ virtual bool canAttachWindow();
virtual void saveAs(const String&, const String&) { }
virtual void attachWindow() = 0;
virtual void detachWindow() = 0;
- bool canAttachWindow();
virtual void sendMessageToBackend(const String& message);
Modified: trunk/Source/WebKit/chromium/ChangeLog (92383 => 92384)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-08-04 17:45:31 UTC (rev 92384)
@@ -1,3 +1,17 @@
+2011-08-04 Brian Weinstein <[email protected]>
+
+ WebKit2: Web Inspector always starts in undocked mode
+ https://bugs.webkit.org/show_bug.cgi?id=65493
+ <rdar://problem/9353114>
+
+ Reviewed by Adam Roben.
+
+ Add a stub method for Chromium.
+
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::canAttachWindow):
+ * src/InspectorFrontendClientImpl.h:
+
2011-08-03 Kentaro Hara <[email protected]>
Implement EventSender.scalePageBy()
Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp (92383 => 92384)
--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -124,6 +124,12 @@
{
// Do nothing;
}
+
+bool InspectorFrontendClientImpl::canAttachWindow()
+{
+ // FIXME: Implement this if it is ever called by Chromium.
+ return false;
+}
void InspectorFrontendClientImpl::saveAs(const String& fileName, const String& content)
{
Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h (92383 => 92384)
--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -66,6 +66,7 @@
virtual void requestAttachWindow();
virtual void requestDetachWindow();
virtual void changeAttachedWindowHeight(unsigned);
+ virtual bool canAttachWindow();
virtual void saveAs(const WTF::String& fileName, const WTF::String& content);
virtual void inspectedURLChanged(const WTF::String&);
Modified: trunk/Source/WebKit2/ChangeLog (92383 => 92384)
--- trunk/Source/WebKit2/ChangeLog 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-04 17:45:31 UTC (rev 92384)
@@ -1,3 +1,45 @@
+2011-08-01 Brian Weinstein <[email protected]>
+
+ WebKit2: Web Inspector always starts in undocked mode
+ https://bugs.webkit.org/show_bug.cgi?id=65493
+ <rdar://problem/9353114>
+
+ Reviewed by Adam Roben.
+
+ When opening the inspector, the web process tells the UI process that the inspector page has loaded,
+ but now will pass another bit of data, whether the inspector can start attached, so the UI process
+ doesn't need to ask the web process to do another calculation on whether or not it can be attached.
+
+ If the user prefers the inspector to start docked (this defaults to true), and there is room for the
+ window, we send a message to the web process to try and attach the inspector. This makes sure that the
+ inspector knows it is docked (in the web process).
+
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::attach): Update the user's docked/undocked preference if the inspector is visible
+ when it was attached.
+ (WebKit::WebInspectorProxy::detach): Ditto (but when it was detached).
+ (WebKit::WebInspectorProxy::didLoadInspectorPage): If we can start docked, and the user prefers to start docked,
+ then request the inspector be attached to the window.
+ * UIProcess/WebInspectorProxy.h:
+
+ * UIProcess/mac/WebInspectorProxyMac.mm:
+ (WebKit::WebInspectorProxy::platformOpen): Only show the window if we are going to start undocked.
+ * UIProcess/win/WebInspectorProxyWin.cpp:
+ (WebKit::WebInspectorProxy::platformOpen): Ditto.
+
+ * WebProcess/WebPage/WebInspector.cpp:
+ (WebKit::WebInspector::didLoadInspectorPage): Pass whether or not we can attach the window.
+ (WebKit::WebInspector::requestAttachWindow): Call through to the InspectorController to attach the inspector.
+ (WebKit::WebInspector::canAttachWindow): Ask the InspectorController if we can attach the inspector.
+ * WebProcess/WebPage/WebInspector.h:
+
+ * Shared/WebPreferencesStore.h: Add a new preference for whether or not the inspector should
+ start attached.
+
+ * UIProcess/WebInspectorProxy.messages.in: When the inspector page is loaded, tell the UI Process whether
+ we can attach the inspector without needing another message.
+ * WebProcess/WebPage/WebInspector.messages.in: Add a new message for RequestAttachWindow
+
2011-08-02 Jocelyn Turcotte <[email protected]>
[Qt][WK2] Create scene graph nodes for tiles in QTouchWebView instead of using imperative painting.
Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (92383 => 92384)
--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -84,6 +84,7 @@
macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, true) \
macro(MediaPlaybackRequiresUserGesture, mediaPlaybackRequiresUserGesture, Bool, bool, false) \
macro(MediaPlaybackAllowsInline, mediaPlaybackAllowsInline, Bool, bool, true) \
+ macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -121,6 +121,9 @@
void WebInspectorProxy::attach()
{
m_isAttached = true;
+
+ if (m_isVisible)
+ inspectorPageGroup()->preferences()->setInspectorStartsAttached(true);
platformAttach();
}
@@ -128,6 +131,9 @@
void WebInspectorProxy::detach()
{
m_isAttached = false;
+
+ if (m_isVisible)
+ inspectorPageGroup()->preferences()->setInspectorStartsAttached(false);
platformDetach();
}
@@ -203,11 +209,15 @@
inspectorPage->loadURL(inspectorPageURL());
}
-void WebInspectorProxy::didLoadInspectorPage()
+void WebInspectorProxy::didLoadInspectorPage(bool canStartAttached)
{
m_isVisible = true;
- platformOpen();
+ bool willOpenAttached = canStartAttached && inspectorPageGroup()->preferences()->inspectorStartsAttached();
+ platformOpen(willOpenAttached);
+
+ if (willOpenAttached)
+ m_page->process()->send(Messages::WebInspector::RequestAttachWindow(), m_page->pageID());
}
void WebInspectorProxy::didClose()
Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -114,7 +114,7 @@
virtual Type type() const { return APIType; }
WebPageProxy* platformCreateInspectorPage();
- void platformOpen();
+ void platformOpen(bool willOpenAttached);
void platformDidClose();
void platformBringToFront();
void platformInspectedURLChanged(const String&);
@@ -127,7 +127,7 @@
// Called by WebInspectorProxy messages
void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&);
- void didLoadInspectorPage();
+ void didLoadInspectorPage(bool canStartAttached);
void didClose();
void bringToFront();
void inspectedURLChanged(const String&);
Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in 2011-08-04 17:45:31 UTC (rev 92384)
@@ -24,7 +24,7 @@
messages -> WebInspectorProxy {
CreateInspectorPage() -> (uint64_t inspectorPageID, WebKit::WebPageCreationParameters inspectorPageParameters)
- DidLoadInspectorPage()
+ DidLoadInspectorPage(bool canStartAttached)
DidClose()
BringToFront()
InspectedURLChanged(WTF::String urlString)
Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2011-08-04 17:45:31 UTC (rev 92384)
@@ -109,14 +109,12 @@
return toImpl(m_inspectorView.get().pageRef);
}
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool willOpenAttached)
{
ASSERT(!m_inspectorWindow);
m_inspectorProxyObjCAdapter.adoptNS([[WebInspectorProxyObjCAdapter alloc] initWithWebInspectorProxy:this]);
- // FIXME: support opening in docked mode here.
-
NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSTexturedBackgroundWindowMask);
NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
[window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
@@ -137,7 +135,8 @@
[m_inspectorView.get() setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[contentView addSubview:m_inspectorView.get()];
- [window makeKeyAndOrderFront:nil];
+ if (!willOpenAttached)
+ [window makeKeyAndOrderFront:nil];
m_inspectorWindow.adoptNS(window);
}
Modified: trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -39,7 +39,7 @@
return 0;
}
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool)
{
notImplemented();
}
Modified: trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp (92383 => 92384)
--- trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -198,7 +198,7 @@
return m_inspectorView->page();
}
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool willOpenAttached)
{
registerInspectorViewWindowClass();
@@ -207,7 +207,9 @@
ASSERT(::IsWindow(m_inspectorWindow));
m_inspectorView->setParentWindow(m_inspectorWindow);
- ::ShowWindow(m_inspectorWindow, SW_SHOW);
+
+ if (!willOpenAttached)
+ ::ShowWindow(m_inspectorWindow, SW_SHOW);
}
void WebInspectorProxy::platformDidClose()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (92383 => 92384)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp 2011-08-04 17:45:31 UTC (rev 92384)
@@ -78,7 +78,7 @@
// Called from WebInspectorFrontendClient
void WebInspector::didLoadInspectorPage()
{
- WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(), m_page->pageID());
+ WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(canAttachWindow()), m_page->pageID());
}
void WebInspector::didClose()
@@ -181,6 +181,16 @@
// FIXME: show the Timeline panel.
}
+void WebInspector::requestAttachWindow()
+{
+ m_inspectorPage->corePage()->inspectorController()->requestAttachWindow();
+}
+
+bool WebInspector::canAttachWindow() const
+{
+ return m_inspectorPage->corePage()->inspectorController()->canAttachWindow();
+}
+
} // namespace WebKit
#endif // ENABLE(INSPECTOR)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h (92383 => 92384)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h 2011-08-04 17:45:31 UTC (rev 92384)
@@ -59,6 +59,9 @@
void setJavaScriptProfilingEnabled(bool);
void startPageProfiling();
void stopPageProfiling();
+
+ bool canAttachWindow() const;
+ void requestAttachWindow();
private:
friend class WebInspectorClient;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in (92383 => 92384)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in 2011-08-04 17:25:02 UTC (rev 92383)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in 2011-08-04 17:45:31 UTC (rev 92384)
@@ -32,6 +32,8 @@
StopJavaScriptProfiling()
StartPageProfiling()
StopPageProfiling()
+
+ RequestAttachWindow()
}
#endif