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

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: Fixed ScrollbarGroup pageStep Created 7 years, 5 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/core/rendering/RenderListBox.h ('k') | Source/web/ScrollbarGroup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderListBox.cpp
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 1771c60935b7dc3bdfcecd4b44dd71b3b1c74ffe..a2b87f84047719144d4471c79ae8e81333f30872 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);
@@ -625,12 +624,12 @@ 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
+IntPoint RenderListBox::scrollPosition() const
{
- return m_indexOffset;
+ return IntPoint(0, m_indexOffset);
}
void RenderListBox::setScrollOffset(const IntPoint& offset)
@@ -835,11 +834,36 @@ bool RenderListBox::scrollbarsCanBeActive() const
return view->frameView()->scrollbarsCanBeActive();
}
+IntPoint RenderListBox::minimumScrollPosition() const
+{
+ return IntPoint();
+}
+
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.
« no previous file with comments | « Source/core/rendering/RenderListBox.h ('k') | Source/web/ScrollbarGroup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698