Chromium Code Reviews| Index: Source/core/rendering/RenderTableSection.cpp |
| diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp |
| index 3bcff2dbf6d5d9c45795c5cf47efbd7cf47e71d3..8592fb6c455345607517620f1b567d709fd0069b 100644 |
| --- a/Source/core/rendering/RenderTableSection.cpp |
| +++ b/Source/core/rendering/RenderTableSection.cpp |
| @@ -24,13 +24,15 @@ |
| */ |
| #include "config.h" |
| +#include "core/rendering/RenderTableSection.h" |
| + |
| +#include "RuntimeEnabledFeatures.h" |
|
Julien - ping for review
2013/07/03 19:52:26
Nit: Add a FIXME to remove this when the master bu
a.suchit
2013/07/04 14:14:50
Done.
|
| #include <limits> |
| #include "core/rendering/HitTestResult.h" |
| #include "core/rendering/PaintInfo.h" |
| #include "core/rendering/RenderTableCell.h" |
| #include "core/rendering/RenderTableCol.h" |
| #include "core/rendering/RenderTableRow.h" |
| -#include "core/rendering/RenderTableSection.h" |
| #include "core/rendering/RenderView.h" |
| #include <wtf/HashSet.h> |
| #include <wtf/MemoryInstrumentationHashMap.h> |
| @@ -360,18 +362,27 @@ int RenderTableSection::calcRowLogicalHeight() |
| if (current.inColSpan && cell->rowSpan() == 1) |
| continue; |
| - if (cell->rowSpan() > 1) { |
| - // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account. |
| - if (cell->rowIndex() == r) { |
| - rowSpanCells.append(cell); |
| + if (RuntimeEnabledFeatures::rowSpanLogicalHeightSpreadingEnabled()) { |
| + if (cell->rowSpan() > 1) { |
| + // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account. |
| + if (cell->rowIndex() == r) { |
| + rowSpanCells.append(cell); |
| - // Find out the baseline. The baseline is set on the first row in a rowSpan. |
| - updateBaselineForCell(cell, r, baselineDescent); |
| + // Find out the baseline. The baseline is set on the first row in a rowSpan. |
| + updateBaselineForCell(cell, r, baselineDescent); |
| + } |
| + continue; |
| } |
| - continue; |
| - } |
| - ASSERT(cell->rowSpan() == 1); |
| + ASSERT(cell->rowSpan() == 1); |
| + } else { |
| + // Below issue, Fix is in progress under RuntimeEnabledFeature flag |
| + // 'RowSpanLogicalHeightSpreading'. crbug.com/78724 |
| + // Issue : We are always adding the height of a rowspan to the last rows which doesn't match |
| + // other browsers. See crbug.com/78724 for example. |
| + if ((cell->rowIndex() + cell->rowSpan() - 1) != r) |
| + continue; |
| + } |
| if (cell->hasOverrideHeight()) { |
| if (!statePusher.didPush()) { |
| @@ -385,10 +396,20 @@ int RenderTableSection::calcRowLogicalHeight() |
| cell->layoutIfNeeded(); |
| } |
| - m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r] + cell->logicalHeightForRowSizing()); |
| + if (RuntimeEnabledFeatures::rowSpanLogicalHeightSpreadingEnabled()) { |
| + m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r] + cell->logicalHeightForRowSizing()); |
| + |
| + // Find out the baseline. |
| + updateBaselineForCell(cell, r, baselineDescent); |
| + } else { |
| + // For row spanning cells, |r| is the last row in the span. |
| + unsigned cellStartRow = cell->rowIndex(); |
| - // Find out the baseline. |
| - updateBaselineForCell(cell, r, baselineDescent); |
| + m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[cellStartRow] + cell->logicalHeightForRowSizing()); |
| + |
| + // Find out the baseline. |
| + updateBaselineForCell(cell, cellStartRow, baselineDescent); |
| + } |
| } |
| } |
| @@ -397,8 +418,10 @@ int RenderTableSection::calcRowLogicalHeight() |
| m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r]); |
| } |
| - if (!rowSpanCells.isEmpty()) |
| + if (!rowSpanCells.isEmpty()) { |
| + ASSERT(RuntimeEnabledFeatures::rowSpanLogicalHeightSpreadingEnabled()); |
| distributeRowSpanHeightToRows(rowSpanCells); |
| + } |
| ASSERT(!needsLayout()); |