diff options
author | John Reck <jreck@google.com> | 2012-05-25 18:44:06 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-05-25 19:02:37 -0700 |
commit | 86ba073431c8ddf2e9d1f2d5d4f89157dd32ec33 (patch) | |
tree | c38b7b43d160c77ad35be627c4502db5fc4cc879 /Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
parent | 5ac11a7ed87ada91c7930bb6aa7b32007acb3d47 (diff) | |
download | external_webkit-86ba073431c8ddf2e9d1f2d5d4f89157dd32ec33.zip external_webkit-86ba073431c8ddf2e9d1f2d5d4f89157dd32ec33.tar.gz external_webkit-86ba073431c8ddf2e9d1f2d5d4f89157dd32ec33.tar.bz2 |
Compute scroll limits correctly
Bug: 6563848
Change-Id: I167487fab64c97b6c4ec7f1b14639415ce15e26f
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 5207ace..e34125c 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -670,6 +670,14 @@ void GraphicsLayerAndroid::updateScrollOffset() { askForSync(); } +static void setScrollLimits(ScrollableLayerAndroid* scrollableLayer, RenderLayer* renderLayer) +{ + RenderBox* box = renderLayer->renderBox(); + scrollableLayer->setScrollLimits(0, 0, + renderLayer->scrollWidth() - box->clientWidth(), + renderLayer->scrollHeight() - box->clientHeight()); +} + bool GraphicsLayerAndroid::repaint() { ALOGV("(%x) repaint(), gPaused(%d) m_needsRepaint(%d) m_haveContents(%d) ", @@ -730,7 +738,7 @@ bool GraphicsLayerAndroid::repaint() // for the contents to be in the correct position. m_foregroundLayer->setPosition(-x, -y); // Set the scrollable bounds of the layer. - static_cast<ScrollableLayerAndroid*>(m_foregroundLayer)->setScrollLimits(-x, -y, m_size.width(), m_size.height()); + setScrollLimits(static_cast<ScrollableLayerAndroid*>(m_foregroundLayer), layer); // Invalidate the entire layer for now, as webkit will only send the // setNeedsDisplayInRect() for the visible (clipped) scrollable area, @@ -788,8 +796,7 @@ bool GraphicsLayerAndroid::repaint() // limits based on the view size. if (m_contentLayer->isIFrameContent()) { FrameView* view = layer->renderer()->frame()->view(); - static_cast<IFrameContentLayerAndroid*>(m_contentLayer)->setScrollLimits( - m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight()); + setScrollLimits(static_cast<ScrollableLayerAndroid*>(m_contentLayer), layer); ALOGV("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()); |