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

Unified Diff: Source/core/rendering/RenderListBox.cpp

Issue 16982005: Allow objects without scrollbars to be scrollable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Mac Build Fix Created 7 years, 6 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: Source/core/rendering/RenderListBox.cpp
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 6ebf5ef11adc88b1d929470a72ab6eb3e649c998..7ff31f489b7bc41a83257c33b7d57e651692be36 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -624,7 +624,7 @@ void RenderListBox::valueChanged(unsigned listIndex)
int RenderListBox::scrollSize(ScrollbarOrientation orientation) const
{
- return ((orientation == VerticalScrollbar) && m_vBar) ? (m_vBar->totalSize() - m_vBar->visibleSize()) : 0;
+ return orientation == VerticalScrollbar ? (numItems() - numVisibleItems()) : 0;
}
int RenderListBox::scrollPosition(Scrollbar*) const
@@ -632,6 +632,13 @@ int RenderListBox::scrollPosition(Scrollbar*) const
return m_indexOffset;
}
+IntPoint RenderListBox::scrollPosition() const
+{
+ int x = 0;
+ int y = m_indexOffset;
+ return IntPoint(x, y);
+}
+
void RenderListBox::setScrollOffset(const IntPoint& offset)
{
scrollTo(offset.y());
« Source/core/platform/ScrollableArea.cpp ('K') | « Source/core/rendering/RenderListBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698