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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 2763373002: Overlay scrollbars flush with window edge (Closed)
Patch Set: Created 3 years, 9 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
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

Powered by Google App Engine
This is Rietveld 408576698