OLD | NEW |
---|---|
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 Loading... | |
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/26 18:24:23
I don't understand why hasOverflowScrollTrigger()
Stephen Chennney
2016/08/26 18:42:08
hasOverflowScrollTrigger only checks for the Overf
| |
146 if (layer->clipParent()) | 146 if (layer->clipParent()) |
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. |
(...skipping 22 matching lines...) Expand all Loading... | |
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 |
OLD | NEW |