diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp index 27a7df5..ab7f566 100644 --- a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp @@ -5,6 +5,11 @@ #if USE(ACCELERATED_COMPOSITING) +#include <wtf/CurrentTime.h> +#include <cutils/log.h> +#include <wtf/text/CString.h> +#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ScrollableLayerAndroid", __VA_ARGS__) + namespace WebCore { bool ScrollableLayerAndroid::scrollTo(int x, int y) @@ -16,8 +21,15 @@ bool ScrollableLayerAndroid::scrollTo(int x, int y) SkScalar newX = SkScalarPin(x, scrollBounds.x(), scrollBounds.width()); SkScalar newY = SkScalarPin(y, scrollBounds.y(), scrollBounds.height()); // Check for no change. - if (newX == m_offset.x() && newY == m_offset.y()) - return false; + if (isIFrame()) { + if (newX == m_iframeScrollOffset.x() && newY == m_iframeScrollOffset.y()) + return false; + newX = newX - m_iframeScrollOffset.x(); + newY = newY - m_iframeScrollOffset.y(); + } else { + if (newX == m_offset.x() && newY == m_offset.y()) + return false; + } setScrollOffset(IntPoint(newX, newY)); return true; } @@ -34,8 +46,17 @@ void ScrollableLayerAndroid::getScrollBounds(IntRect* out) const void ScrollableLayerAndroid::getScrollRect(SkIRect* out) const { const SkPoint& pos = getPosition(); - out->fLeft = m_scrollLimits.fLeft - pos.fX + m_offset.x(); + out->fLeft = m_scrollLimits.fLeft - pos.fX; out->fTop = m_scrollLimits.fTop - pos.fY + m_offset.y(); + + if (isIFrame()) { + out->fLeft += m_iframeScrollOffset.x(); + out->fTop += m_iframeScrollOffset.y(); + } else { + out->fLeft += m_offset.x(); + out->fTop += m_offset.y(); + } + out->fRight = getSize().width() - m_scrollLimits.width(); out->fBottom = getSize().height() - m_scrollLimits.height(); } |