[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
beidson at apple.com
beidson at apple.com
Wed Mar 17 17:56:16 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 9bc4bb4701ebc5f9fb47d9a15745a126548a8f6a
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Feb 22 23:10:15 2010 +0000
Disable WebView docking to views that are too small.
<rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
Reviewed by Tim Hatcher.
WebCore:
* WebCore.base.exp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::canAttachWindow): Provide a utility for WebKits to make a showWindow()
decision based on if attachment would be allowed or not.
(WebCore::InspectorController::attachWindow): Don't attach if the view is too small to attach to.
* inspector/InspectorController.h:
WebKit/mac:
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController showWindow:]): No matter the preference, don't open the inspector
window attached if WebCore says it shouldn't be attached.
WebKit/win:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::showWindowWithoutNotifications): No matter the preference, don't open the inspector
window attached if WebCore says it shouldn't be attached.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a2b3be..b29711b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-22 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Disable WebView docking to views that are too small.
+ <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+ * WebCore.base.exp:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::canAttachWindow): Provide a utility for WebKits to make a showWindow()
+ decision based on if attachment would be allowed or not.
+ (WebCore::InspectorController::attachWindow): Don't attach if the view is too small to attach to.
+ * inspector/InspectorController.h:
+
2010-02-22 Alexey Proskuryakov <ap at apple.com>
Build fix.
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index a07aee4..a1fb44a 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -789,6 +789,7 @@ __ZNK7WebCore11CachedImage5imageEv
__ZNK7WebCore11FrameLoader10isCompleteEv
__ZNK7WebCore11FrameLoader14frameHasLoadedEv
__ZNK7WebCore11FrameLoader15containsPluginsEv
+__ZNK7WebCore19InspectorController15canAttachWindowEv
__ZNK7WebCore11FrameLoader15firstLayoutDoneEv
__ZNK7WebCore11FrameLoader16outgoingReferrerEv
__ZNK7WebCore11FrameLoader16responseMIMETypeEv
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 46f0be3..13dc517 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -411,6 +411,22 @@ static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsign
return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
}
+bool InspectorController::canAttachWindow() const
+{
+ if (!enabled())
+ return false;
+
+ String attachedHeight = setting(inspectorAttachedHeightName);
+ bool success = true;
+ int height = attachedHeight.toInt(&success);
+ unsigned preferredHeight = success ? height : defaultAttachedHeight;
+
+ unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight();
+
+ // Don't allow the attach if the window is too small to respect what should be the minimum inspector height.
+ return preferredHeight <= inspectedPageHeight * maximumAttachedHeightRatio;
+}
+
void InspectorController::attachWindow()
{
if (!enabled())
@@ -418,12 +434,16 @@ void InspectorController::attachWindow()
unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight();
- m_client->attachWindow();
-
String attachedHeight = setting(inspectorAttachedHeightName);
bool success = true;
int height = attachedHeight.toInt(&success);
unsigned preferredHeight = success ? height : defaultAttachedHeight;
+
+ // Don't allow the attach if the window is too small to respect what should be the minimum inspector height.
+ if (preferredHeight > inspectedPageHeight * maximumAttachedHeightRatio)
+ return;
+
+ m_client->attachWindow();
// We need to constrain the window height here in case the user has resized the inspected page's window so that
// the user's preferred height would be too big to display.
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index f1d9c48..cfbe4b5 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -143,6 +143,7 @@ public:
void clearConsoleMessages();
const Vector<ConsoleMessage*>& consoleMessages() const { return m_consoleMessages; }
+ bool canAttachWindow() const;
void attachWindow();
void detachWindow();
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 7bdf4b6..35f6165 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-22 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Disable WebView docking to views that are too small.
+ <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController showWindow:]): No matter the preference, don't open the inspector
+ window attached if WebCore says it shouldn't be attached.
+
2010-02-22 Simon Fraser <simon.fraser at apple.com>
Reviewed by John Sullivan.
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 01515b1..f6c7603 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -326,9 +326,14 @@ void WebInspectorClient::inspectorWindowObjectCleared()
_visible = YES;
- // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
- String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName);
- _shouldAttach = shouldAttach != "false";
+ if (![_inspectedWebView page]->inspectorController()->canAttachWindow())
+ _shouldAttach = NO;
+
+ if (_shouldAttach) {
+ // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
+ String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName);
+ _shouldAttach = shouldAttach != "false";
+ }
if (_shouldAttach) {
WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 8dd19ad..23d80e5 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-22 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ Disable WebView docking to views that are too small.
+ <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+ * WebCoreSupport/WebInspectorClient.cpp:
+ (WebInspectorClient::showWindowWithoutNotifications): No matter the preference, don't open the inspector
+ window attached if WebCore says it shouldn't be attached.
+
2010-02-17 Steve Falkenburg <sfalken at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 0dd6e58..2b0ba3f 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -349,10 +349,15 @@ void WebInspectorClient::showWindowWithoutNotifications()
ASSERT(m_webView);
ASSERT(m_inspectedWebViewHwnd);
- // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
- String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(inspectorStartsAttachedName);
- m_shouldAttachWhenShown = shouldAttach != "false";
-
+ if (!m_inspectedWebView->page()->inspectorController()->canAttachWindow())
+ m_shouldAttachWhenShown = false;
+
+ if (m_shouldAttachWhenShown) {
+ // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
+ String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(inspectorStartsAttachedName);
+ m_shouldAttachWhenShown = shouldAttach != "false";
+ }
+
if (!m_shouldAttachWhenShown) {
// Put the Inspector's WebView inside our window and show it.
m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list