Chromium Code Reviews| 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. |