| 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 15 matching lines...) Expand all Loading... |
| 26 void CompositingInputsUpdater::update() | 26 void CompositingInputsUpdater::update() |
| 27 { | 27 { |
| 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 current = current->containingBlock(); |
| 37 for (current = current->parent(); current && !current->canContainFix
edPositionObjects(); current = current->parent()) { | |
| 38 // CSS clip applies to fixed position elements even for ancestor
s that are not what the | |
| 39 // fixed element is positioned with respect to. | |
| 40 if (current->hasClip()) { | |
| 41 ASSERT(current->hasLayer()); | |
| 42 return static_cast<const RenderLayerModelObject*>(current)->
layer(); | |
| 43 } | |
| 44 } | |
| 45 } else { | |
| 46 current = current->containingBlock(); | |
| 47 } | |
| 48 | 37 |
| 49 if (current->hasLayer()) | 38 if (current->hasLayer()) |
| 50 return static_cast<const RenderLayerModelObject*>(current)->layer(); | 39 return static_cast<const RenderLayerModelObject*>(current)->layer(); |
| 51 // Having clip or overflow clip forces the RenderObject to become a laye
r. | 40 // Having clip or overflow clip forces the RenderObject to become a laye
r. |
| 52 ASSERT(!current->hasClipOrOverflowClip()); | 41 ASSERT(!current->hasClipOrOverflowClip()); |
| 53 } | 42 } |
| 54 ASSERT_NOT_REACHED(); | 43 ASSERT_NOT_REACHED(); |
| 55 return 0; | 44 return 0; |
| 56 } | 45 } |
| 57 | 46 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 ASSERT(!layer->childNeedsCompositingInputsUpdate()); | 172 ASSERT(!layer->childNeedsCompositingInputsUpdate()); |
| 184 ASSERT(!layer->needsCompositingInputsUpdate()); | 173 ASSERT(!layer->needsCompositingInputsUpdate()); |
| 185 | 174 |
| 186 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib
ling()) | 175 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib
ling()) |
| 187 assertNeedsCompositingInputsUpdateBitsCleared(child); | 176 assertNeedsCompositingInputsUpdateBitsCleared(child); |
| 188 } | 177 } |
| 189 | 178 |
| 190 #endif | 179 #endif |
| 191 | 180 |
| 192 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |