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

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

Issue 708283002: RLSA needsLayout on customscrollbar thickness change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: RenderBlock child needsLayout Created 6 years, 1 month 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
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 RenderLayerScrollableArea::RenderLayerScrollableArea(RenderLayer& layer) 81 RenderLayerScrollableArea::RenderLayerScrollableArea(RenderLayer& layer)
82 : m_layer(layer) 82 : m_layer(layer)
83 , m_inResizeMode(false) 83 , m_inResizeMode(false)
84 , m_scrollsOverflow(false) 84 , m_scrollsOverflow(false)
85 , m_scrollDimensionsDirty(true) 85 , m_scrollDimensionsDirty(true)
86 , m_inOverflowRelayout(false) 86 , m_inOverflowRelayout(false)
87 , m_nextTopmostScrollChild(0) 87 , m_nextTopmostScrollChild(0)
88 , m_topmostScrollChild(0) 88 , m_topmostScrollChild(0)
89 , m_needsCompositedScrolling(false) 89 , m_needsCompositedScrolling(false)
90 , m_horizontalScrollbarChanged(false)
91 , m_verticalScrollbarChanged(false)
90 , m_scrollCorner(nullptr) 92 , m_scrollCorner(nullptr)
91 , m_resizer(nullptr) 93 , m_resizer(nullptr)
92 { 94 {
93 ScrollableArea::setConstrainsScrollingToContentEdge(false); 95 ScrollableArea::setConstrainsScrollingToContentEdge(false);
94 96
95 Node* node = box().node(); 97 Node* node = box().node();
96 if (node && node->isElementNode()) { 98 if (node && node->isElementNode()) {
97 // We save and restore only the scrollOffset as the other scroll values are recalculated. 99 // We save and restore only the scrollOffset as the other scroll values are recalculated.
98 Element* element = toElement(node); 100 Element* element = toElement(node);
99 m_scrollOffset = element->savedLayerScrollOffset(); 101 m_scrollOffset = element->savedLayerScrollOffset();
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 ASSERT(hasHorizontalScrollbar()); 748 ASSERT(hasHorizontalScrollbar());
747 m_hBar->setEnabled(true); 749 m_hBar->setEnabled(true);
748 } 750 }
749 751
750 if (needsVerticalScrollbar && oldStyle && oldStyle->overflowY() == OSCROLL & & overflowY != OSCROLL) { 752 if (needsVerticalScrollbar && oldStyle && oldStyle->overflowY() == OSCROLL & & overflowY != OSCROLL) {
751 ASSERT(hasVerticalScrollbar()); 753 ASSERT(hasVerticalScrollbar());
752 m_vBar->setEnabled(true); 754 m_vBar->setEnabled(true);
753 } 755 }
754 756
755 // FIXME: Need to detect a swap from custom to native scrollbars (and vice v ersa). 757 // FIXME: Need to detect a swap from custom to native scrollbars (and vice v ersa).
756 if (m_hBar) 758 if (m_hBar) {
759 IntRect oldHrect = m_hBar->frameRect();
757 m_hBar->styleChanged(); 760 m_hBar->styleChanged();
758 if (m_vBar) 761 if ((oldHrect != m_hBar->frameRect()) && m_hBar->isCustomScrollbar())
762 m_horizontalScrollbarChanged = true;
763 }
764 if (m_vBar) {
765 IntRect oldVrect = m_vBar->frameRect();
759 m_vBar->styleChanged(); 766 m_vBar->styleChanged();
767 if ((oldVrect != m_vBar->frameRect()) && m_vBar->isCustomScrollbar())
768 m_verticalScrollbarChanged = true;
769 }
760 770
761 updateScrollCornerStyle(); 771 updateScrollCornerStyle();
762 updateResizerAreaSet(); 772 updateResizerAreaSet();
763 updateResizerStyle(); 773 updateResizerStyle();
764 } 774 }
765 775
776 bool RenderLayerScrollableArea::didCustomScrollbarRectChanged()
777 {
778 bool scrollbarRectChanged = false;
779 if (m_verticalScrollbarChanged || m_horizontalScrollbarChanged) {
780 scrollbarRectChanged = true;
781 m_verticalScrollbarChanged = false;
782 m_horizontalScrollbarChanged = false;
783 }
784 return scrollbarRectChanged;
785 }
786
766 bool RenderLayerScrollableArea::updateAfterCompositingChange() 787 bool RenderLayerScrollableArea::updateAfterCompositingChange()
767 { 788 {
768 layer()->updateScrollingStateAfterCompositingChange(); 789 layer()->updateScrollingStateAfterCompositingChange();
769 const bool layersChanged = m_topmostScrollChild != m_nextTopmostScrollChild; 790 const bool layersChanged = m_topmostScrollChild != m_nextTopmostScrollChild;
770 m_topmostScrollChild = m_nextTopmostScrollChild; 791 m_topmostScrollChild = m_nextTopmostScrollChild;
771 m_nextTopmostScrollChild = nullptr; 792 m_nextTopmostScrollChild = nullptr;
772 return layersChanged; 793 return layersChanged;
773 } 794 }
774 795
775 void RenderLayerScrollableArea::updateAfterOverflowRecalc() 796 void RenderLayerScrollableArea::updateAfterOverflowRecalc()
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) 1509 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild)
1489 { 1510 {
1490 // We only want to track the topmost scroll child for scrollable areas with 1511 // We only want to track the topmost scroll child for scrollable areas with
1491 // overlay scrollbars. 1512 // overlay scrollbars.
1492 if (!hasOverlayScrollbars()) 1513 if (!hasOverlayScrollbars())
1493 return; 1514 return;
1494 m_nextTopmostScrollChild = scrollChild; 1515 m_nextTopmostScrollChild = scrollChild;
1495 } 1516 }
1496 1517
1497 } // namespace blink 1518 } // namespace blink
OLDNEW
« Source/core/rendering/RenderBlock.cpp ('K') | « Source/core/rendering/RenderLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698