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

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

Issue 22589002: Margins on children of display:table-cell elements get stuck at highest value. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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/table-toggle-paragraph-padding-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 545f369442377dd28ceae31b904349be574ef33a..03e1a3d26a10f2173476aea8abf25926312f76a7 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -481,13 +481,15 @@ void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r
if (!cell->isBaselineAligned())
return;
- LayoutUnit baselinePosition = cell->cellBaselinePosition();
- if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) {
+ // Ignoring the intrinsic padding as it depends on knowing the row's baseline, which won't be accurate
+ // until the end of this function.
+ LayoutUnit baselinePosition = cell->cellBaselinePosition() - cell->intrinsicPaddingBefore();
+ if (baselinePosition > cell->borderBefore() + (cell->paddingBefore() - cell->intrinsicPaddingBefore())) {
m_grid[row].baseline = max(m_grid[row].baseline, baselinePosition);
int cellStartRowBaselineDescent = 0;
if (cell->rowSpan() == 1) {
- baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizing() - (baselinePosition - cell->intrinsicPaddingBefore()));
+ baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizing() - baselinePosition);
cellStartRowBaselineDescent = baselineDescent;
}
m_rowPos[row + 1] = max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[row].baseline + cellStartRowBaselineDescent);
« no previous file with comments | « LayoutTests/fast/table/table-toggle-paragraph-padding-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698