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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2258523006: Convert Settings::rootLayerScrolls to RuntimeEnabledFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add RAII-style helper to toggle REF. Rebase. Created 4 years, 3 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
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@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 return overflow == OverflowAuto || overflow == OverflowOverlay; 822 return overflow == OverflowAuto || overflow == OverflowOverlay;
823 } 823 }
824 824
825 // This function returns true if the given box requires overflow scrollbars (as 825 // This function returns true if the given box requires overflow scrollbars (as
826 // opposed to the 'viewport' scrollbars managed by the PaintLayerCompositor). 826 // opposed to the 'viewport' scrollbars managed by the PaintLayerCompositor).
827 // FIXME: we should use the same scrolling machinery for both the viewport and 827 // FIXME: we should use the same scrolling machinery for both the viewport and
828 // overflow. Currently, we need to avoid producing scrollbars here if they'll be 828 // overflow. Currently, we need to avoid producing scrollbars here if they'll be
829 // handled externally in the RLC. 829 // handled externally in the RLC.
830 static bool canHaveOverflowScrollbars(const LayoutBox& box) 830 static bool canHaveOverflowScrollbars(const LayoutBox& box)
831 { 831 {
832 bool rootLayerScrolls = box.document().settings() && box.document().settings ()->rootLayerScrolls(); 832 return (RuntimeEnabledFeatures::rootLayerScrollingEnabled() || !box.isLayout View()) && box.document().viewportDefiningElement() != box.node();
833 return (rootLayerScrolls || !box.isLayoutView()) && box.document().viewportD efiningElement() != box.node();
834 } 833 }
835 834
836 void PaintLayerScrollableArea::updateAfterStyleChange(const ComputedStyle* oldSt yle) 835 void PaintLayerScrollableArea::updateAfterStyleChange(const ComputedStyle* oldSt yle)
837 { 836 {
838 // Don't do this on first style recalc, before layout has ever happened. 837 // Don't do this on first style recalc, before layout has ever happened.
839 if (!overflowRect().size().isZero()) 838 if (!overflowRect().size().isZero())
840 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow()); 839 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow());
841 840
842 if (!canHaveOverflowScrollbars(box())) 841 if (!canHaveOverflowScrollbars(box()))
843 return; 842 return;
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1771
1773 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() 1772 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as()
1774 { 1773 {
1775 for (auto& scrollableArea : *s_needsClamp) 1774 for (auto& scrollableArea : *s_needsClamp)
1776 scrollableArea->clampScrollPositionsAfterLayout(); 1775 scrollableArea->clampScrollPositionsAfterLayout();
1777 delete s_needsClamp; 1776 delete s_needsClamp;
1778 s_needsClamp = nullptr; 1777 s_needsClamp = nullptr;
1779 } 1778 }
1780 1779
1781 } // namespace blink 1780 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698