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

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

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ColumnBalancer.h" 5 #include "core/layout/ColumnBalancer.h"
6 6
7 #include "core/layout/LayoutMultiColumnFlowThread.h" 7 #include "core/layout/LayoutMultiColumnFlowThread.h"
8 #include "core/layout/LayoutMultiColumnSet.h" 8 #include "core/layout/LayoutMultiColumnSet.h"
9 #include "core/layout/api/LineLayoutBlockFlow.h" 9 #include "core/layout/api/LineLayoutBlockFlow.h"
10 10
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // ends up in the overflow area shouldn't affect column balancing. However, if 285 // ends up in the overflow area shouldn't affect column balancing. However, if
286 // we're in a nested fragmentation context, we may still need to record all 286 // we're in a nested fragmentation context, we may still need to record all
287 // runs, since there'll be no overflow area in the inline direction then, but 287 // runs, since there'll be no overflow area in the inline direction then, but
288 // rather additional rows of columns in multiple outer fragmentainers. 288 // rather additional rows of columns in multiple outer fragmentainers.
289 if (m_contentRuns.size() >= columnSet().usedColumnCount()) { 289 if (m_contentRuns.size() >= columnSet().usedColumnCount()) {
290 const auto* flowThread = columnSet().multiColumnFlowThread(); 290 const auto* flowThread = columnSet().multiColumnFlowThread();
291 if (!flowThread->enclosingFragmentationContext() || 291 if (!flowThread->enclosingFragmentationContext() ||
292 columnSet().newFragmentainerGroupsAllowed()) 292 columnSet().newFragmentainerGroupsAllowed())
293 return; 293 return;
294 } 294 }
295 m_contentRuns.append(ContentRun(endOffsetInFlowThread)); 295 m_contentRuns.push_back(ContentRun(endOffsetInFlowThread));
296 } 296 }
297 297
298 unsigned InitialColumnHeightFinder::contentRunIndexWithTallestColumns() const { 298 unsigned InitialColumnHeightFinder::contentRunIndexWithTallestColumns() const {
299 unsigned indexWithLargestHeight = 0; 299 unsigned indexWithLargestHeight = 0;
300 LayoutUnit largestHeight; 300 LayoutUnit largestHeight;
301 LayoutUnit previousOffset = logicalTopInFlowThread(); 301 LayoutUnit previousOffset = logicalTopInFlowThread();
302 size_t runCount = m_contentRuns.size(); 302 size_t runCount = m_contentRuns.size();
303 ASSERT(runCount); 303 ASSERT(runCount);
304 for (size_t i = firstContentRunIndexInLastRow(); i < runCount; i++) { 304 for (size_t i = firstContentRunIndexInLastRow(); i < runCount; i++) {
305 const ContentRun& run = m_contentRuns[i]; 305 const ContentRun& run = m_contentRuns[i];
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 if (group.columnLogicalTopForOffset(lineTopInFlowThread) != 482 if (group.columnLogicalTopForOffset(lineTopInFlowThread) !=
483 group.columnLogicalTopForOffset(lineBottomWithOverflow)) { 483 group.columnLogicalTopForOffset(lineBottomWithOverflow)) {
484 LayoutUnit shortage = 484 LayoutUnit shortage =
485 lineBottomWithOverflow - 485 lineBottomWithOverflow -
486 group.columnLogicalTopForOffset(lineBottomWithOverflow); 486 group.columnLogicalTopForOffset(lineBottomWithOverflow);
487 recordSpaceShortage(shortage); 487 recordSpaceShortage(shortage);
488 } 488 }
489 } 489 }
490 490
491 } // namespace blink 491 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698