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 "config.h" | 5 #include "config.h" |
6 #include "core/rendering/compositing/CompositingReasonFinder.h" | 6 #include "core/rendering/compositing/CompositingReasonFinder.h" |
7 | 7 |
8 #include "CSSPropertyNames.h" | 8 #include "CSSPropertyNames.h" |
9 #include "HTMLNames.h" | 9 #include "HTMLNames.h" |
10 #include "core/animation/ActiveAnimations.h" | 10 #include "core/animation/ActiveAnimations.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 bool CompositingReasonFinder::requiresCompositingForPosition(RenderObject* rende
rer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReas
on* viewportConstrainedNotCompositedReason, bool* needToRecomputeCompositingRequ
irements) const | 187 bool CompositingReasonFinder::requiresCompositingForPosition(RenderObject* rende
rer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReas
on* viewportConstrainedNotCompositedReason, bool* needToRecomputeCompositingRequ
irements) const |
188 { | 188 { |
189 // position:fixed elements that create their own stacking context (e.g. have
an explicit z-index, | 189 // position:fixed elements that create their own stacking context (e.g. have
an explicit z-index, |
190 // opacity, transform) can get their own composited layer. A stacking contex
t is required otherwise | 190 // opacity, transform) can get their own composited layer. A stacking contex
t is required otherwise |
191 // z-index and clipping will be broken. | 191 // z-index and clipping will be broken. |
192 if (!renderer->isPositioned()) | 192 if (!renderer->isPositioned()) |
193 return false; | 193 return false; |
194 | 194 |
195 EPosition position = renderer->style()->position(); | 195 EPosition position = renderer->style()->position(); |
196 bool isFixed = renderer->isOutOfFlowPositioned() && position == FixedPositio
n; | 196 bool isFixed = renderer->isOutOfFlowPositioned() && position == FixedPositio
n; |
| 197 // FIXME: The isStackingContainer check here is redundant. Fixed position el
ements are always stacking contexts. |
197 if (isFixed && !layer->stackingNode()->isStackingContainer()) | 198 if (isFixed && !layer->stackingNode()->isStackingContainer()) |
198 return false; | 199 return false; |
199 | 200 |
200 bool isSticky = renderer->isInFlowPositioned() && position == StickyPosition
; | 201 bool isSticky = renderer->isInFlowPositioned() && position == StickyPosition
; |
201 if (!isFixed && !isSticky) | 202 if (!isFixed && !isSticky) |
202 return false; | 203 return false; |
203 | 204 |
204 // FIXME: acceleratedCompositingForFixedPositionEnabled should probably be r
enamed acceleratedCompositingForViewportConstrainedPositionEnabled(). | 205 // FIXME: acceleratedCompositingForFixedPositionEnabled should probably be r
enamed acceleratedCompositingForViewportConstrainedPositionEnabled(). |
205 if (Settings* settings = m_renderView.document().settings()) { | 206 if (Settings* settings = m_renderView.document().settings()) { |
206 if (!settings->acceleratedCompositingForFixedPositionEnabled()) | 207 if (!settings->acceleratedCompositingForFixedPositionEnabled()) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 285 |
285 return true; | 286 return true; |
286 } | 287 } |
287 | 288 |
288 bool CompositingReasonFinder::requiresCompositingForOverflowScrolling(const Rend
erLayer* layer) const | 289 bool CompositingReasonFinder::requiresCompositingForOverflowScrolling(const Rend
erLayer* layer) const |
289 { | 290 { |
290 return layer->needsCompositedScrolling(); | 291 return layer->needsCompositedScrolling(); |
291 } | 292 } |
292 | 293 |
293 } | 294 } |
OLD | NEW |