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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2258523006: Convert Settings::rootLayerScrolls to RuntimeEnabledFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & fix mistake Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index bb4e1e1e2a8dcc593eb8310eafde89370b6db053..97a8c5b5befe0c5357b5e4197a03caf9c12d6efd 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -848,7 +848,7 @@ void FrameView::performPreLayoutTasks()
bool FrameView::shouldPerformScrollAnchoring() const
{
return RuntimeEnabledFeatures::scrollAnchoringEnabled()
- && m_frame->settings() && !m_frame->settings()->rootLayerScrolls()
+ && !RuntimeEnabledFeatures::rootLayerScrollingEnabled()
&& m_scrollAnchor.hasScroller()
&& layoutBox()->style()->overflowAnchor() != AnchorNone;
}
@@ -1152,7 +1152,7 @@ void FrameView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
void FrameView::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState)
{
RELEASE_ASSERT(!layoutViewItem().isNull());
- if (!m_frame->settings() || !m_frame->settings()->rootLayerScrolls())
+ if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled())
invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState);
if (m_frame->selection().isCaretBoundsDirty())
@@ -1376,7 +1376,7 @@ void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged)
{
DCHECK(widthChanged || heightChanged);
- if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) {
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
// The background must be repainted when the FrameView is resized, even if the initial
// containing block does not change (so we can't rely on layout to issue the invalidation).
// This is because the background fills the main GraphicsLayer, which takes the size of the
@@ -2039,7 +2039,7 @@ void FrameView::scrollToFragmentAnchor()
LayoutRect rect;
if (anchorNode != m_frame->document()) {
rect = anchorNode->boundingBox();
- } else if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) {
+ } else if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
if (Element* documentElement = m_frame->document()->documentElement())
rect = documentElement->boundingBox();
}
@@ -3433,7 +3433,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
if (scrollDelta.isZero())
return;
- if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) {
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
// Don't scroll the FrameView!
ASSERT_NOT_REACHED();
}
@@ -3506,7 +3506,7 @@ void FrameView::computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool&
newHasHorizontalScrollbar = hasHorizontalScrollbar;
newHasVerticalScrollbar = hasVerticalScrollbar;
- if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return;
ScrollbarMode hScroll = m_horizontalScrollbarMode;
@@ -3669,7 +3669,7 @@ void FrameView::updateScrollbars()
{
m_needsScrollbarsUpdate = false;
- if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return;
// Avoid drawing two sets of scrollbars when visual viewport is enabled.
@@ -3933,7 +3933,7 @@ bool FrameView::userInputScrollable(ScrollbarOrientation orientation) const
if (fullscreenElement && fullscreenElement != document->documentElement())
return false;
- if (frame().settings() && frame().settings()->rootLayerScrolls())
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return false;
ScrollbarMode mode = (orientation == HorizontalScrollbar) ?
@@ -4147,8 +4147,7 @@ ScrollableArea* FrameView::getScrollableArea()
ScrollableArea* FrameView::layoutViewportScrollableArea()
{
- Settings* settings = frame().settings();
- if (!settings || !settings->rootLayerScrolls())
+ if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return this;
LayoutViewItem layoutViewItem = this->layoutViewItem();

Powered by Google App Engine
This is Rietveld 408576698