Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / scroll / ScrollView.cpp
index eddaabf..50acb87 100644 (file)
@@ -274,7 +274,9 @@ void ScrollView::scrollTo(const IntSize& newOffset)
     if (scrollbarsSuppressed())
         return;
 
-    m_pendingScrollDelta += scrollDelta;
+    repaintFixedElementsAfterScrolling();
+    scrollContents(scrollDelta);
+    updateFixedElementsAfterScrolling();
 }
 
 void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
@@ -513,15 +515,6 @@ IntRect ScrollView::rectToCopyOnScroll() const
     return scrollViewRect;
 }
 
-void ScrollView::scrollContentsIfNeeded()
-{
-    if (m_pendingScrollDelta.isZero())
-        return;
-    IntSize scrollDelta = m_pendingScrollDelta;
-    m_pendingScrollDelta = IntSize();
-    scrollContents(scrollDelta);
-}
-
 void ScrollView::scrollContents(const IntSize& scrollDelta)
 {
     HostWindow* window = hostWindow();
@@ -893,6 +886,7 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
         scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
         context->translate(x(), y());
         scrollViewDirtyRect.moveBy(-location());
+        context->clip(IntRect(IntPoint(), visibleAreaWithScrollbars.size()));
 
         paintScrollbars(context, scrollViewDirtyRect);
     }