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

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: CR Fixes 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..ca7b6c69207da6b8806882f6bc5ffef28b2e0799 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -176,7 +176,6 @@ void RenderListBox::layout()
if (m_vBar) {
bool enabled = numVisibleItems() < numItems();
m_vBar->setEnabled(enabled);
- m_vBar->setSteps(1, max(1, numVisibleItems() - 1), itemHeight());
m_vBar->setProportion(numVisibleItems(), numItems());
if (!enabled) {
scrollToOffsetWithoutAnimation(VerticalScrollbar, 0);
@@ -624,7 +623,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 +631,13 @@ int RenderListBox::scrollPosition(Scrollbar*) const
return m_indexOffset;
}
+IntPoint RenderListBox::scrollPosition() const
+{
+ int x = 0;
+ int y = m_indexOffset;
+ return IntPoint(x, y);
aelias_OOO_until_Jul13 2013/06/19 22:25:12 nit: return IntPoint(0, m_indexOffset);
bokan 2013/06/19 23:50:58 Done.
+}
+
void RenderListBox::setScrollOffset(const IntPoint& offset)
{
scrollTo(offset.y());
@@ -839,6 +845,26 @@ IntPoint RenderListBox::maximumScrollPosition() const
return IntPoint(0, numItems() - numVisibleItems());
}
+bool RenderListBox::userInputScrollable(ScrollbarOrientation orientation) const
+{
+ return orientation == VerticalScrollbar;
+}
+
+int RenderListBox::lineStep(ScrollbarOrientation) const
+{
+ return 1;
+}
+
+int RenderListBox::pageStep(ScrollbarOrientation orientation) const
+{
+ return max(1, numVisibleItems() - 1);
+}
+
+float RenderListBox::pixelStep(ScrollbarOrientation) const
+{
+ return 1.0f / itemHeight();
+}
+
ScrollableArea* RenderListBox::enclosingScrollableArea() const
{
// FIXME: Return a RenderLayer that's scrollable.
« 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