Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 250773002: Reland "Recompute overflow after transform changes" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@build_hack
Patch Set: again... Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 RenderLayer* layer = this->layer(); 764 RenderLayer* layer = this->layer();
765 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate)) 765 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate))
766 layer->compositor()->setCompositingLayersNeedRebuild(); 766 layer->compositor()->setCompositingLayersNeedRebuild();
767 } 767 }
768 768
769 void RenderLayerScrollableArea::updateAfterCompositingChange() 769 void RenderLayerScrollableArea::updateAfterCompositingChange()
770 { 770 {
771 layer()->updateScrollingStateAfterCompositingChange(); 771 layer()->updateScrollingStateAfterCompositingChange();
772 } 772 }
773 773
774 void RenderLayerScrollableArea::updateAfterOverflowRecalc()
775 {
776 computeScrollDimensions();
777 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
778 int clientWidth = m_box.pixelSnappedClientWidth();
779 horizontalScrollbar->setProportion(clientWidth, overflowRect().width());
780 }
781 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
782 int clientHeight = m_box.pixelSnappedClientHeight();
783 verticalScrollbar->setProportion(clientHeight, overflowRect().height());
784 }
785
786 bool hasHorizontalOverflow = this->hasHorizontalOverflow();
787 bool hasVerticalOverflow = this->hasVerticalOverflow();
788 bool autoHorizontalScrollBarChanged = m_box.hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
789 bool autoVerticalScrollBarChanged = m_box.hasAutoVerticalScrollbar() && (has VerticalScrollbar() != hasVerticalOverflow);
790 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged)
791 m_box.setNeedsLayout();
792 }
793
774 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset ) const 794 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset ) const
775 { 795 {
776 int maxX = scrollWidth() - m_box.pixelSnappedClientWidth(); 796 int maxX = scrollWidth() - m_box.pixelSnappedClientWidth();
777 int maxY = scrollHeight() - m_box.pixelSnappedClientHeight(); 797 int maxY = scrollHeight() - m_box.pixelSnappedClientHeight();
778 798
779 int x = std::max(std::min(scrollOffset.width(), maxX), 0); 799 int x = std::max(std::min(scrollOffset.width(), maxX), 0);
780 int y = std::max(std::min(scrollOffset.height(), maxY), 0); 800 int y = std::max(std::min(scrollOffset.height(), maxY), 0);
781 return IntSize(x, y); 801 return IntSize(x, y);
782 } 802 }
783 803
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) 1542 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode)
1523 { 1543 {
1524 if (m_forceNeedsCompositedScrolling == mode) 1544 if (m_forceNeedsCompositedScrolling == mode)
1525 return; 1545 return;
1526 1546
1527 m_forceNeedsCompositedScrolling = mode; 1547 m_forceNeedsCompositedScrolling = mode;
1528 layer()->didUpdateNeedsCompositedScrolling(); 1548 layer()->didUpdateNeedsCompositedScrolling();
1529 } 1549 }
1530 1550
1531 } // Namespace WebCore 1551 } // Namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698