Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp

Issue 2060273004: Fix asserts to account for the fact that SVG may have contains: paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698