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

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

Issue 2458003002: Remove ASSERT_WITH_SECURITY_IMPLICATION. (Closed)
Patch Set: Minor formatting fix Created 4 years, 1 month 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All right reserved. 4 * All right reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 InlineFlowBox* LayoutBlockFlow::createLineBoxes(LineLayoutItem lineLayoutItem, 179 InlineFlowBox* LayoutBlockFlow::createLineBoxes(LineLayoutItem lineLayoutItem,
180 const LineInfo& lineInfo, 180 const LineInfo& lineInfo,
181 InlineBox* childBox) { 181 InlineBox* childBox) {
182 // See if we have an unconstructed line box for this object that is also 182 // See if we have an unconstructed line box for this object that is also
183 // the last item on the line. 183 // the last item on the line.
184 unsigned lineDepth = 1; 184 unsigned lineDepth = 1;
185 InlineFlowBox* parentBox = nullptr; 185 InlineFlowBox* parentBox = nullptr;
186 InlineFlowBox* result = nullptr; 186 InlineFlowBox* result = nullptr;
187 do { 187 do {
188 ASSERT_WITH_SECURITY_IMPLICATION(lineLayoutItem.isLayoutInline() || 188 SECURITY_DCHECK(lineLayoutItem.isLayoutInline() ||
189 lineLayoutItem.isEqual(this)); 189 lineLayoutItem.isEqual(this));
190 190
191 LineLayoutInline inlineFlow(!lineLayoutItem.isEqual(this) ? lineLayoutItem 191 LineLayoutInline inlineFlow(!lineLayoutItem.isEqual(this) ? lineLayoutItem
192 : nullptr); 192 : nullptr);
193 193
194 // Get the last box we made for this layout object. 194 // Get the last box we made for this layout object.
195 parentBox = inlineFlow ? inlineFlow.lastLineBox() 195 parentBox = inlineFlow ? inlineFlow.lastLineBox()
196 : LineLayoutBlockFlow(lineLayoutItem).lastLineBox(); 196 : LineLayoutBlockFlow(lineLayoutItem).lastLineBox();
197 197
198 // If this box or its ancestor is constructed then it is from a previous 198 // If this box or its ancestor is constructed then it is from a previous
199 // line, and we need to make a new box for our line. If this box or its 199 // line, and we need to make a new box for our line. If this box or its
200 // ancestor is unconstructed but it has something following it on the line, 200 // ancestor is unconstructed but it has something following it on the line,
201 // then we know we have to make a new box as well. In this situation our 201 // then we know we have to make a new box as well. In this situation our
202 // inline has actually been split in two on the same line (this can happen 202 // inline has actually been split in two on the same line (this can happen
203 // with very fancy language mixtures). 203 // with very fancy language mixtures).
204 bool constructedNewBox = false; 204 bool constructedNewBox = false;
205 bool allowedToConstructNewBox = 205 bool allowedToConstructNewBox =
206 !inlineFlow || inlineFlow.alwaysCreateLineBoxes(); 206 !inlineFlow || inlineFlow.alwaysCreateLineBoxes();
207 bool canUseExistingParentBox = 207 bool canUseExistingParentBox =
208 parentBox && !parentIsConstructedOrHaveNext(parentBox); 208 parentBox && !parentIsConstructedOrHaveNext(parentBox);
209 if (allowedToConstructNewBox && !canUseExistingParentBox) { 209 if (allowedToConstructNewBox && !canUseExistingParentBox) {
210 // We need to make a new box for this layout object. Once 210 // We need to make a new box for this layout object. Once
211 // made, we need to place it at the end of the current line. 211 // made, we need to place it at the end of the current line.
212 InlineBox* newBox = createInlineBoxForLayoutObject( 212 InlineBox* newBox = createInlineBoxForLayoutObject(
213 LineLayoutItem(lineLayoutItem), lineLayoutItem.isEqual(this)); 213 LineLayoutItem(lineLayoutItem), lineLayoutItem.isEqual(this));
214 ASSERT_WITH_SECURITY_IMPLICATION(newBox->isInlineFlowBox()); 214 SECURITY_DCHECK(newBox->isInlineFlowBox());
215 parentBox = toInlineFlowBox(newBox); 215 parentBox = toInlineFlowBox(newBox);
216 parentBox->setFirstLineStyleBit(lineInfo.isFirstLine()); 216 parentBox->setFirstLineStyleBit(lineInfo.isFirstLine());
217 parentBox->setIsHorizontal(isHorizontalWritingMode()); 217 parentBox->setIsHorizontal(isHorizontalWritingMode());
218 constructedNewBox = true; 218 constructedNewBox = true;
219 } 219 }
220 220
221 if (constructedNewBox || canUseExistingParentBox) { 221 if (constructedNewBox || canUseExistingParentBox) {
222 if (!result) 222 if (!result)
223 result = parentBox; 223 result = parentBox;
224 224
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2517 2517
2518 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 2518 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
2519 // LayoutBlockFlow is in charge of paint invalidation of the first line. 2519 // LayoutBlockFlow is in charge of paint invalidation of the first line.
2520 if (firstLineBox()) 2520 if (firstLineBox())
2521 return false; 2521 return false;
2522 2522
2523 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 2523 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
2524 } 2524 }
2525 2525
2526 } // namespace blink 2526 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698