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

Unified Diff: Source/core/rendering/RenderTableSection.cpp

Issue 18553003: Add a runtime flag for distributing extra logical height to rowspans (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments Addressed Created 7 years, 5 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 | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTableSection.cpp
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
index 3bcff2dbf6d5d9c45795c5cf47efbd7cf47e71d3..41ad27591186675bdfe59ef7837d5c6d0c22ba4a 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -24,13 +24,16 @@
*/
#include "config.h"
+#include "core/rendering/RenderTableSection.h"
+
+// FIXME: Remove 'RuntimeEnabledFeatures.h' when http://crbug.com/78724 is closed.
+#include "RuntimeEnabledFeatures.h"
#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 +363,26 @@ 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 {
+ // FIXME: We add all the logical row of a rowspan to the last rows
+ // until crbug.com/78724 is fixed and the runtime flag removed.
+ // This avoids propagating temporary regressions while we fix the bug.
+ 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());
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698