| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 3718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3729 (shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) | 3729 (shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) |
| 3730 ? verticalScrollbar()->width() | 3730 ? verticalScrollbar()->width() |
| 3731 : 0, | 3731 : 0, |
| 3732 height() - thickness, | 3732 height() - thickness, |
| 3733 width() - (verticalScrollbar() ? verticalScrollbar()->width() : 0), | 3733 width() - (verticalScrollbar() ? verticalScrollbar()->width() : 0), |
| 3734 thickness); | 3734 thickness); |
| 3735 horizontalScrollbar()->setFrameRect(hBarRect); | 3735 horizontalScrollbar()->setFrameRect(hBarRect); |
| 3736 if (oldRect != horizontalScrollbar()->frameRect()) | 3736 if (oldRect != horizontalScrollbar()->frameRect()) |
| 3737 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); | 3737 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
| 3738 | 3738 |
| 3739 horizontalScrollbar()->setEnabled(contentsWidth() > clientWidth); | 3739 horizontalScrollbar()->setEnabled(contentsWidth() > clientWidth && |
| 3740 !scrollbarsHidden()); |
| 3740 horizontalScrollbar()->setProportion(clientWidth, contentsWidth()); | 3741 horizontalScrollbar()->setProportion(clientWidth, contentsWidth()); |
| 3741 horizontalScrollbar()->offsetDidChange(); | 3742 horizontalScrollbar()->offsetDidChange(); |
| 3742 } | 3743 } |
| 3743 | 3744 |
| 3744 if (verticalScrollbar()) { | 3745 if (verticalScrollbar()) { |
| 3745 int thickness = verticalScrollbar()->scrollbarThickness(); | 3746 int thickness = verticalScrollbar()->scrollbarThickness(); |
| 3746 int clientHeight = visibleHeight(); | 3747 int clientHeight = visibleHeight(); |
| 3747 IntRect oldRect(verticalScrollbar()->frameRect()); | 3748 IntRect oldRect(verticalScrollbar()->frameRect()); |
| 3748 IntRect vBarRect( | 3749 IntRect vBarRect( |
| 3749 shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - thickness), 0, | 3750 shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - thickness), 0, |
| 3750 thickness, | 3751 thickness, |
| 3751 height() - | 3752 height() - |
| 3752 (horizontalScrollbar() ? horizontalScrollbar()->height() : 0)); | 3753 (horizontalScrollbar() ? horizontalScrollbar()->height() : 0)); |
| 3753 verticalScrollbar()->setFrameRect(vBarRect); | 3754 verticalScrollbar()->setFrameRect(vBarRect); |
| 3754 if (oldRect != verticalScrollbar()->frameRect()) | 3755 if (oldRect != verticalScrollbar()->frameRect()) |
| 3755 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); | 3756 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
| 3756 | 3757 |
| 3757 verticalScrollbar()->setEnabled(contentsHeight() > clientHeight); | 3758 verticalScrollbar()->setEnabled(contentsHeight() > clientHeight && |
| 3759 !scrollbarsHidden()); |
| 3758 verticalScrollbar()->setProportion(clientHeight, contentsHeight()); | 3760 verticalScrollbar()->setProportion(clientHeight, contentsHeight()); |
| 3759 verticalScrollbar()->offsetDidChange(); | 3761 verticalScrollbar()->offsetDidChange(); |
| 3760 } | 3762 } |
| 3761 } | 3763 } |
| 3762 | 3764 |
| 3763 bool FrameView::adjustScrollbarExistence( | 3765 bool FrameView::adjustScrollbarExistence( |
| 3764 ComputeScrollbarExistenceOption option) { | 3766 ComputeScrollbarExistenceOption option) { |
| 3765 ASSERT(m_inUpdateScrollbars); | 3767 ASSERT(m_inUpdateScrollbars); |
| 3766 | 3768 |
| 3767 // If we came in here with the view already needing a layout, then go ahead | 3769 // If we came in here with the view already needing a layout, then go ahead |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3815 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && | 3817 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && |
| 3816 m_frame->isMainFrame(); | 3818 m_frame->isMainFrame(); |
| 3817 } | 3819 } |
| 3818 | 3820 |
| 3819 void FrameView::updateScrollbarsIfNeeded() { | 3821 void FrameView::updateScrollbarsIfNeeded() { |
| 3820 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || | 3822 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || |
| 3821 scrollOriginChanged()) | 3823 scrollOriginChanged()) |
| 3822 updateScrollbars(); | 3824 updateScrollbars(); |
| 3823 } | 3825 } |
| 3824 | 3826 |
| 3827 void FrameView::didChangeScrollbarsHidden() { |
| 3828 updateScrollbars(); |
| 3829 } |
| 3830 |
| 3825 void FrameView::updateScrollbars() { | 3831 void FrameView::updateScrollbars() { |
| 3826 m_needsScrollbarsUpdate = false; | 3832 m_needsScrollbarsUpdate = false; |
| 3827 | 3833 |
| 3828 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 3834 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 3829 return; | 3835 return; |
| 3830 | 3836 |
| 3831 // Avoid drawing two sets of scrollbars when visual viewport is enabled. | 3837 // Avoid drawing two sets of scrollbars when visual viewport is enabled. |
| 3832 if (visualViewportSuppliesScrollbars()) { | 3838 if (visualViewportSuppliesScrollbars()) { |
| 3833 m_scrollbarManager.setHasHorizontalScrollbar(false); | 3839 m_scrollbarManager.setHasHorizontalScrollbar(false); |
| 3834 m_scrollbarManager.setHasVerticalScrollbar(false); | 3840 m_scrollbarManager.setHasVerticalScrollbar(false); |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4540 DCHECK(m_frame->isMainFrame()); | 4546 DCHECK(m_frame->isMainFrame()); |
| 4541 return m_initialViewportSize.width(); | 4547 return m_initialViewportSize.width(); |
| 4542 } | 4548 } |
| 4543 | 4549 |
| 4544 int FrameView::initialViewportHeight() const { | 4550 int FrameView::initialViewportHeight() const { |
| 4545 DCHECK(m_frame->isMainFrame()); | 4551 DCHECK(m_frame->isMainFrame()); |
| 4546 return m_initialViewportSize.height(); | 4552 return m_initialViewportSize.height(); |
| 4547 } | 4553 } |
| 4548 | 4554 |
| 4549 } // namespace blink | 4555 } // namespace blink |
| OLD | NEW |