OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 if (m_hBar) | 742 if (m_hBar) |
743 m_hBar->styleChanged(); | 743 m_hBar->styleChanged(); |
744 if (m_vBar) | 744 if (m_vBar) |
745 m_vBar->styleChanged(); | 745 m_vBar->styleChanged(); |
746 | 746 |
747 updateScrollCornerStyle(); | 747 updateScrollCornerStyle(); |
748 updateResizerAreaSet(); | 748 updateResizerAreaSet(); |
749 updateResizerStyle(); | 749 updateResizerStyle(); |
750 } | 750 } |
751 | 751 |
| 752 void RenderLayerScrollableArea::updateAfterOverflowRecalc() |
| 753 { |
| 754 computeScrollDimensions(); |
| 755 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) { |
| 756 int clientWidth = m_box->pixelSnappedClientWidth(); |
| 757 horizontalScrollbar->setProportion(clientWidth, overflowRect().width()); |
| 758 } |
| 759 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { |
| 760 int clientHeight = m_box->pixelSnappedClientHeight(); |
| 761 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); |
| 762 } |
| 763 |
| 764 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); |
| 765 bool hasVerticalOverflow = this->hasVerticalOverflow(); |
| 766 bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); |
| 767 bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (ha
sVerticalScrollbar() != hasVerticalOverflow); |
| 768 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) |
| 769 m_box->setNeedsLayout(); |
| 770 } |
| 771 |
752 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const | 772 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const |
753 { | 773 { |
754 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); | 774 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); |
755 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); | 775 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); |
756 | 776 |
757 int x = std::max(std::min(scrollOffset.width(), maxX), 0); | 777 int x = std::max(std::min(scrollOffset.width(), maxX), 0); |
758 int y = std::max(std::min(scrollOffset.height(), maxY), 0); | 778 int y = std::max(std::min(scrollOffset.height(), maxY), 0); |
759 return IntSize(x, y); | 779 return IntSize(x, y); |
760 } | 780 } |
761 | 781 |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1565 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
1546 { | 1566 { |
1547 if (m_forceNeedsCompositedScrolling == mode) | 1567 if (m_forceNeedsCompositedScrolling == mode) |
1548 return; | 1568 return; |
1549 | 1569 |
1550 m_forceNeedsCompositedScrolling = mode; | 1570 m_forceNeedsCompositedScrolling = mode; |
1551 layer()->didUpdateNeedsCompositedScrolling(); | 1571 layer()->didUpdateNeedsCompositedScrolling(); |
1552 } | 1572 } |
1553 | 1573 |
1554 } // Namespace WebCore | 1574 } // Namespace WebCore |
OLD | NEW |