| 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 | |
| 780 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const | 760 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const |
| 781 { | 761 { |
| 782 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); | 762 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); |
| 783 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); | 763 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); |
| 784 | 764 |
| 785 int x = std::max(std::min(scrollOffset.width(), maxX), 0); | 765 int x = std::max(std::min(scrollOffset.width(), maxX), 0); |
| 786 int y = std::max(std::min(scrollOffset.height(), maxY), 0); | 766 int y = std::max(std::min(scrollOffset.height(), maxY), 0); |
| 787 return IntSize(x, y); | 767 return IntSize(x, y); |
| 788 } | 768 } |
| 789 | 769 |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1508 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
| 1529 { | 1509 { |
| 1530 if (m_forceNeedsCompositedScrolling == mode) | 1510 if (m_forceNeedsCompositedScrolling == mode) |
| 1531 return; | 1511 return; |
| 1532 | 1512 |
| 1533 m_forceNeedsCompositedScrolling = mode; | 1513 m_forceNeedsCompositedScrolling = mode; |
| 1534 layer()->didUpdateNeedsCompositedScrolling(); | 1514 layer()->didUpdateNeedsCompositedScrolling(); |
| 1535 } | 1515 } |
| 1536 | 1516 |
| 1537 } // Namespace WebCore | 1517 } // Namespace WebCore |
| OLD | NEW |