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

Unified Diff: Source/WebCore/platform/Scrollbar.cpp

Issue 6523001: Merge 78431 - Some Scrollbar functions assume an attached ScrollableArea but ... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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 | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/Scrollbar.cpp
===================================================================
--- Source/WebCore/platform/Scrollbar.cpp (revision 78504)
+++ Source/WebCore/platform/Scrollbar.cpp (working copy)
@@ -196,7 +196,7 @@
}
// Handle the arrows and track.
- if (scrollableArea()->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
+ if (m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
startTimerIfNeeded(delay);
}
@@ -268,7 +268,8 @@
if (delta) {
float newPosition = static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen);
- scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
+ if (m_scrollableArea)
+ m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
}
}
@@ -300,9 +301,10 @@
bool Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
{
if (m_pressedPart == ThumbPart) {
- if (theme()->shouldSnapBackToDragOrigin(this, evt))
- scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
- else {
+ if (theme()->shouldSnapBackToDragOrigin(this, evt)) {
+ if (m_scrollableArea)
+ m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
+ } else {
moveThumb(m_orientation == HorizontalScrollbar ?
convertFromContainingWindow(evt.pos()).x() :
convertFromContainingWindow(evt.pos()).y());
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698