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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp

Issue 2382563002: Revert changes is the use of CompositingReasonOutOfFlowClipping
Patch Set: Add check for composited scrolling ancestor Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/compositing/CompositingReasonFinder.h" 5 #include "core/layout/compositing/CompositingReasonFinder.h"
6 6
7 #include "core/CSSPropertyNames.h" 7 #include "core/CSSPropertyNames.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // but the layoutObject may be an inline that doesn't support them. 136 // but the layoutObject may be an inline that doesn't support them.
137 return layoutObject->hasTransformRelatedProperty() && 137 return layoutObject->hasTransformRelatedProperty() &&
138 layoutObject->style()->has3DTransform(); 138 layoutObject->style()->has3DTransform();
139 } 139 }
140 140
141 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons( 141 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(
142 const PaintLayer* layer) const { 142 const PaintLayer* layer) const {
143 CompositingReasons directReasons = CompositingReasonNone; 143 CompositingReasons directReasons = CompositingReasonNone;
144 LayoutObject* layoutObject = layer->layoutObject(); 144 LayoutObject* layoutObject = layer->layoutObject();
145 145
146 if (layer->needsCompositedScrolling()) 146 bool checkForClipParent =
147 (m_compositingTriggers & OverflowScrollTrigger) &&
148 layer->ancestorScrollingLayer() &&
149 layer->ancestorScrollingLayer()->compositingState() ==
150 PaintsIntoOwnBacking;
151 if (layer->needsCompositedScrolling()) {
152 checkForClipParent = true;
147 directReasons |= CompositingReasonOverflowScrollingTouch; 153 directReasons |= CompositingReasonOverflowScrollingTouch;
154 }
155 if (checkForClipParent && layer->clipParent())
156 directReasons |= CompositingReasonOutOfFlowClipping;
148 157
149 // Composite |layer| if it is inside of an ancestor scrolling layer, but that 158 // Composite |layer| if it is inside of an ancestor scrolling layer, but that
150 // scrolling layer is not on the stacking context ancestor chain of |layer|. 159 // scrolling layer is not on the stacking context ancestor chain of |layer|.
151 // See the definition of the scrollParent property in Layer for more detail. 160 // See the definition of the scrollParent property in Layer for more detail.
152 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { 161 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) {
153 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent()) 162 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent())
154 directReasons |= CompositingReasonOverflowScrollingParent; 163 directReasons |= CompositingReasonOverflowScrollingParent;
155 } 164 }
156 165
157 // TODO(flackr): Rename functions and variables to include sticky position (i. e. ScrollDependentPosition rather than PositionFixed). 166 // TODO(flackr): Rename functions and variables to include sticky position (i. e. ScrollDependentPosition rather than PositionFixed).
(...skipping 28 matching lines...) Expand all
186 } 195 }
187 // Don't promote fixed position elements that are descendants of a non-view co ntainer, e.g. transformed elements. 196 // Don't promote fixed position elements that are descendants of a non-view co ntainer, e.g. transformed elements.
188 // They will stay fixed wrt the container rather than the enclosing frame. 197 // They will stay fixed wrt the container rather than the enclosing frame.
189 if (layer->scrollsWithViewport()) 198 if (layer->scrollsWithViewport())
190 return m_layoutView.frameView()->isScrollable(); 199 return m_layoutView.frameView()->isScrollable();
191 return layer->layoutObject()->style()->position() == StickyPosition && 200 return layer->layoutObject()->style()->position() == StickyPosition &&
192 layer->ancestorOverflowLayer()->scrollsOverflow(); 201 layer->ancestorOverflowLayer()->scrollsOverflow();
193 } 202 }
194 203
195 } // namespace blink 204 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698