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

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

Issue 2748103015: Replace ASSERT with DCHECK in core/layout/<sub dirs> (Closed)
Patch Set: Rebase with latest 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) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (getLineLayoutItem().isText()) { 149 if (getLineLayoutItem().isText()) {
150 DCHECK(fontData); 150 DCHECK(fontData);
151 return m_bitfields.isText() && fontData 151 return m_bitfields.isText() && fontData
152 ? LayoutUnit(fontData->getFontMetrics().height()) 152 ? LayoutUnit(fontData->getFontMetrics().height())
153 : LayoutUnit(); 153 : LayoutUnit();
154 } 154 }
155 if (getLineLayoutItem().isBox() && parent()) 155 if (getLineLayoutItem().isBox() && parent())
156 return isHorizontal() ? LineLayoutBox(getLineLayoutItem()).size().height() 156 return isHorizontal() ? LineLayoutBox(getLineLayoutItem()).size().height()
157 : LineLayoutBox(getLineLayoutItem()).size().width(); 157 : LineLayoutBox(getLineLayoutItem()).size().width();
158 158
159 ASSERT(isInlineFlowBox()); 159 DCHECK(isInlineFlowBox());
160 LineLayoutBoxModel flowObject = boxModelObject(); 160 LineLayoutBoxModel flowObject = boxModelObject();
161 DCHECK(fontData); 161 DCHECK(fontData);
162 LayoutUnit result(fontData ? fontData->getFontMetrics().height() : 0); 162 LayoutUnit result(fontData ? fontData->getFontMetrics().height() : 0);
163 if (parent()) 163 if (parent())
164 result += flowObject.borderAndPaddingLogicalHeight(); 164 result += flowObject.borderAndPaddingLogicalHeight();
165 return result; 165 return result;
166 } 166 }
167 167
168 int InlineBox::baselinePosition(FontBaseline baselineType) const { 168 int InlineBox::baselinePosition(FontBaseline baselineType) const {
169 return boxModelObject().baselinePosition( 169 return boxModelObject().baselinePosition(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 childPoint = 240 childPoint =
241 getLineLayoutItem().containingBlock().flipForWritingModeForChild( 241 getLineLayoutItem().containingBlock().flipForWritingModeForChild(
242 LineLayoutBox(getLineLayoutItem()), childPoint); 242 LineLayoutBox(getLineLayoutItem()), childPoint);
243 243
244 return getLineLayoutItem().hitTest(result, locationInContainer, childPoint); 244 return getLineLayoutItem().hitTest(result, locationInContainer, childPoint);
245 } 245 }
246 246
247 const RootInlineBox& InlineBox::root() const { 247 const RootInlineBox& InlineBox::root() const {
248 if (m_parent) 248 if (m_parent)
249 return m_parent->root(); 249 return m_parent->root();
250 ASSERT(isRootInlineBox()); 250 DCHECK(isRootInlineBox());
251 return static_cast<const RootInlineBox&>(*this); 251 return static_cast<const RootInlineBox&>(*this);
252 } 252 }
253 253
254 RootInlineBox& InlineBox::root() { 254 RootInlineBox& InlineBox::root() {
255 if (m_parent) 255 if (m_parent)
256 return m_parent->root(); 256 return m_parent->root();
257 ASSERT(isRootInlineBox()); 257 DCHECK(isRootInlineBox());
258 return static_cast<RootInlineBox&>(*this); 258 return static_cast<RootInlineBox&>(*this);
259 } 259 }
260 260
261 InlineBox* InlineBox::nextLeafChild() const { 261 InlineBox* InlineBox::nextLeafChild() const {
262 InlineBox* leaf = nullptr; 262 InlineBox* leaf = nullptr;
263 for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine()) 263 for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine())
264 leaf = box->isLeaf() ? box : toInlineFlowBox(box)->firstLeafChild(); 264 leaf = box->isLeaf() ? box : toInlineFlowBox(box)->firstLeafChild();
265 if (!leaf && parent()) 265 if (!leaf && parent())
266 leaf = parent()->nextLeafChild(); 266 leaf = parent()->nextLeafChild();
267 return leaf; 267 return leaf;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 388
389 void showLineTree(const blink::InlineBox* b) { 389 void showLineTree(const blink::InlineBox* b) {
390 if (b) 390 if (b)
391 b->showLineTreeForThis(); 391 b->showLineTreeForThis();
392 else 392 else
393 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); 393 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n");
394 } 394 }
395 395
396 #endif 396 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698