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

Unified Diff: Source/web/PopupListBox.cpp

Issue 662733002: Clamp scroll offset to min/max in PopupListBox::updateScrollbars. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/web/PopupListBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupListBox.cpp
diff --git a/Source/web/PopupListBox.cpp b/Source/web/PopupListBox.cpp
index d895c68fb509baefa77e8e5f0c0d3dc361380dbc..22acfd9564f9d7ffe2aaaff426b3b26c02abb02f 100644
--- a/Source/web/PopupListBox.cpp
+++ b/Source/web/PopupListBox.cpp
@@ -966,7 +966,7 @@ IntRect PopupListBox::visibleContentRect(IncludeScrollbarsInRect scrollbarInclus
return IntRect(m_scrollOffset, size);
}
-void PopupListBox::updateScrollbars(const IntPoint& desiredOffset)
+void PopupListBox::updateScrollbars(IntPoint desiredOffset)
{
IntSize oldVisibleSize = visibleContentRect().size();
adjustScrollbarExistence();
@@ -979,6 +979,10 @@ void PopupListBox::updateScrollbars(const IntPoint& desiredOffset)
else
invalidateRect(IntRect(oldVisibleSize.width(), 0, newVisibleSize.width() - oldVisibleSize.width(), newVisibleSize.height()));
}
+
+ desiredOffset = desiredOffset.shrunkTo(maximumScrollPosition());
+ desiredOffset = desiredOffset.expandedTo(minimumScrollPosition());
+
if (desiredOffset != scrollPosition())
ScrollableArea::scrollToOffsetWithoutAnimation(desiredOffset);
}
« no previous file with comments | « Source/web/PopupListBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698