Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: WebCore/platform/ScrollView.cpp

Issue 3364013: Merge 67001 - 2010-09-08 Peter Kasting <pkasting@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/platform/ScrollView.h ('k') | WebCore/platform/Scrollbar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/ScrollView.cpp
===================================================================
--- WebCore/platform/ScrollView.cpp (revision 67003)
+++ WebCore/platform/ScrollView.cpp (working copy)
@@ -273,6 +273,20 @@
return IntPoint(maximumOffset.width(), maximumOffset.height());
}
+int ScrollView::scrollSize(ScrollbarOrientation orientation) const
+{
+ Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
+ return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
+}
+
+void ScrollView::setScrollOffsetFromAnimation(const IntPoint& offset)
+{
+ if (m_horizontalScrollbar)
+ m_horizontalScrollbar->setValue(offset.x(), Scrollbar::FromScrollAnimator);
+ if (m_verticalScrollbar)
+ m_verticalScrollbar->setValue(offset.y(), Scrollbar::FromScrollAnimator);
+}
+
void ScrollView::valueChanged(Scrollbar* scrollbar)
{
// Figure out if we really moved.
@@ -441,7 +455,7 @@
m_horizontalScrollbar->setSuppressInvalidation(true);
m_horizontalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
- m_horizontalScrollbar->setValue(scroll.width());
+ m_horizontalScrollbar->setValue(scroll.width(), Scrollbar::NotFromScrollAnimator);
if (m_scrollbarsSuppressed)
m_horizontalScrollbar->setSuppressInvalidation(false);
}
@@ -463,7 +477,7 @@
m_verticalScrollbar->setSuppressInvalidation(true);
m_verticalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
- m_verticalScrollbar->setValue(scroll.height());
+ m_verticalScrollbar->setValue(scroll.height(), Scrollbar::NotFromScrollAnimator);
if (m_scrollbarsSuppressed)
m_verticalScrollbar->setSuppressInvalidation(false);
}
@@ -673,7 +687,12 @@
if (negative)
deltaY = -deltaY;
}
- scrollBy(IntSize(-deltaX, -deltaY));
+
+ // Should we fall back on scrollBy() if there is no scrollbar for a non-zero delta?
+ if (deltaY && m_verticalScrollbar)
+ m_verticalScrollbar->scroll(ScrollUp, ScrollByPixel, deltaY);
+ if (deltaX && m_horizontalScrollbar)
+ m_horizontalScrollbar->scroll(ScrollLeft, ScrollByPixel, deltaX);
}
}
« no previous file with comments | « WebCore/platform/ScrollView.h ('k') | WebCore/platform/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698