Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
index a3dba61d2e9123793929f28f84c13ddbbc9a166e..df8bee90fd3e601336d520763d395331406ec1fe 100644 |
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
@@ -63,7 +63,8 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea, |
&Scrollbar::autoscrollTimerFired), |
m_elasticOverscroll(0), |
m_trackNeedsRepaint(true), |
- m_thumbNeedsRepaint(true) { |
+ m_thumbNeedsRepaint(true), |
+ m_hitBeginOrEnd(true) { |
m_theme.registerScrollbar(*this); |
// FIXME: This is ugly and would not be necessary if we fix cross-platform |
@@ -130,8 +131,14 @@ void Scrollbar::offsetDidChange() { |
int oldThumbPosition = theme().thumbPosition(*this); |
m_currentPos = position; |
- ScrollbarPart invalidParts = |
- theme().invalidateOnThumbPositionChange(*this, oldPosition, position); |
+ bool oldHitBeginOrEnd = m_hitBeginOrEnd; |
+ int thumbPosition = theme().thumbPosition(*this); |
+ m_hitBeginOrEnd = |
+ thumbPosition == 0 || |
+ thumbPosition + theme().thumbLength(*this) == theme().trackLength(*this); |
+ |
+ ScrollbarPart invalidParts = theme().invalidateOnThumbPositionChange( |
+ *this, oldPosition, position, oldHitBeginOrEnd != m_hitBeginOrEnd); |
setNeedsPaintInvalidation(invalidParts); |
if (m_pressedPart == ThumbPart) |
@@ -647,4 +654,8 @@ void Scrollbar::setNeedsPaintInvalidation(ScrollbarPart invalidParts) { |
m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); |
} |
+bool Scrollbar::hasScrollCorner() const { |
+ return m_scrollableArea->hasLayerForScrollCorner(); |
+} |
+ |
} // namespace blink |