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

Side by Side Diff: Source/core/rendering/FixedTableLayout.cpp

Issue 27690002: Not able to set width using ColGroup when table-layout is fixed. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 Apple Inc. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (logicalWidth.isFixed() && logicalWidth.isPositive()) { 152 if (logicalWidth.isFixed() && logicalWidth.isPositive()) {
153 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBox Sizing(logicalWidth.value()); 153 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBox Sizing(logicalWidth.value());
154 logicalWidth.setValue(fixedBorderBoxLogicalWidth); 154 logicalWidth.setValue(fixedBorderBoxLogicalWidth);
155 } 155 }
156 156
157 unsigned usedSpan = 0; 157 unsigned usedSpan = 0;
158 while (usedSpan < span && currentColumn < nEffCols) { 158 while (usedSpan < span && currentColumn < nEffCols) {
159 float eSpan = m_table->spanOfEffCol(currentColumn); 159 float eSpan = m_table->spanOfEffCol(currentColumn);
160 // Only set if no col element has already set it. 160 // Only set if no col element has already set it.
161 if (m_width[currentColumn].isAuto() && logicalWidth.type() != Auto) { 161 if (m_width[currentColumn].isAuto() && logicalWidth.type() != Auto) {
162 m_width[currentColumn] = logicalWidth; 162 // Some column do not have col width specified by colgroup so
163 // by default those column should set as auto.
164 if (span > 1)
165 m_width[currentColumn].setValue(m_width[currentColumn].type( ), logicalWidth.intValue());
Julien - ping for review 2013/10/22 21:11:41 I don't understand how this line is correct: m_wid
suchit.agrawal 2013/10/23 13:41:06 If column is auto then we need to keep it auto. By
Julien - ping for review 2013/10/23 17:04:52 Again, you're explaining 'what' which can be infer
166 else
167 m_width[currentColumn] = logicalWidth;
163 m_width[currentColumn] *= eSpan / span; 168 m_width[currentColumn] *= eSpan / span;
164 usedWidth += fixedBorderBoxLogicalWidth * eSpan / span; 169 usedWidth += fixedBorderBoxLogicalWidth * eSpan / span;
165 } 170 }
166 usedSpan += eSpan; 171 usedSpan += eSpan;
167 ++currentColumn; 172 ++currentColumn;
168 } 173 }
169 174
170 // FixedTableLayout doesn't use min/maxPreferredLogicalWidths, but we ne ed to clear the 175 // FixedTableLayout doesn't use min/maxPreferredLogicalWidths, but we ne ed to clear the
171 // dirty bit on the cell so that we'll correctly mark its ancestors dirt y 176 // dirty bit on the cell so that we'll correctly mark its ancestors dirt y
172 // in case we later call setPreferredLogicalWidthsDirty() on it later. 177 // in case we later call setPreferredLogicalWidthsDirty() on it later.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 for (unsigned i = 0; i < nEffCols; i++) { 317 for (unsigned i = 0; i < nEffCols; i++) {
313 m_table->setColumnPosition(i, pos); 318 m_table->setColumnPosition(i, pos);
314 pos += calcWidth[i] + hspacing; 319 pos += calcWidth[i] + hspacing;
315 } 320 }
316 int colPositionsSize = m_table->columnPositions().size(); 321 int colPositionsSize = m_table->columnPositions().size();
317 if (colPositionsSize > 0) 322 if (colPositionsSize > 0)
318 m_table->setColumnPosition(colPositionsSize - 1, pos); 323 m_table->setColumnPosition(colPositionsSize - 1, pos);
319 } 324 }
320 325
321 } // namespace WebCore 326 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698