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

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

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // fields. 48 // fields.
49 if (firstChild()->node()) 49 if (firstChild()->node())
50 firstChild()->node()->setLayoutObject(nullptr); 50 firstChild()->node()->setLayoutObject(nullptr);
51 firstChild()->destroy(); 51 firstChild()->destroy();
52 } 52 }
53 } 53 }
54 54
55 LayoutObject* LayoutObjectChildList::removeChildNode(LayoutObject* owner, 55 LayoutObject* LayoutObjectChildList::removeChildNode(LayoutObject* owner,
56 LayoutObject* oldChild, 56 LayoutObject* oldChild,
57 bool notifyLayoutObject) { 57 bool notifyLayoutObject) {
58 ASSERT(oldChild->parent() == owner); 58 DCHECK_EQ(oldChild->parent(), owner);
59 ASSERT(this == owner->virtualChildren()); 59 DCHECK_EQ(this, owner->virtualChildren());
60 60
61 if (oldChild->isFloatingOrOutOfFlowPositioned()) 61 if (oldChild->isFloatingOrOutOfFlowPositioned())
62 toLayoutBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists(); 62 toLayoutBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists();
63 63
64 if (!owner->documentBeingDestroyed()) { 64 if (!owner->documentBeingDestroyed()) {
65 // So that we'll get the appropriate dirty bit set (either that a normal 65 // So that we'll get the appropriate dirty bit set (either that a normal
66 // flow child got yanked or that a positioned child got yanked). We also 66 // flow child got yanked or that a positioned child got yanked). We also
67 // issue paint invalidations, so that the area exposed when the child 67 // issue paint invalidations, so that the area exposed when the child
68 // disappears gets paint invalidated properly. 68 // disappears gets paint invalidated properly.
69 if (notifyLayoutObject && oldChild->everHadLayout()) 69 if (notifyLayoutObject && oldChild->everHadLayout())
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 cache->childrenChanged(owner); 122 cache->childrenChanged(owner);
123 123
124 return oldChild; 124 return oldChild;
125 } 125 }
126 126
127 DISABLE_CFI_PERF 127 DISABLE_CFI_PERF
128 void LayoutObjectChildList::insertChildNode(LayoutObject* owner, 128 void LayoutObjectChildList::insertChildNode(LayoutObject* owner,
129 LayoutObject* newChild, 129 LayoutObject* newChild,
130 LayoutObject* beforeChild, 130 LayoutObject* beforeChild,
131 bool notifyLayoutObject) { 131 bool notifyLayoutObject) {
132 ASSERT(!newChild->parent()); 132 DCHECK(!newChild->parent());
133 ASSERT(this == owner->virtualChildren()); 133 DCHECK_EQ(this, owner->virtualChildren());
134 ASSERT(!owner->isLayoutBlockFlow() || 134 DCHECK(!owner->isLayoutBlockFlow() ||
135 (!newChild->isTableSection() && !newChild->isTableRow() && 135 (!newChild->isTableSection() && !newChild->isTableRow() &&
136 !newChild->isTableCell())); 136 !newChild->isTableCell()));
137 137
138 while (beforeChild && beforeChild->parent() && beforeChild->parent() != owner) 138 while (beforeChild && beforeChild->parent() && beforeChild->parent() != owner)
139 beforeChild = beforeChild->parent(); 139 beforeChild = beforeChild->parent();
140 140
141 // This should never happen, but if it does prevent layout tree corruption 141 // This should never happen, but if it does prevent layout tree corruption
142 // where child->parent() ends up being owner but 142 // where child->parent() ends up being owner but
143 // child->nextSibling()->parent() is not owner. 143 // child->nextSibling()->parent() is not owner.
144 if (beforeChild && beforeChild->parent() != owner) { 144 if (beforeChild && beforeChild->parent() != owner) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (oldChild.isBody()) 202 if (oldChild.isBody())
203 oldChild.view()->setShouldDoFullPaintInvalidation(); 203 oldChild.view()->setShouldDoFullPaintInvalidation();
204 ObjectPaintInvalidator paintInvalidator(oldChild); 204 ObjectPaintInvalidator paintInvalidator(oldChild);
205 paintInvalidator.slowSetPaintingLayerNeedsRepaint(); 205 paintInvalidator.slowSetPaintingLayerNeedsRepaint();
206 paintInvalidator.invalidatePaintOfPreviousVisualRect( 206 paintInvalidator.invalidatePaintOfPreviousVisualRect(
207 oldChild.containerForPaintInvalidation(), 207 oldChild.containerForPaintInvalidation(),
208 PaintInvalidationLayoutObjectRemoval); 208 PaintInvalidationLayoutObjectRemoval);
209 } 209 }
210 210
211 } // namespace blink 211 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObjectInlines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698