diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index bb17784..c50f6a6 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -519,6 +519,7 @@ void GraphicsLayerAndroid::updateScrollingLayers() m_contentLayer->removeChildren(); // Replace the content layer with a scrollable layer. LayerAndroid* layer = new ScrollableLayerAndroid(*m_contentLayer); + layer->setIsIframe(true); m_contentLayer->unref(); m_contentLayer = layer; if (m_parent) { @@ -559,11 +560,14 @@ void GraphicsLayerAndroid::updateScrollOffset() { RenderLayer* layer = renderLayerFromClient(m_client); if (!layer || !(m_foregroundLayer || m_contentLayer->contentIsScrollable())) return; - IntSize scroll = layer->scrolledContentOffset(); - if (m_foregroundLayer) + if (m_foregroundLayer) { + IntSize scroll = layer->scrolledContentOffset(); m_foregroundLayer->setScrollOffset(IntPoint(scroll.width(), scroll.height())); - else if (m_contentLayer->contentIsScrollable()) - static_cast<ScrollableLayerAndroid*>(m_contentLayer)->scrollTo(scroll.width(), scroll.height()); + } else if (m_contentLayer->contentIsScrollable()) { + IntPoint p(layer->renderer()->frame()->view()->scrollX(), + layer->renderer()->frame()->view()->scrollY()); + static_cast<ScrollableLayerAndroid*>(m_contentLayer)->setIFrameScrollOffset(p); + } askForSync(); } @@ -640,14 +644,9 @@ bool GraphicsLayerAndroid::repaint() m_foregroundLayer->markAsDirty(region); m_foregroundLayer->needsRepaint(); } else { - // Paint at 0,0. - IntSize scroll = layer->scrolledContentOffset(); - layer->scrollToOffset(0, 0); // If there is no contents clip, we can draw everything into one // picture. bool painting = paintContext(m_contentLayer->recordContext(), layerBounds); - // Move back to the scroll offset - layer->scrollToOffset(scroll.width(), scroll.height()); if (!painting) return false; // We painted new content @@ -658,9 +657,9 @@ bool GraphicsLayerAndroid::repaint() FrameView* view = layer->renderer()->frame()->view(); static_cast<ScrollableLayerAndroid*>(m_contentLayer)->setScrollLimits( m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight()); - LOG("setScrollLimits(%.2f, %.2f, w: %d h: %d) layer %d, frame scroll position is %d, %d (%d, %d)", + LOG("setScrollLimits(%.2f, %.2f, w: %d h: %d) layer %d, frame scroll position is %d, %d", m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight(), - m_contentLayer->uniqueId(), view->scrollX(), view->scrollY(), view->actualScrollX(), view->actualScrollY()); + m_contentLayer->uniqueId(), view->scrollX(), view->scrollY()); } } |