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

Side by Side Diff: third_party/WebKit/Source/core/layout/FlexibleBoxAlgorithm.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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool lineHasInFlowItem = false; 71 bool lineHasInFlowItem = false;
72 72
73 for (; nextIndex < m_allItems.size(); ++nextIndex) { 73 for (; nextIndex < m_allItems.size(); ++nextIndex) {
74 const FlexItem& flexItem = m_allItems[nextIndex]; 74 const FlexItem& flexItem = m_allItems[nextIndex];
75 DCHECK(!flexItem.box->isOutOfFlowPositioned()); 75 DCHECK(!flexItem.box->isOutOfFlowPositioned());
76 if (isMultiline() && 76 if (isMultiline() &&
77 sumHypotheticalMainSize + flexItem.hypotheticalMainAxisMarginBoxSize() > 77 sumHypotheticalMainSize + flexItem.hypotheticalMainAxisMarginBoxSize() >
78 m_lineBreakLength && 78 m_lineBreakLength &&
79 lineHasInFlowItem) 79 lineHasInFlowItem)
80 break; 80 break;
81 lineItems.append(flexItem); 81 lineItems.push_back(flexItem);
82 lineHasInFlowItem = true; 82 lineHasInFlowItem = true;
83 sumFlexBaseSize += flexItem.flexBaseMarginBoxSize(); 83 sumFlexBaseSize += flexItem.flexBaseMarginBoxSize();
84 totalFlexGrow += flexItem.box->style()->flexGrow(); 84 totalFlexGrow += flexItem.box->style()->flexGrow();
85 totalFlexShrink += flexItem.box->style()->flexShrink(); 85 totalFlexShrink += flexItem.box->style()->flexShrink();
86 totalWeightedFlexShrink += 86 totalWeightedFlexShrink +=
87 flexItem.box->style()->flexShrink() * flexItem.flexBaseContentSize; 87 flexItem.box->style()->flexShrink() * flexItem.flexBaseContentSize;
88 sumHypotheticalMainSize += flexItem.hypotheticalMainAxisMarginBoxSize(); 88 sumHypotheticalMainSize += flexItem.hypotheticalMainAxisMarginBoxSize();
89 } 89 }
90 DCHECK(lineItems.size() > 0 || nextIndex == m_allItems.size()); 90 DCHECK(lineItems.size() > 0 || nextIndex == m_allItems.size());
91 return lineItems.size() > 0; 91 return lineItems.size() > 0;
92 } 92 }
93 93
94 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ColumnBalancer.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698