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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.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 * This file is part of the layout object implementation for KHTML. 2 * This file is part of the layout object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 if (normalFlowChildWithoutLines && lineCount == 0) 173 if (normalFlowChildWithoutLines && lineCount == 0)
174 return (normalFlowChildWithoutLines->location().y() + 174 return (normalFlowChildWithoutLines->location().y() +
175 normalFlowChildWithoutLines->size().height()) 175 normalFlowChildWithoutLines->size().height())
176 .toInt(); 176 .toInt();
177 177
178 return -1; 178 return -1;
179 } 179 }
180 180
181 static RootInlineBox* lineAtIndex(const LayoutBlockFlow* blockFlow, int i) { 181 static RootInlineBox* lineAtIndex(const LayoutBlockFlow* blockFlow, int i) {
182 ASSERT(i >= 0); 182 DCHECK_GE(i, 0);
183 183
184 if (blockFlow->style()->visibility() != EVisibility::kVisible) 184 if (blockFlow->style()->visibility() != EVisibility::kVisible)
185 return nullptr; 185 return nullptr;
186 186
187 if (blockFlow->childrenInline()) { 187 if (blockFlow->childrenInline()) {
188 for (RootInlineBox* box = blockFlow->firstRootBox(); box; 188 for (RootInlineBox* box = blockFlow->firstRootBox(); box;
189 box = box->nextRootBox()) { 189 box = box->nextRootBox()) {
190 if (!i--) 190 if (!i--)
191 return box; 191 return box;
192 } 192 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (!obj->isLayoutBlockFlow()) 257 if (!obj->isLayoutBlockFlow())
258 continue; 258 continue;
259 LayoutBlockFlow* childBlockFlow = toLayoutBlockFlow(obj); 259 LayoutBlockFlow* childBlockFlow = toLayoutBlockFlow(obj);
260 if (shouldCheckLines(childBlockFlow)) 260 if (shouldCheckLines(childBlockFlow))
261 clearTruncation(childBlockFlow); 261 clearTruncation(childBlockFlow);
262 } 262 }
263 } 263 }
264 264
265 LayoutDeprecatedFlexibleBox::LayoutDeprecatedFlexibleBox(Element& element) 265 LayoutDeprecatedFlexibleBox::LayoutDeprecatedFlexibleBox(Element& element)
266 : LayoutBlock(&element) { 266 : LayoutBlock(&element) {
267 ASSERT(!childrenInline()); 267 DCHECK(!childrenInline());
268 m_stretchingChildren = false; 268 m_stretchingChildren = false;
269 if (!isAnonymous()) { 269 if (!isAnonymous()) {
270 const KURL& url = document().url(); 270 const KURL& url = document().url();
271 if (url.protocolIs("chrome")) 271 if (url.protocolIs("chrome"))
272 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome); 272 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome);
273 else if (url.protocolIs("chrome-extension")) 273 else if (url.protocolIs("chrome-extension"))
274 UseCounter::count(document(), 274 UseCounter::count(document(),
275 UseCounter::DeprecatedFlexboxChromeExtension); 275 UseCounter::DeprecatedFlexboxChromeExtension);
276 else 276 else
277 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebContent); 277 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebContent);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); 354 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
355 355
356 LayoutUnit scrollbarWidth(scrollbarLogicalWidth()); 356 LayoutUnit scrollbarWidth(scrollbarLogicalWidth());
357 maxLogicalWidth += scrollbarWidth; 357 maxLogicalWidth += scrollbarWidth;
358 minLogicalWidth += scrollbarWidth; 358 minLogicalWidth += scrollbarWidth;
359 } 359 }
360 360
361 void LayoutDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren) { 361 void LayoutDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren) {
362 ASSERT(needsLayout()); 362 DCHECK(needsLayout());
363 363
364 if (!relayoutChildren && simplifiedLayout()) 364 if (!relayoutChildren && simplifiedLayout())
365 return; 365 return;
366 366
367 { 367 {
368 // LayoutState needs this deliberate scope to pop before paint invalidation. 368 // LayoutState needs this deliberate scope to pop before paint invalidation.
369 LayoutState state(*this); 369 LayoutState state(*this);
370 370
371 LayoutSize previousSize = size(); 371 LayoutSize previousSize = size();
372 372
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (minHeight.isFixed() || minHeight.isAuto()) { 1266 if (minHeight.isFixed() || minHeight.isAuto()) {
1267 LayoutUnit minHeight(child->style()->minHeight().value()); 1267 LayoutUnit minHeight(child->style()->minHeight().value());
1268 LayoutUnit height = contentHeightForChild(child); 1268 LayoutUnit height = contentHeightForChild(child);
1269 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero(); 1269 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero();
1270 return allowedShrinkage; 1270 return allowedShrinkage;
1271 } 1271 }
1272 return LayoutUnit(); 1272 return LayoutUnit();
1273 } 1273 }
1274 1274
1275 } // namespace blink 1275 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698