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

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

Issue 203463007: Recompute overflow after transform changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 if (m_hBar) 731 if (m_hBar)
732 m_hBar->styleChanged(); 732 m_hBar->styleChanged();
733 if (m_vBar) 733 if (m_vBar)
734 m_vBar->styleChanged(); 734 m_vBar->styleChanged();
735 735
736 updateScrollCornerStyle(); 736 updateScrollCornerStyle();
737 updateResizerAreaSet(); 737 updateResizerAreaSet();
738 updateResizerStyle(); 738 updateResizerStyle();
739 } 739 }
740 740
741 void RenderLayerScrollableArea::updateAfterOverflowRecalc()
742 {
743 computeScrollDimensions();
744 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
745 int clientWidth = m_box->pixelSnappedClientWidth();
746 horizontalScrollbar->setProportion(clientWidth, overflowRect().width());
747 }
748 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
749 int clientHeight = m_box->pixelSnappedClientHeight();
750 verticalScrollbar->setProportion(clientHeight, overflowRect().height());
751 }
752
753 bool hasHorizontalOverflow = this->hasHorizontalOverflow();
754 bool hasVerticalOverflow = this->hasVerticalOverflow();
755 bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
756 bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (ha sVerticalScrollbar() != hasVerticalOverflow);
757 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged)
758 m_box->setNeedsLayout();
759 }
760
741 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset ) const 761 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset ) const
742 { 762 {
743 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth(); 763 int maxX = scrollWidth() - m_box->pixelSnappedClientWidth();
744 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight(); 764 int maxY = scrollHeight() - m_box->pixelSnappedClientHeight();
745 765
746 int x = std::max(std::min(scrollOffset.width(), maxX), 0); 766 int x = std::max(std::min(scrollOffset.width(), maxX), 0);
747 int y = std::max(std::min(scrollOffset.height(), maxY), 0); 767 int y = std::max(std::min(scrollOffset.height(), maxY), 0);
748 return IntSize(x, y); 768 return IntSize(x, y);
749 } 769 }
750 770
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) 1554 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode)
1535 { 1555 {
1536 if (m_forceNeedsCompositedScrolling == mode) 1556 if (m_forceNeedsCompositedScrolling == mode)
1537 return; 1557 return;
1538 1558
1539 m_forceNeedsCompositedScrolling = mode; 1559 m_forceNeedsCompositedScrolling = mode;
1540 layer()->didUpdateNeedsCompositedScrolling(); 1560 layer()->didUpdateNeedsCompositedScrolling();
1541 } 1561 }
1542 1562
1543 } // Namespace WebCore 1563 } // Namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698