diff options
author | John Reck <jreck@google.com> | 2012-02-28 18:42:02 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-03-01 16:38:55 -0800 |
commit | 9a8423b643a8ce99e5642f2548600f9125382e89 (patch) | |
tree | 1121fb39001bead0e89edd593b40a16a0397d710 /Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
parent | bd4ee4debb53cea094c09b198f7ba4e8307a2998 (diff) | |
download | external_webkit-9a8423b643a8ce99e5642f2548600f9125382e89.zip external_webkit-9a8423b643a8ce99e5642f2548600f9125382e89.tar.gz external_webkit-9a8423b643a8ce99e5642f2548600f9125382e89.tar.bz2 |
Fix iframe, for reals!
Change-Id: I588aa5709e7a3c2ced9479c3cf9c1827bf6f7733
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()); } } |