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() && layer->clipParent()) |
146 if (layer->clipParent()) | 146 directReasons |= CompositingReasonOutOfFlowClipping; |
chrishtr
2016/09/02 01:19:38
Why doesn't this apply to low-DPI composited scrol
Stephen Chennney
2016/09/07 19:57:54
It presumably should, but note that flackr had con
| |
147 directReasons |= CompositingReasonOutOfFlowClipping; | |
148 | 147 |
149 if (layer->needsCompositedScrolling()) | 148 if (layer->needsCompositedScrolling()) |
150 directReasons |= CompositingReasonOverflowScrollingTouch; | 149 directReasons |= CompositingReasonOverflowScrollingTouch; |
151 } | |
152 | 150 |
153 // Composite |layer| if it is inside of an ancestor scrolling layer, but tha t | 151 // 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|. | 152 // 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. | 153 // See the definition of the scrollParent property in Layer for more detail. |
156 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { | 154 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { |
157 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent ()) | 155 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent ()) |
158 directReasons |= CompositingReasonOverflowScrollingParent; | 156 directReasons |= CompositingReasonOverflowScrollingParent; |
159 } | 157 } |
160 | 158 |
161 if (requiresCompositingForPositionFixed(layer)) | 159 if (requiresCompositingForPositionFixed(layer)) |
(...skipping 16 matching lines...) Expand all Loading... | |
178 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const | 176 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const |
179 { | 177 { |
180 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 178 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
181 return false; | 179 return false; |
182 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. | 180 // 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. | 181 // They will stay fixed wrt the container rather than the enclosing frame. |
184 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); | 182 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); |
185 } | 183 } |
186 | 184 |
187 } // namespace blink | 185 } // namespace blink |
OLD | NEW |