diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/WebKit2/WebProcess/WebPage/WebPage.cpp | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index b4e19bfe7..37d1e0702 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -126,6 +126,10 @@ #endif #endif +#if ENABLE(BATTERY_STATUS) +#include "WebBatteryClient.h" +#endif + #if ENABLE(WEB_INTENTS) #include "IntentData.h" #endif @@ -262,6 +266,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) m_page = adoptPtr(new Page(pageClients)); +#if ENABLE(BATTERY_STATUS) + WebCore::provideBatteryTo(m_page.get(), new WebBatteryClient(this)); +#endif #if ENABLE(GEOLOCATION) WebCore::provideGeolocationTo(m_page.get(), new WebGeolocationClient(this)); #endif @@ -868,18 +875,12 @@ void WebPage::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSiz if (view->fixedLayoutSize() == targetLayoutSize) return; - // Always reset even when empty. - view->setFixedLayoutSize(targetLayoutSize); - m_page->settings()->setAcceleratedCompositingForFixedPositionEnabled(true); m_page->settings()->setFixedElementsLayoutRelativeToFrame(true); m_page->settings()->setFixedPositionCreatesStackingContext(true); - // Schedule a layout to use the new target size. - if (!view->layoutPending()) { - view->setNeedsLayout(); - view->scheduleRelayout(); - } + // Always reset even when empty. This also takes care of the relayout. + setFixedLayoutSize(targetLayoutSize); } void WebPage::resizeToContentsIfNeeded() @@ -918,7 +919,7 @@ void WebPage::sendViewportAttributesChanged() 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<int>(160 * m_page->deviceScaleFactor()), m_viewportSize); + ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), m_viewportSize); setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height()))); send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); @@ -1080,7 +1081,7 @@ void WebPage::setUseFixedLayout(bool fixed) view->setUseFixedLayout(fixed); if (!fixed) - view->setFixedLayoutSize(IntSize()); + setFixedLayoutSize(IntSize()); } void WebPage::setFixedLayoutSize(const IntSize& size) @@ -1439,7 +1440,7 @@ void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent) if (!handled) handled = performDefaultBehaviorForKeyEvent(keyboardEvent); - sendSync(Messages::WebPageProxy::DidReceiveKeyEvent(static_cast<uint32_t>(keyboardEvent.type()), handled), Messages::WebPageProxy::DidReceiveKeyEvent::Reply()); + send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled)); } void WebPage::keyEventSyncForTesting(const WebKeyboardEvent& keyboardEvent, bool& handled) @@ -1813,7 +1814,7 @@ void WebPage::runJavaScriptInMainFrame(const String& script, uint64_t callbackID RefPtr<SerializedScriptValue> serializedResultValue; CoreIPC::DataReference dataReference; - JSLock lock(SilenceAssertionsOnly); + JSLockHolder lock(JSDOMWindow::commonJSGlobalData()); if (JSValue resultValue = m_mainFrame->coreFrame()->script()->executeScript(script, true).jsValue()) { if ((serializedResultValue = SerializedScriptValue::create(m_mainFrame->jsContext(), toRef(m_mainFrame->coreFrame()->script()->globalObject(mainThreadNormalWorld())->globalExec(), resultValue), 0))) dataReference = serializedResultValue->data(); @@ -2043,10 +2044,6 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) settings->setAVFoundationEnabled(store.getBoolValueForKey(WebPreferencesKey::isAVFoundationEnabledKey())); #endif -#if ENABLE(WEB_SOCKETS) - settings->setUseHixie76WebSocketProtocol(store.getBoolValueForKey(WebPreferencesKey::hixie76WebSocketProtocolEnabledKey())); -#endif - #if ENABLE(WEB_AUDIO) settings->setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey())); #endif @@ -3119,15 +3116,6 @@ void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time) mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time)); } -String WebPage::viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight) -{ - ViewportArguments arguments = mainFrame()->document()->viewportArguments(); - ViewportAttributes attrs = WebCore::computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight)); - WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); - WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs); - return String::format("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", static_cast<int>(attrs.layoutSize.width()), static_cast<int>(attrs.layoutSize.height()), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable); -} - void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); |