diff options
author | Nicolas Roard <nicolas@android.com> | 2010-03-19 11:51:19 +0000 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2010-03-22 21:41:51 +0000 |
commit | 25258f3b185d134cd6f802fc08c8b4e07006420a (patch) | |
tree | 12af348663c98c7164f9be33d167d10dbf612abc /WebCore/rendering | |
parent | 343ec940062f940a47d74fc359b661de8be2f3b8 (diff) | |
download | external_webkit-25258f3b185d134cd6f802fc08c8b4e07006420a.zip external_webkit-25258f3b185d134cd6f802fc08c8b4e07006420a.tar.gz external_webkit-25258f3b185d134cd6f802fc08c8b4e07006420a.tar.bz2 |
Only enable composited fixed elements for mobile sites.
We can consider a website as being a 'mobile' site if:
- the viewport width is either undefined (-1) or equal to device-width (0)
- no scaling is allowed
Change-Id: Id88257278312077a170eb10d9f666c46bad135b6
Diffstat (limited to 'WebCore/rendering')
-rw-r--r-- | WebCore/rendering/RenderLayerCompositor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index ea510f8..e8d476b 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -987,6 +987,9 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const // static bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) const { +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + Settings* settings = m_renderView->document()->settings(); +#endif RenderObject* renderer = layer->renderer(); // The compositing state of a reflection should match that of its reflected layer. if (layer->isReflection()) { @@ -998,7 +1001,13 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c requiresCompositingForTransform(renderer) || #if PLATFORM(ANDROID) #if ENABLE(COMPOSITED_FIXED_ELEMENTS) - layer->isFixed() || + // For the moment, we want to only enable fixed composited layers on mobile websites. + // We can consider a website as being a 'mobile' site if all the + // following checks are true: + // 1) - the viewport width is either undefined (-1) or equal to device-width (0), and + // 2) - no scaling is allowed + (((settings->viewportWidth() == -1) || (settings->viewportWidth() == 0)) && + !settings->viewportUserScalable() && layer->isFixed()) || #endif #else requiresCompositingForVideo(renderer) || |