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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutPagedFlowThread.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutPagedFlowThread.h" 5 #include "core/layout/LayoutPagedFlowThread.h"
6 6
7 #include "core/layout/LayoutMultiColumnSet.h" 7 #include "core/layout/LayoutMultiColumnSet.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 void LayoutPagedFlowThread::updateLogicalWidth() { 32 void LayoutPagedFlowThread::updateLogicalWidth() {
33 // As long as we inherit from LayoutMultiColumnFlowThread, we need to bypass 33 // As long as we inherit from LayoutMultiColumnFlowThread, we need to bypass
34 // its implementation here. We're not split into columns, so the flow thread 34 // its implementation here. We're not split into columns, so the flow thread
35 // width will just be whatever is available in the containing block. 35 // width will just be whatever is available in the containing block.
36 LayoutFlowThread::updateLogicalWidth(); 36 LayoutFlowThread::updateLogicalWidth();
37 } 37 }
38 38
39 void LayoutPagedFlowThread::layout() { 39 void LayoutPagedFlowThread::layout() {
40 // There should either be zero or one of those for paged layout. 40 // There should either be zero or one of those for paged layout.
41 DCHECK(firstMultiColumnBox() == lastMultiColumnBox()); 41 DCHECK_EQ(firstMultiColumnBox(), lastMultiColumnBox());
42 setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis()); 42 setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis());
43 LayoutMultiColumnFlowThread::layout(); 43 LayoutMultiColumnFlowThread::layout();
44 44
45 LayoutMultiColumnSet* columnSet = firstMultiColumnSet(); 45 LayoutMultiColumnSet* columnSet = firstMultiColumnSet();
46 if (!columnSet) 46 if (!columnSet)
47 return; 47 return;
48 LayoutUnit pageLogicalHeight = 48 LayoutUnit pageLogicalHeight =
49 columnSet->pageLogicalHeightForOffset(LayoutUnit()); 49 columnSet->pageLogicalHeightForOffset(LayoutUnit());
50 if (!pageLogicalHeight) 50 if (!pageLogicalHeight)
51 return; // Page height not calculated yet. Happens in the first layout pass 51 return; // Page height not calculated yet. Happens in the first layout pass
52 // when height is auto. 52 // when height is auto.
53 // Ensure uniform page height. We don't want the last page to be shorter than 53 // Ensure uniform page height. We don't want the last page to be shorter than
54 // the others, or it'll be impossible to scroll that whole page into view. 54 // the others, or it'll be impossible to scroll that whole page into view.
55 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount(); 55 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount();
56 ASSERT(paddedLogicalBottomInFlowThread >= 56 DCHECK_GE(paddedLogicalBottomInFlowThread,
57 columnSet->logicalBottomInFlowThread()); 57 columnSet->logicalBottomInFlowThread());
58 columnSet->endFlow(paddedLogicalBottomInFlowThread); 58 columnSet->endFlow(paddedLogicalBottomInFlowThread);
59 } 59 }
60 60
61 } // namespace blink 61 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698