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/CompositingInputsUpdater.h" | 6 #include "core/rendering/compositing/CompositingInputsUpdater.h" |
7 | 7 |
8 #include "core/rendering/RenderBlock.h" | 8 #include "core/rendering/RenderBlock.h" |
9 #include "core/rendering/RenderLayer.h" | 9 #include "core/rendering/RenderLayer.h" |
10 #include "core/rendering/compositing/CompositedLayerMapping.h" | 10 #include "core/rendering/compositing/CompositedLayerMapping.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 TRACE_EVENT0("blink", "CompositingInputsUpdater::update"); | 28 TRACE_EVENT0("blink", "CompositingInputsUpdater::update"); |
29 updateRecursive(m_rootRenderLayer, DoNotForceUpdate, AncestorInfo()); | 29 updateRecursive(m_rootRenderLayer, DoNotForceUpdate, AncestorInfo()); |
30 } | 30 } |
31 | 31 |
32 static const RenderLayer* findParentLayerOnClippingContainerChain(const RenderLa
yer* layer) | 32 static const RenderLayer* findParentLayerOnClippingContainerChain(const RenderLa
yer* layer) |
33 { | 33 { |
34 RenderObject* current = layer->renderer(); | 34 RenderObject* current = layer->renderer(); |
35 while (current) { | 35 while (current) { |
36 if (current->style()->position() == FixedPosition) { | 36 if (current->style()->position() == FixedPosition) { |
37 for (current = current->parent(); current && !current->canContainFix
edPositionObjects(); current = current->parent()) { | 37 for (current = current->parent(); current && !current->canContainFix
edPositionObjects(); current = current->parent()) { |
| 38 // All types of clips apply to fixed-position descendants of oth
er fixed-position elements. |
| 39 // Note: it's unclear whether this is what the spec says. Firefo
x does not clip, but Chrome does. |
| 40 if (current->style()->position() == FixedPosition && current->ha
sClipOrOverflowClip()) { |
| 41 ASSERT(current->hasLayer()); |
| 42 return static_cast<const RenderLayerModelObject*>(current)->
layer(); |
| 43 } |
| 44 |
38 // CSS clip applies to fixed position elements even for ancestor
s that are not what the | 45 // CSS clip applies to fixed position elements even for ancestor
s that are not what the |
39 // fixed element is positioned with respect to. | 46 // fixed element is positioned with respect to. |
40 if (current->hasClip()) { | 47 if (current->hasClip()) { |
41 ASSERT(current->hasLayer()); | 48 ASSERT(current->hasLayer()); |
42 return static_cast<const RenderLayerModelObject*>(current)->
layer(); | 49 return static_cast<const RenderLayerModelObject*>(current)->
layer(); |
43 } | 50 } |
44 } | 51 } |
45 } else { | 52 } else { |
46 current = current->containingBlock(); | 53 current = current->containingBlock(); |
47 } | 54 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ASSERT(!layer->childNeedsCompositingInputsUpdate()); | 190 ASSERT(!layer->childNeedsCompositingInputsUpdate()); |
184 ASSERT(!layer->needsCompositingInputsUpdate()); | 191 ASSERT(!layer->needsCompositingInputsUpdate()); |
185 | 192 |
186 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib
ling()) | 193 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib
ling()) |
187 assertNeedsCompositingInputsUpdateBitsCleared(child); | 194 assertNeedsCompositingInputsUpdateBitsCleared(child); |
188 } | 195 } |
189 | 196 |
190 #endif | 197 #endif |
191 | 198 |
192 } // namespace blink | 199 } // namespace blink |
OLD | NEW |