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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 RenderLayer* layer = this->layer(); | 750 RenderLayer* layer = this->layer(); |
751 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u
pdateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate)) | 751 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u
pdateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate)) |
752 layer->compositor()->setCompositingLayersNeedRebuild(); | 752 layer->compositor()->setCompositingLayersNeedRebuild(); |
753 } | 753 } |
754 | 754 |
755 void RenderLayerScrollableArea::updateAfterCompositingChange() | 755 void RenderLayerScrollableArea::updateAfterCompositingChange() |
756 { | 756 { |
757 layer()->updateScrollingStateAfterCompositingChange(); | 757 layer()->updateScrollingStateAfterCompositingChange(); |
758 } | 758 } |
759 | 759 |
| 760 void RenderLayerScrollableArea::updateAfterOverflowRecalc() |
| 761 { |
| 762 computeScrollDimensions(); |
| 763 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) { |
| 764 int clientWidth = m_box->pixelSnappedClientWidth(); |
| 765 horizontalScrollbar->setProportion(clientWidth, overflowRect().width()); |
| 766 } |
| 767 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { |
| 768 int clientHeight = m_box->pixelSnappedClientHeight(); |
| 769 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); |
| 770 } |
| 771 |
| 772 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); |
| 773 bool hasVerticalOverflow = this->hasVerticalOverflow(); |
| 774 bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); |
| 775 bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (ha
sVerticalScrollbar() != hasVerticalOverflow); |
| 776 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) |
| 777 m_box->setNeedsLayout(); |
| 778 } |
| 779 |
760 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const | 780 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const |
761 { | 781 { |
762 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); | 782 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); |
763 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); | 783 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); |
764 | 784 |
765 int x = std::max(std::min(scrollOffset.width(), maxX), 0); | 785 int x = std::max(std::min(scrollOffset.width(), maxX), 0); |
766 int y = std::max(std::min(scrollOffset.height(), maxY), 0); | 786 int y = std::max(std::min(scrollOffset.height(), maxY), 0); |
767 return IntSize(x, y); | 787 return IntSize(x, y); |
768 } | 788 } |
769 | 789 |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1527 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
1508 { | 1528 { |
1509 if (m_forceNeedsCompositedScrolling == mode) | 1529 if (m_forceNeedsCompositedScrolling == mode) |
1510 return; | 1530 return; |
1511 | 1531 |
1512 m_forceNeedsCompositedScrolling = mode; | 1532 m_forceNeedsCompositedScrolling = mode; |
1513 layer()->didUpdateNeedsCompositedScrolling(); | 1533 layer()->didUpdateNeedsCompositedScrolling(); |
1514 } | 1534 } |
1515 | 1535 |
1516 } // Namespace WebCore | 1536 } // Namespace WebCore |
OLD | NEW |