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

Side by Side Diff: third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.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) 2002 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
3 * (C) 2002 Dirk Mueller (mueller@kde.org) 3 * (C) 2002 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License. 9 * version 2 of the License.
10 * 10 *
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 int effectiveColWidth = 0; 101 int effectiveColWidth = 0;
102 if (colStyleLogicalWidth.isFixed() && colStyleLogicalWidth.value() > 0) 102 if (colStyleLogicalWidth.isFixed() && colStyleLogicalWidth.value() > 0)
103 effectiveColWidth = colStyleLogicalWidth.value(); 103 effectiveColWidth = colStyleLogicalWidth.value();
104 104
105 unsigned span = col->span(); 105 unsigned span = col->span();
106 while (span) { 106 while (span) {
107 unsigned spanInCurrentEffectiveColumn; 107 unsigned spanInCurrentEffectiveColumn;
108 if (currentEffectiveColumn >= nEffCols) { 108 if (currentEffectiveColumn >= nEffCols) {
109 m_table->appendEffectiveColumn(span); 109 m_table->appendEffectiveColumn(span);
110 nEffCols++; 110 nEffCols++;
111 m_width.append(Length()); 111 m_width.push_back(Length());
112 spanInCurrentEffectiveColumn = span; 112 spanInCurrentEffectiveColumn = span;
113 } else { 113 } else {
114 if (span < m_table->spanOfEffectiveColumn(currentEffectiveColumn)) { 114 if (span < m_table->spanOfEffectiveColumn(currentEffectiveColumn)) {
115 m_table->splitEffectiveColumn(currentEffectiveColumn, span); 115 m_table->splitEffectiveColumn(currentEffectiveColumn, span);
116 nEffCols++; 116 nEffCols++;
117 m_width.append(Length()); 117 m_width.push_back(Length());
118 } 118 }
119 spanInCurrentEffectiveColumn = 119 spanInCurrentEffectiveColumn =
120 m_table->spanOfEffectiveColumn(currentEffectiveColumn); 120 m_table->spanOfEffectiveColumn(currentEffectiveColumn);
121 } 121 }
122 // TODO(alancutter): Make this work correctly for calc lengths. 122 // TODO(alancutter): Make this work correctly for calc lengths.
123 if ((colStyleLogicalWidth.isFixed() || 123 if ((colStyleLogicalWidth.isFixed() ||
124 colStyleLogicalWidth.isPercentOrCalc()) && 124 colStyleLogicalWidth.isPercentOrCalc()) &&
125 colStyleLogicalWidth.isPositive()) { 125 colStyleLogicalWidth.isPositive()) {
126 m_width[currentEffectiveColumn] = colStyleLogicalWidth; 126 m_width[currentEffectiveColumn] = colStyleLogicalWidth;
127 m_width[currentEffectiveColumn] *= spanInCurrentEffectiveColumn; 127 m_width[currentEffectiveColumn] *= spanInCurrentEffectiveColumn;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 void TableLayoutAlgorithmFixed::willChangeTableLayout() { 346 void TableLayoutAlgorithmFixed::willChangeTableLayout() {
347 // When switching table layout algorithm, we need to dirty the preferred 347 // When switching table layout algorithm, we need to dirty the preferred
348 // logical widths as we cleared the bits without computing them. 348 // logical widths as we cleared the bits without computing them.
349 // (see calcWidthArray above.) This optimization is preferred to always 349 // (see calcWidthArray above.) This optimization is preferred to always
350 // computing the logical widths we never intended to use. 350 // computing the logical widths we never intended to use.
351 m_table->recalcSectionsIfNeeded(); 351 m_table->recalcSectionsIfNeeded();
352 m_table->markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTable::MarkDirtyOnly); 352 m_table->markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTable::MarkDirtyOnly);
353 } 353 }
354 354
355 } // namespace blink 355 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698