| Index: Source/core/rendering/RenderLayer.cpp
|
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
|
| index 70f6a3e44e358bdcd4586651d1ec5fb1fe8afff1..b7a7b4dcb1a71e8581955d8ced29b10983ca54d7 100644
|
| --- a/Source/core/rendering/RenderLayer.cpp
|
| +++ b/Source/core/rendering/RenderLayer.cpp
|
| @@ -1329,6 +1329,29 @@ IntRect RenderLayer::scrollableAreaBoundingBox() const
|
| return renderer()->absoluteBoundingBoxRect();
|
| }
|
|
|
| +bool RenderLayer::userInputScrollable(ScrollbarOrientation orientation) const
|
| +{
|
| + RenderBox* box = renderBox();
|
| + ASSERT(box);
|
| +
|
| + EOverflow overflowStyle = (orientation == HorizontalScrollbar) ?
|
| + renderer()->style()->overflowX() : renderer()->style()->overflowY();
|
| + return (overflowStyle == OSCROLL || overflowStyle == OAUTO);
|
| +}
|
| +
|
| +int RenderLayer::pageStep(ScrollbarOrientation orientation) const
|
| +{
|
| + RenderBox* box = renderBox();
|
| + ASSERT(box);
|
| +
|
| + int length = (orientation == HorizontalScrollbar) ?
|
| + box->pixelSnappedClientWidth() : box->pixelSnappedClientHeight();
|
| + int minPageStep = static_cast<float>(length) * ScrollableArea::minFractionToStepWhenPaging();
|
| + int pageStep = max(minPageStep, length - ScrollableArea::maxOverlapBetweenPages());
|
| +
|
| + return max(pageStep, 1);
|
| +}
|
| +
|
| RenderLayer* RenderLayer::enclosingTransformedAncestor() const
|
| {
|
| RenderLayer* curr = parent();
|
| @@ -2489,8 +2512,13 @@ void RenderLayer::resize(const PlatformEvent& evt, const LayoutSize& oldOffset)
|
|
|
| int RenderLayer::scrollSize(ScrollbarOrientation orientation) const
|
| {
|
| - Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_hBar : m_vBar).get();
|
| - return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
|
| + RenderBox* box = renderBox();
|
| + ASSERT(box);
|
| +
|
| + if (orientation == HorizontalScrollbar)
|
| + return m_scrollSize.width() - box->pixelSnappedClientWidth();
|
| +
|
| + return m_scrollSize.height() - box->pixelSnappedClientHeight();
|
| }
|
|
|
| int RenderLayer::scrollPosition(Scrollbar* scrollbar) const
|
| @@ -2860,14 +2888,6 @@ void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
|
| scrollbar = 0;
|
| }
|
|
|
| -bool RenderLayer::scrollsOverflow() const
|
| -{
|
| - if (!renderer()->isBox())
|
| - return false;
|
| -
|
| - return toRenderBox(renderer())->scrollsOverflow();
|
| -}
|
| -
|
| void RenderLayer::setHasHorizontalScrollbar(bool hasScrollbar)
|
| {
|
| if (hasScrollbar == hasHorizontalScrollbar())
|
| @@ -3126,14 +3146,10 @@ void RenderLayer::updateScrollbarsAfterLayout()
|
| // Set up the range (and page step/line step).
|
| if (m_hBar) {
|
| int clientWidth = box->pixelSnappedClientWidth();
|
| - int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
|
| - m_hBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
|
| m_hBar->setProportion(clientWidth, m_scrollSize.width());
|
| }
|
| if (m_vBar) {
|
| int clientHeight = box->pixelSnappedClientHeight();
|
| - int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
|
| - m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
|
| m_vBar->setProportion(clientHeight, m_scrollSize.height());
|
| }
|
|
|
|
|