diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/page/FrameView.cpp | 35 | ||||
-rw-r--r-- | WebCore/page/FrameView.h | 3 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 13 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayer.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayerCompositor.cpp | 18 |
5 files changed, 41 insertions, 31 deletions
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index bac995d..17ba2bc 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -555,16 +555,9 @@ void FrameView::updateCompositingLayers() if (!view) return; #if ENABLE(ANDROID_OVERFLOW_SCROLL) - // Enter compositing mode for child frames that have layout dimensions. The - // decision to enable compositing for the RenderView will be done in the - // compositor. - if (false && m_frame->ownerRenderer() && (layoutWidth() | layoutHeight()) && !view->usesCompositing()) { - ScrollbarMode h,v; - scrollbarModes(h, v); - if ((h != ScrollbarAlwaysOff && layoutWidth() < contentsWidth()) || - (v != ScrollbarAlwaysOff && layoutHeight() < contentsHeight())) - enterCompositingMode(); - } + // Enter compositing mode for child frames that have layout dimensions. + if (hasOverflowScroll()) + enterCompositingMode(); #endif // This call will make sure the cached hasAcceleratedCompositing is updated from the pref @@ -579,6 +572,28 @@ void FrameView::setNeedsOneShotDrawingSynchronization() page->chrome()->client()->setNeedsOneShotDrawingSynchronization(); } +#if ENABLE(ANDROID_OVERFLOW_SCROLL) +bool FrameView::hasOverflowScroll() const +{ + RenderObject* ownerRenderer = m_frame->ownerRenderer(); + if (!ownerRenderer || !ownerRenderer->isRenderIFrame()) + return false; + RenderLayer* layer = ownerRenderer->enclosingLayer(); + // Make sure the layer has visible content or descendants. + if (!layer->hasVisibleContent() && !layer->hasVisibleDescendant()) + return false; + // If either layout dimension is 0, return false. + if (!layoutWidth() || !layoutHeight()) + return false; + ScrollbarMode h, v; + scrollbarModes(h, v); + if (h == ScrollbarAlwaysOff || v == ScrollbarAlwaysOff) + return false; + if (contentsWidth() <= layoutWidth() && contentsHeight() <= layoutHeight()) + return false; + return true; +} +#endif #endif // USE(ACCELERATED_COMPOSITING) bool FrameView::hasCompositedContent() const diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index 8a1a071..87924b2 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -104,6 +104,9 @@ public: // Called when changes to the GraphicsLayer hierarchy have to be synchronized with // content rendered via the normal painting path. void setNeedsOneShotDrawingSynchronization(); +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + bool hasOverflowScroll() const; +#endif #endif bool hasCompositedContent() const; diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 2fa1215..d99c1cb 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -373,10 +373,15 @@ void GraphicsLayerAndroid::setDrawsContent(bool drawsContent) m_contentLayer->addChild(m_foregroundClipLayer); } else if (layer->isRootLayer() && layer->renderer()->frame()->ownerRenderer()) { - // Replace the content layer with a scrollable layer. - LayerAndroid* layer = new ScrollableLayerAndroid(*m_contentLayer); - m_contentLayer->unref(); - m_contentLayer = layer; + // We have to do another check for scrollable content since an + // iframe might be compositing for other reasons. + FrameView* view = layer->renderer()->frame()->view(); + if (view->hasOverflowScroll()) { + // Replace the content layer with a scrollable layer. + LayerAndroid* layer = new ScrollableLayerAndroid(*m_contentLayer); + m_contentLayer->unref(); + m_contentLayer = layer; + } } } #endif diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index 9d894af..2d2559c 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -2159,8 +2159,9 @@ RenderLayer::updateScrollInfoAfterLayout() #if ENABLE(ANDROID_OVERFLOW_SCROLL) if (hasOverflowScroll()) { rendererContentChanged(); + if (parent()) + parent()->dirtyNormalFlowList(); dirtyStackingContextZOrderLists(); - dirtyZOrderLists(); } #endif } diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index c6cd277..e6ea32a 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -1176,22 +1176,8 @@ bool RenderLayerCompositor::requiresCompositingForMobileSites(const RenderLayer* #if ENABLE(ANDROID_OVERFLOW_SCROLL) if (layer->hasOverflowScroll()) return true; - HTMLFrameOwnerElement* ownerElement = enclosingIFrameElement(); - RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0; - if (false && layer->isRootLayer() && renderer && renderer->isRenderIFrame()) { - if (layer->renderer()->frame()) { - FrameView* view = layer->renderer()->frame()->view(); - if (view) { - // Enable compositing if the frame can scroll and the contents - // are larger than the layout dimensions. - ScrollbarMode h,v; - view->scrollbarModes(h, v); - if ((h != ScrollbarAlwaysOff && view->layoutWidth() < view->contentsWidth()) || - (v != ScrollbarAlwaysOff && view->layoutHeight() < view->contentsHeight())) - return true; - } - } - } + if (layer->isRootLayer() && m_renderView->frameView()->hasOverflowScroll()) + return true; #endif #if ENABLE(COMPOSITED_FIXED_ELEMENTS) // First, check if we are in an iframe, and if so bail out |