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

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

Issue 14105010: Fix the rows' height computation with vertical-align: baseline and rowspan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Same as #1 but with the expected file Created 7 years, 8 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 | « LayoutTests/fast/table/baseline-align-rowspan-expected.txt ('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 dd64e408475da0a47fa7b9d4df4984ceadeacf2d..95be1c543e2c61df2650eb71615421381c936d5e 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -324,10 +324,14 @@ int RenderTableSection::calcRowLogicalHeight()
if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) {
m_grid[cellStartRow].baseline = max(m_grid[cellStartRow].baseline, baselinePosition);
// The descent of a cell that spans multiple rows does not affect the height of the first row it spans, so don't let it
- // become the baseline descent applied to the rest of the row.
- if (cell->rowSpan() == 1)
+ // become the baseline descent applied to the rest of the row. Also we don't account for the baseline descent of
+ // non-spanning cells when computing a spanning cell's extent.
+ int cellStartRowBaselineDescent = 0;
+ if (cell->rowSpan() == 1) {
baselineDescent = max(baselineDescent, cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore()));
- m_rowPos[cellStartRow + 1] = max<int>(m_rowPos[cellStartRow + 1], m_rowPos[cellStartRow] + m_grid[cellStartRow].baseline + baselineDescent);
+ cellStartRowBaselineDescent = baselineDescent;
+ }
+ m_rowPos[cellStartRow + 1] = max<int>(m_rowPos[cellStartRow + 1], m_rowPos[cellStartRow] + m_grid[cellStartRow].baseline + cellStartRowBaselineDescent);
}
}
}
« no previous file with comments | « LayoutTests/fast/table/baseline-align-rowspan-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698