| 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/CompositingInputsUpdater.h" | 5 #include "core/layout/compositing/CompositingInputsUpdater.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutBlock.h" | 8 #include "core/layout/LayoutBlock.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "core/layout/compositing/CompositedLayerMapping.h" | 10 #include "core/layout/compositing/CompositedLayerMapping.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 static const PaintLayer* findParentLayerOnClippingContainerChain(const PaintLaye
r* layer) | 33 static const PaintLayer* findParentLayerOnClippingContainerChain(const PaintLaye
r* layer) |
| 34 { | 34 { |
| 35 LayoutObject* current = layer->layoutObject(); | 35 LayoutObject* current = layer->layoutObject(); |
| 36 while (current) { | 36 while (current) { |
| 37 if (current->style()->position() == FixedPosition) { | 37 if (current->style()->position() == FixedPosition) { |
| 38 for (current = current->parent(); current && !current->canContainFix
edPositionObjects(); current = current->parent()) { | 38 for (current = current->parent(); current && !current->canContainFix
edPositionObjects(); current = current->parent()) { |
| 39 // CSS clip applies to fixed position elements even for ancestor
s that are not what the | 39 // CSS clip applies to fixed position elements even for ancestor
s that are not what the |
| 40 // fixed element is positioned with respect to. | 40 // fixed element is positioned with respect to. |
| 41 if (current->hasClip()) { | 41 if (current->hasClip()) { |
| 42 ASSERT(current->hasLayer()); | 42 DCHECK(current->hasLayer()); |
| 43 return static_cast<const LayoutBoxModelObject*>(current)->la
yer(); | 43 return static_cast<const LayoutBoxModelObject*>(current)->la
yer(); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } else { | 46 } else { |
| 47 current = current->containingBlock(); | 47 current = current->containingBlock(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 if (current->hasLayer()) | 50 if (current->hasLayer()) |
| 51 return static_cast<const LayoutBoxModelObject*>(current)->layer(); | 51 return static_cast<const LayoutBoxModelObject*>(current)->layer(); |
| 52 // Having clip or overflow clip forces the LayoutObject to become a laye
r. | 52 // Having clip or overflow clip forces the LayoutObject to become a laye
r, except for contains: paint, which may apply to SVG. |
| 53 ASSERT(!current->hasClipRelatedProperty()); | 53 // SVG (other than LayoutSVGRoot) cannot have PaintLayers. |
| 54 DCHECK(!current->hasClipRelatedProperty() || current->styleRef().contain
sPaint()); |
| 54 } | 55 } |
| 55 ASSERT_NOT_REACHED(); | 56 ASSERT_NOT_REACHED(); |
| 56 return nullptr; | 57 return nullptr; |
| 57 } | 58 } |
| 58 | 59 |
| 59 static const PaintLayer* findParentLayerOnContainingBlockChain(const LayoutObjec
t* object) | 60 static const PaintLayer* findParentLayerOnContainingBlockChain(const LayoutObjec
t* object) |
| 60 { | 61 { |
| 61 for (const LayoutObject* current = object; current; current = current->conta
iningBlock()) { | 62 for (const LayoutObject* current = object; current; current = current->conta
iningBlock()) { |
| 62 if (current->hasLayer()) | 63 if (current->hasLayer()) |
| 63 return static_cast<const LayoutBoxModelObject*>(current)->layer(); | 64 return static_cast<const LayoutBoxModelObject*>(current)->layer(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 ASSERT(!layer->childNeedsCompositingInputsUpdate()); | 215 ASSERT(!layer->childNeedsCompositingInputsUpdate()); |
| 215 ASSERT(!layer->needsCompositingInputsUpdate()); | 216 ASSERT(!layer->needsCompositingInputsUpdate()); |
| 216 | 217 |
| 217 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) | 218 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) |
| 218 assertNeedsCompositingInputsUpdateBitsCleared(child); | 219 assertNeedsCompositingInputsUpdateBitsCleared(child); |
| 219 } | 220 } |
| 220 | 221 |
| 221 #endif | 222 #endif |
| 222 | 223 |
| 223 } // namespace blink | 224 } // namespace blink |
| OLD | NEW |