OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 | 652 |
653 void PaintLayerScrollableArea::updateScrollDimensions() { | 653 void PaintLayerScrollableArea::updateScrollDimensions() { |
654 if (m_overflowRect.size() != box().layoutOverflowRect().size()) | 654 if (m_overflowRect.size() != box().layoutOverflowRect().size()) |
655 contentsResized(); | 655 contentsResized(); |
656 m_overflowRect = box().layoutOverflowRect(); | 656 m_overflowRect = box().layoutOverflowRect(); |
657 box().flipForWritingMode(m_overflowRect); | 657 box().flipForWritingMode(m_overflowRect); |
658 updateScrollOrigin(); | 658 updateScrollOrigin(); |
659 } | 659 } |
660 | 660 |
661 void PaintLayerScrollableArea::updateScrollbarEnabledState() { | 661 void PaintLayerScrollableArea::updateScrollbarEnabledState() { |
662 bool forceDisabled = | 662 bool forceDisable = |
663 ScrollbarTheme::theme().shouldDisableInvisibleScrollbars() && | 663 ScrollbarTheme::theme().shouldDisableInvisibleScrollbars() && |
664 scrollbarsHidden(); | 664 scrollbarsHidden(); |
665 // overflow:scroll should just enable/disable. | 665 |
666 if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar()) { | 666 if (horizontalScrollbar()) |
667 horizontalScrollbar()->setEnabled(hasHorizontalOverflow() && | 667 horizontalScrollbar()->setEnabled(hasHorizontalOverflow() && !forceDisable); |
668 !forceDisabled); | 668 if (verticalScrollbar()) |
669 } | 669 verticalScrollbar()->setEnabled(hasVerticalOverflow() && !forceDisable); |
670 if (box().style()->overflowY() == OverflowScroll && verticalScrollbar()) { | |
671 verticalScrollbar()->setEnabled(hasVerticalOverflow() && !forceDisabled); | |
672 } | |
673 } | 670 } |
674 | 671 |
675 void PaintLayerScrollableArea::setScrollOffsetUnconditionally( | 672 void PaintLayerScrollableArea::setScrollOffsetUnconditionally( |
676 const ScrollOffset& offset, | 673 const ScrollOffset& offset, |
677 ScrollType scrollType) { | 674 ScrollType scrollType) { |
678 cancelScrollAnimation(); | 675 cancelScrollAnimation(); |
679 scrollOffsetChanged(offset, scrollType); | 676 scrollOffsetChanged(offset, scrollType); |
680 } | 677 } |
681 | 678 |
682 void PaintLayerScrollableArea::updateAfterLayout() { | 679 void PaintLayerScrollableArea::updateAfterLayout() { |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 | 2002 |
2006 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2003 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
2007 clampScrollableAreas() { | 2004 clampScrollableAreas() { |
2008 for (auto& scrollableArea : *s_needsClamp) | 2005 for (auto& scrollableArea : *s_needsClamp) |
2009 scrollableArea->clampScrollOffsetsAfterLayout(); | 2006 scrollableArea->clampScrollOffsetsAfterLayout(); |
2010 delete s_needsClamp; | 2007 delete s_needsClamp; |
2011 s_needsClamp = nullptr; | 2008 s_needsClamp = nullptr; |
2012 } | 2009 } |
2013 | 2010 |
2014 } // namespace blink | 2011 } // namespace blink |
OLD | NEW |