From 49233e234e5c787396cadb2cea33b31ae0cd65c1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 20 Jun 2012 13:01:08 +0200 Subject: Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813) New snapshot with Windows build fixes --- Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp') diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 6f1827cc1..ff94102c6 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -898,7 +898,11 @@ void WebPage::sendViewportAttributesChanged() int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_viewportSize.width()); - ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, settings->deviceWidth(), settings->deviceHeight(), static_cast(160 * settings->devicePixelRatio()), m_viewportSize); + // If unset we use the viewport dimensions. This fits with the behavior of desktop browsers. + int deviceWidth = (settings->deviceWidth() > 0) ? settings->deviceWidth() : m_viewportSize.width(); + int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height(); + + ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, static_cast(160 * m_page->deviceScaleFactor()), m_viewportSize); setResizesToContentsUsingLayoutSize(IntSize(static_cast(attr.layoutSize.width()), static_cast(attr.layoutSize.height()))); send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); @@ -1419,7 +1423,9 @@ void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent) if (!handled) handled = performDefaultBehaviorForKeyEvent(keyboardEvent); - send(Messages::WebPageProxy::DidReceiveEvent(static_cast(keyboardEvent.type()), handled)); + // The receiving end relies on DidReceiveEvent and InterpretQueuedKeyEvent arriving in the same order they are sent + // (for keyboard events.) We set the DispatchMessageEvenWhenWaitingForSyncReply flag to ensure consistent ordering. + connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast(keyboardEvent.type()), handled), m_pageID, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); } void WebPage::keyEventSyncForTesting(const WebKeyboardEvent& keyboardEvent, bool& handled) @@ -1968,7 +1974,6 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey())); settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey())); settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey())); - settings->setDevicePixelRatio(store.getDoubleValueForKey(WebPreferencesKey::devicePixelRatioKey())); settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey())); settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey())); settings->setEditableLinkBehavior(static_cast(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey()))); @@ -2404,7 +2409,7 @@ void WebPage::unmarkAllBadGrammar() } } -#if PLATFORM(MAC) +#if USE(APPKIT) void WebPage::uppercaseWord() { m_page->focusController()->focusedOrMainFrame()->editor()->uppercaseWord(); -- cgit v1.2.1