summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-26 10:42:44 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-26 10:42:44 +0200
commit33b26980cb24288b5a9f2590ccf32a949281bb79 (patch)
treecc0203dac37338b24b0b25a4694c0b76d4e4164b /Source/WebKit2/WebProcess/WebPage/WebPage.cpp
parent715be629d51174233403237bfc563cf150087dc8 (diff)
downloadqtwebkit-33b26980cb24288b5a9f2590ccf32a949281bb79.tar.gz
Imported WebKit commit c596dd7f03007fa7ed896b928106497e8784b3b5 (http://svn.webkit.org/repository/webkit/trunk@129610)
New snapshot that removes QtQuick1 support (to be moved into QtQuick1 module)
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index b6143e649..61e82b5d9 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -396,6 +396,22 @@ void WebPage::initializeInjectedBundleFormClient(WKBundlePageFormClient* client)
void WebPage::initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient* client)
{
+ // It would be nice to get rid of this code and transition all clients to using didLayout instead of
+ // didFirstLayoutInFrame and didFirstVisuallyNonEmptyLayoutInFrame. In the meantime, this is required
+ // for backwards compatibility.
+ LayoutMilestones milestones = 0;
+ if (client) {
+ if (client->didFirstLayoutForFrame)
+ milestones |= WebCore::DidFirstLayout;
+ if (client->didFirstVisuallyNonEmptyLayoutForFrame)
+ milestones |= WebCore::DidFirstVisuallyNonEmptyLayout;
+ if (client->didNewFirstVisuallyNonEmptyLayout)
+ milestones |= WebCore::DidHitRelevantRepaintedObjectsAreaThreshold;
+ }
+
+ if (milestones)
+ listenForLayoutMilestones(milestones);
+
m_loaderClient.initialize(client);
}
@@ -560,13 +576,6 @@ uint64_t WebPage::renderTreeSize() const
return m_page->renderTreeSize().treeSize;
}
-void WebPage::setPaintedObjectsCounterThreshold(uint64_t threshold)
-{
- if (!m_page)
- return;
- m_page->setRelevantRepaintedObjectsCounterThreshold(threshold);
-}
-
void WebPage::setTracksRepaints(bool trackRepaints)
{
if (FrameView* view = mainFrameView())
@@ -940,7 +949,7 @@ void WebPage::sendViewportAttributesChanged()
// Recalculate the recommended layout size, when the available size (device pixel) changes.
Settings* settings = m_page->settings();
- int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_viewportSize.width());
+ int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), int(m_viewportSize.width() / m_page->deviceScaleFactor()));
// 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();
@@ -1123,6 +1132,13 @@ void WebPage::setFixedLayoutSize(const IntSize& size)
view->forceLayout();
}
+void WebPage::listenForLayoutMilestones(uint32_t milestones)
+{
+ if (!m_page)
+ return;
+ m_page->addLayoutMilestones(static_cast<LayoutMilestones>(milestones));
+}
+
void WebPage::setSuppressScrollbarAnimations(bool suppressAnimations)
{
m_page->setShouldSuppressScrollbarAnimations(suppressAnimations);
@@ -2056,7 +2072,11 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey()));
settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
- settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()));
+ settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey())
+#if PLATFORM(MAC)
+ || WebProcess::shared().shouldForceScreenFontSubstitution()
+#endif
+ );
settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));