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

Unified Diff: Source/WebCore/rendering/FixedTableLayout.cpp

Issue 10479019: Merge 118819 - REGRESSION(r111742): box-sizing: border-box doesn't work on fixed table layout (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/FixedTableLayout.cpp
===================================================================
--- Source/WebCore/rendering/FixedTableLayout.cpp (revision 119426)
+++ Source/WebCore/rendering/FixedTableLayout.cpp (working copy)
@@ -143,40 +143,39 @@
// Iterate over the first row in case some are unspecified.
RenderTableSection* section = m_table->topNonEmptySection();
- if (section) {
- unsigned cCol = 0;
- RenderObject* firstRow = section->firstChild();
- RenderObject* child = firstRow->firstChild();
- while (child) {
- if (child->isTableCell()) {
- RenderTableCell* cell = toRenderTableCell(child);
- if (cell->preferredLogicalWidthsDirty())
- cell->computePreferredLogicalWidths();
+ if (!section)
+ return usedWidth;
- Length w = cell->styleOrColLogicalWidth();
- unsigned span = cell->colSpan();
- int effectiveColWidth = 0;
- if (w.isFixed() && w.isPositive()) {
- w.setValue(w.value() + cell->borderAndPaddingLogicalWidth());
- effectiveColWidth = w.value();
- }
-
- unsigned usedSpan = 0;
- unsigned i = 0;
- while (usedSpan < span && cCol + i < nEffCols) {
- float eSpan = m_table->spanOfEffCol(cCol + i);
- // Only set if no col element has already set it.
- if (m_width[cCol + i].isAuto() && w.type() != Auto) {
- m_width[cCol + i] = w;
- m_width[cCol + i] *= eSpan / span;
- usedWidth += effectiveColWidth * eSpan / span;
- }
- usedSpan += eSpan;
- i++;
- }
- cCol += i;
+ unsigned currentColumn = 0;
+
+ RenderObject* firstRow = section->firstChild();
+ for (RenderObject* child = firstRow->firstChild(); child; child = child->nextSibling()) {
+ if (!child->isTableCell())
+ continue;
+
+ RenderTableCell* cell = toRenderTableCell(child);
+ if (cell->preferredLogicalWidthsDirty())
+ cell->computePreferredLogicalWidths();
+
+ Length logicalWidth = cell->styleOrColLogicalWidth();
+ unsigned span = cell->colSpan();
+ int fixedBorderBoxLogicalWidth = 0;
+ if (logicalWidth.isFixed() && logicalWidth.isPositive()) {
+ fixedBorderBoxLogicalWidth = cell->computeBorderBoxLogicalWidth(logicalWidth.value());
+ logicalWidth.setValue(fixedBorderBoxLogicalWidth);
+ }
+
+ unsigned usedSpan = 0;
+ while (usedSpan < span && currentColumn < nEffCols) {
+ float eSpan = m_table->spanOfEffCol(currentColumn);
+ // Only set if no col element has already set it.
+ if (m_width[currentColumn].isAuto() && logicalWidth.type() != Auto) {
+ m_width[currentColumn] = logicalWidth;
+ m_width[currentColumn] *= eSpan / span;
+ usedWidth += fixedBorderBoxLogicalWidth * eSpan / span;
}
- child = child->nextSibling();
+ usedSpan += eSpan;
+ ++currentColumn;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698