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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.h

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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // // Handle out-of-flow positioned objects. 101 // // Handle out-of-flow positioned objects.
102 // ... 102 // ...
103 // } 103 // }
104 class CORE_EXPORT LayoutBlock : public LayoutBox { 104 class CORE_EXPORT LayoutBlock : public LayoutBox {
105 protected: 105 protected:
106 explicit LayoutBlock(ContainerNode*); 106 explicit LayoutBlock(ContainerNode*);
107 ~LayoutBlock() override; 107 ~LayoutBlock() override;
108 108
109 public: 109 public:
110 LayoutObject* firstChild() const { 110 LayoutObject* firstChild() const {
111 ASSERT(children() == virtualChildren()); 111 DCHECK_EQ(children(), virtualChildren());
112 return children()->firstChild(); 112 return children()->firstChild();
113 } 113 }
114 LayoutObject* lastChild() const { 114 LayoutObject* lastChild() const {
115 ASSERT(children() == virtualChildren()); 115 DCHECK_EQ(children(), virtualChildren());
116 return children()->lastChild(); 116 return children()->lastChild();
117 } 117 }
118 118
119 // If you have a LayoutBlock, use firstChild or lastChild instead. 119 // If you have a LayoutBlock, use firstChild or lastChild instead.
120 void slowFirstChild() const = delete; 120 void slowFirstChild() const = delete;
121 void slowLastChild() const = delete; 121 void slowLastChild() const = delete;
122 122
123 const LayoutObjectChildList* children() const { return &m_children; } 123 const LayoutObjectChildList* children() const { return &m_children; }
124 LayoutObjectChildList* children() { return &m_children; } 124 LayoutObjectChildList* children() { return &m_children; }
125 125
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 void insertPositionedObject(LayoutBox*); 159 void insertPositionedObject(LayoutBox*);
160 static void removePositionedObject(LayoutBox*); 160 static void removePositionedObject(LayoutBox*);
161 void removePositionedObjects(LayoutObject*, 161 void removePositionedObjects(LayoutObject*,
162 ContainingBlockState = SameContainingBlock); 162 ContainingBlockState = SameContainingBlock);
163 163
164 TrackedLayoutBoxListHashSet* positionedObjects() const { 164 TrackedLayoutBoxListHashSet* positionedObjects() const {
165 return hasPositionedObjects() ? positionedObjectsInternal() : nullptr; 165 return hasPositionedObjects() ? positionedObjectsInternal() : nullptr;
166 } 166 }
167 bool hasPositionedObjects() const { 167 bool hasPositionedObjects() const {
168 ASSERT(m_hasPositionedObjects ? (positionedObjectsInternal() && 168 DCHECK(m_hasPositionedObjects ? (positionedObjectsInternal() &&
169 !positionedObjectsInternal()->isEmpty()) 169 !positionedObjectsInternal()->isEmpty())
170 : !positionedObjectsInternal()); 170 : !positionedObjectsInternal());
171 return m_hasPositionedObjects; 171 return m_hasPositionedObjects;
172 } 172 }
173 173
174 void addPercentHeightDescendant(LayoutBox*); 174 void addPercentHeightDescendant(LayoutBox*);
175 void removePercentHeightDescendant(LayoutBox*); 175 void removePercentHeightDescendant(LayoutBox*);
176 bool hasPercentHeightDescendant(LayoutBox* o) const { 176 bool hasPercentHeightDescendant(LayoutBox* o) const {
177 return hasPercentHeightDescendants() && 177 return hasPercentHeightDescendants() &&
178 percentHeightDescendantsInternal()->contains(o); 178 percentHeightDescendantsInternal()->contains(o);
179 } 179 }
180 180
181 TrackedLayoutBoxListHashSet* percentHeightDescendants() const { 181 TrackedLayoutBoxListHashSet* percentHeightDescendants() const {
182 return hasPercentHeightDescendants() ? percentHeightDescendantsInternal() 182 return hasPercentHeightDescendants() ? percentHeightDescendantsInternal()
183 : nullptr; 183 : nullptr;
184 } 184 }
185 bool hasPercentHeightDescendants() const { 185 bool hasPercentHeightDescendants() const {
186 ASSERT(m_hasPercentHeightDescendants 186 DCHECK(m_hasPercentHeightDescendants
187 ? (percentHeightDescendantsInternal() && 187 ? (percentHeightDescendantsInternal() &&
188 !percentHeightDescendantsInternal()->isEmpty()) 188 !percentHeightDescendantsInternal()->isEmpty())
189 : !percentHeightDescendantsInternal()); 189 : !percentHeightDescendantsInternal());
190 return m_hasPercentHeightDescendants; 190 return m_hasPercentHeightDescendants;
191 } 191 }
192 192
193 void notifyScrollbarThicknessChanged() { 193 void notifyScrollbarThicknessChanged() {
194 m_widthAvailableToChildrenChanged = true; 194 m_widthAvailableToChildrenChanged = true;
195 } 195 }
196 196
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // TODO(lunalu): Temporary in order to ensure compatibility with existing 564 // TODO(lunalu): Temporary in order to ensure compatibility with existing
565 // layout test results. 565 // layout test results.
566 virtual void adjustChildDebugRect(LayoutRect&) const {} 566 virtual void adjustChildDebugRect(LayoutRect&) const {}
567 }; 567 };
568 568
569 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 569 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
570 570
571 } // namespace blink 571 } // namespace blink
572 572
573 #endif // LayoutBlock_h 573 #endif // LayoutBlock_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698