| Index: Source/core/platform/ScrollView.cpp
|
| diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
|
| index 79dd29b7de9d91771665bda1a87fdbfa2f709ac0..47dec6a5e5dbcfb0442b5ad6259af3e9b0ba60b7 100644
|
| --- a/Source/core/platform/ScrollView.cpp
|
| +++ b/Source/core/platform/ScrollView.cpp
|
| @@ -49,7 +49,6 @@ ScrollView::ScrollView()
|
| , m_inUpdateScrollbars(false)
|
| , m_updateScrollbarsPass(0)
|
| , m_drawPanScrollIcon(false)
|
| - , m_useFixedLayout(false)
|
| , m_paintsEntireContents(false)
|
| , m_clipsRepaints(true)
|
| {
|
| @@ -188,18 +187,22 @@ void ScrollView::setClipsRepaints(bool clipsRepaints)
|
|
|
| IntSize ScrollView::unscaledVisibleContentSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
|
| {
|
| + return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(frameRect().size()) : frameRect().size();
|
| +}
|
| +
|
| +IntSize ScrollView::excludeScrollbars(const IntSize& size) const
|
| +{
|
| int verticalScrollbarWidth = 0;
|
| int horizontalScrollbarHeight = 0;
|
|
|
| - if (scrollbarInclusion == ExcludeScrollbars) {
|
| - if (Scrollbar* verticalBar = verticalScrollbar())
|
| - verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
|
| - if (Scrollbar* horizontalBar = horizontalScrollbar())
|
| - horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
|
| - }
|
| + if (Scrollbar* verticalBar = verticalScrollbar())
|
| + verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
|
| + if (Scrollbar* horizontalBar = horizontalScrollbar())
|
| + horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
|
| +
|
| + return IntSize(max(0, size.width() - verticalScrollbarWidth),
|
| + max(0, size.height() - horizontalScrollbarHeight));
|
|
|
| - return IntSize(max(0, width() - verticalScrollbarWidth),
|
| - max(0, height() - horizontalScrollbarHeight));
|
| }
|
|
|
| IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scollbarInclusion) const
|
| @@ -209,40 +212,6 @@ IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scol
|
| return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
|
| }
|
|
|
| -IntSize ScrollView::layoutSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
|
| -{
|
| - return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? unscaledVisibleContentSize(scrollbarInclusion) : m_fixedLayoutSize;
|
| -}
|
| -
|
| -IntSize ScrollView::fixedLayoutSize() const
|
| -{
|
| - return m_fixedLayoutSize;
|
| -}
|
| -
|
| -void ScrollView::setFixedLayoutSize(const IntSize& newSize)
|
| -{
|
| - if (fixedLayoutSize() == newSize)
|
| - return;
|
| - m_fixedLayoutSize = newSize;
|
| - updateScrollbars(scrollOffset());
|
| - if (m_useFixedLayout)
|
| - contentsResized();
|
| -}
|
| -
|
| -bool ScrollView::useFixedLayout() const
|
| -{
|
| - return m_useFixedLayout;
|
| -}
|
| -
|
| -void ScrollView::setUseFixedLayout(bool enable)
|
| -{
|
| - if (useFixedLayout() == enable)
|
| - return;
|
| - m_useFixedLayout = enable;
|
| - updateScrollbars(scrollOffset());
|
| - contentsResized();
|
| -}
|
| -
|
| IntSize ScrollView::contentsSize() const
|
| {
|
| return m_contentsSize;
|
| @@ -743,7 +712,7 @@ void ScrollView::setFrameRect(const IntRect& newRect)
|
|
|
| updateScrollbars(scrollOffset());
|
|
|
| - if (!m_useFixedLayout && oldRect.size() != newRect.size())
|
| + if (oldRect.size() != newRect.size())
|
| contentsResized();
|
| }
|
|
|
|
|