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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCol.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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 LayoutRect LayoutTableCol::localVisualRect() const { 114 LayoutRect LayoutTableCol::localVisualRect() const {
115 // Entire table gets invalidated, instead of invalidating 115 // Entire table gets invalidated, instead of invalidating
116 // every cell in the column. This is simpler, but suboptimal. 116 // every cell in the column. This is simpler, but suboptimal.
117 117
118 LayoutTable* table = this->table(); 118 LayoutTable* table = this->table();
119 if (!table) 119 if (!table)
120 return LayoutRect(); 120 return LayoutRect();
121 121
122 // The correctness of this method depends on the fact that LayoutTableCol's 122 // The correctness of this method depends on the fact that LayoutTableCol's
123 // location is always zero. 123 // location is always zero.
124 ASSERT(this->location() == LayoutPoint()); 124 DCHECK(this->location() == LayoutPoint());
125 125
126 return table->localVisualRect(); 126 return table->localVisualRect();
127 } 127 }
128 128
129 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits() { 129 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits() {
130 clearPreferredLogicalWidthsDirty(); 130 clearPreferredLogicalWidthsDirty();
131 131
132 for (LayoutObject* child = firstChild(); child; child = child->nextSibling()) 132 for (LayoutObject* child = firstChild(); child; child = child->nextSibling())
133 child->clearPreferredLogicalWidthsDirty(); 133 child->clearPreferredLogicalWidthsDirty();
134 } 134 }
135 135
136 LayoutTable* LayoutTableCol::table() const { 136 LayoutTable* LayoutTableCol::table() const {
137 LayoutObject* table = parent(); 137 LayoutObject* table = parent();
138 if (table && !table->isTable()) 138 if (table && !table->isTable())
139 table = table->parent(); 139 table = table->parent();
140 return table && table->isTable() ? toLayoutTable(table) : nullptr; 140 return table && table->isTable() ? toLayoutTable(table) : nullptr;
141 } 141 }
142 142
143 LayoutTableCol* LayoutTableCol::enclosingColumnGroup() const { 143 LayoutTableCol* LayoutTableCol::enclosingColumnGroup() const {
144 if (!parent()->isLayoutTableCol()) 144 if (!parent()->isLayoutTableCol())
145 return nullptr; 145 return nullptr;
146 146
147 LayoutTableCol* parentColumnGroup = toLayoutTableCol(parent()); 147 LayoutTableCol* parentColumnGroup = toLayoutTableCol(parent());
148 ASSERT(parentColumnGroup->isTableColumnGroup()); 148 DCHECK(parentColumnGroup->isTableColumnGroup());
149 ASSERT(isTableColumn()); 149 DCHECK(isTableColumn());
150 return parentColumnGroup; 150 return parentColumnGroup;
151 } 151 }
152 152
153 LayoutTableCol* LayoutTableCol::nextColumn() const { 153 LayoutTableCol* LayoutTableCol::nextColumn() const {
154 // If |this| is a column-group, the next column is the colgroup's first child 154 // If |this| is a column-group, the next column is the colgroup's first child
155 // column. 155 // column.
156 if (LayoutObject* firstChild = this->firstChild()) 156 if (LayoutObject* firstChild = this->firstChild())
157 return toLayoutTableCol(firstChild); 157 return toLayoutTableCol(firstChild);
158 158
159 // Otherwise it's the next column along. 159 // Otherwise it's the next column along.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter( 193 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(
194 const LayoutTableCell* cell) const { 194 const LayoutTableCell* cell) const {
195 DCHECK_EQ(table() 195 DCHECK_EQ(table()
196 ->colElementAtAbsoluteColumn(cell->absoluteColumnIndex() - 1) 196 ->colElementAtAbsoluteColumn(cell->absoluteColumnIndex() - 1)
197 .innermostColOrColGroup(), 197 .innermostColOrColGroup(),
198 this); 198 this);
199 return style()->borderEnd(); 199 return style()->borderEnd();
200 } 200 }
201 201
202 } // namespace blink 202 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableRow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698