#include "platform/scroll/ScrollableArea.h"
#include "platform/scroll/ScrollbarTheme.h"
-using namespace std;
-
#if ((OS(POSIX) && !OS(MACOSX)) || OS(WIN))
// The position of the scrollbar thumb affects the appearance of the steppers, so
// when the thumb moves, we have to invalidate them for painting.
ScrollView* Scrollbar::parentScrollView() const
{
- return toScrollView(parent());
-}
-
-ScrollView* Scrollbar::rootScrollView() const
-{
- return toScrollView(root());
+ return parent() && parent()->isScrollView() ? toScrollView(parent()) : 0;
}
ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const
int thumbLen = theme()->thumbLength(this);
int trackLen = theme()->trackLength(this);
if (delta > 0)
- delta = min(trackLen - thumbLen - thumbPos, delta);
+ delta = std::min(trackLen - thumbLen - thumbPos, delta);
else if (delta < 0)
- delta = max(-thumbPos, delta);
+ delta = std::max(-thumbPos, delta);
float minPos = m_scrollableArea->minimumScrollPosition(m_orientation);
float maxPos = m_scrollableArea->maximumScrollPosition(m_orientation);