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

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

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the tests. 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 // 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Note that we ask the layoutObject if it has a transform, because the styl e may have transforms, 135 // Note that we ask the layoutObject if it has a transform, because the styl e may have transforms,
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() && layoutObject->style()- >has3DTransform(); 137 return layoutObject->hasTransformRelatedProperty() && layoutObject->style()- >has3DTransform();
138 } 138 }
139 139
140 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons t PaintLayer* layer) const 140 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons t PaintLayer* layer) const
141 { 141 {
142 CompositingReasons directReasons = CompositingReasonNone; 142 CompositingReasons directReasons = CompositingReasonNone;
143 LayoutObject* layoutObject = layer->layoutObject(); 143 LayoutObject* layoutObject = layer->layoutObject();
144 144
145 if (hasOverflowScrollTrigger()) { 145 if (hasOverflowScrollTrigger() || RuntimeEnabledFeatures::compositeOpaqueScr ollersEnabled()) {
flackr 2016/08/30 21:14:49 You mentioned that hasOverflowScrollTrigger() basi
Stephen Chennney 2016/08/31 20:50:20 I don't think we can remove it for the scrolling c
146 if (layer->clipParent()) 146 if (layer->clipParent())
flackr 2016/08/30 21:14:50 I'm concerned this condition combined with Runtime
Stephen Chennney 2016/08/31 20:50:20 I think I'll just adjust the logic.
flackr 2016/09/01 21:06:46 Sorry for the delay, I mistook this to mean you we
147 directReasons |= CompositingReasonOutOfFlowClipping; 147 directReasons |= CompositingReasonOutOfFlowClipping;
148 148
149 if (layer->needsCompositedScrolling()) 149 if (layer->needsCompositedScrolling())
150 directReasons |= CompositingReasonOverflowScrollingTouch; 150 directReasons |= CompositingReasonOverflowScrollingTouch;
151 } 151 }
152 152
153 // Composite |layer| if it is inside of an ancestor scrolling layer, but tha t 153 // Composite |layer| if it is inside of an ancestor scrolling layer, but tha t
154 // scrolling layer is not not on the stacking context ancestor chain of |lay er|. 154 // scrolling layer is not not on the stacking context ancestor chain of |lay er|.
155 // See the definition of the scrollParent property in Layer for more detail. 155 // See the definition of the scrollParent property in Layer for more detail.
156 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { 156 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) {
(...skipping 21 matching lines...) Expand all
178 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const 178 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const
179 { 179 {
180 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) 180 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
181 return false; 181 return false;
182 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. 182 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
183 // They will stay fixed wrt the container rather than the enclosing frame. 183 // They will stay fixed wrt the container rather than the enclosing frame.
184 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); 184 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e();
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698