Changeset 140907 in webkit
- Timestamp:
- Jan 26, 2013 1:36:34 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140885 r140907 1 2013-01-26 Robert Hogan <robert@webkit.org> 2 3 REGRESSION(r120616): Cell's logical height wrongly computed with vertical-align: baseline and rowspan 4 https://bugs.webkit.org/show_bug.cgi?id=106571 5 6 Reviewed by Julien Chaffraix. 7 8 * fast/css/vertical-align-baseline-rowspan-010-expected.html: Added. 9 * fast/css/vertical-align-baseline-rowspan-010.html: Added. 10 * fast/css/vertical-align-baseline-rowspan-011-expected.html: Added. 11 * fast/css/vertical-align-baseline-rowspan-011.html: Added. 12 1 13 2013-01-25 Elliott Sprehn <esprehn@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r140906 r140907 1 2013-01-26 Robert Hogan <robert@webkit.org> 2 3 REGRESSION(r120616): Cell's logical height wrongly computed with vertical-align: baseline and rowspan 4 https://bugs.webkit.org/show_bug.cgi?id=106571 5 6 Reviewed by Julien Chaffraix. 7 8 When a cell spans multiple rows, its baseline is set on the first row it spans. r120616 contained a 9 couple of errors in its attempt to ensure the row height calculated in such cases was correct. When it 10 calculated the baseline on the first row in the span, it didn't ensure that the row height was increased 11 if necessary. It also suffered from allowing the baseline descent calculated on a rowspan to affect the 12 height of the other cells in the first row of the span. 13 14 Fix both of these errors in calcRowLogicalHeight() and refactor the calculation of the baseline and baseline 15 descent so that it is freestanding (rather than depending on the height of the section so far). 16 17 Tests: fast/css/vertical-align-baseline-rowspan-010.html 18 fast/css/vertical-align-baseline-rowspan-011.html 19 20 * rendering/RenderTableSection.cpp: 21 (WebCore::RenderTableSection::calcRowLogicalHeight): 22 1 23 2013-01-26 James Simonsen <simonjam@chromium.org> 2 24 -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r140244 r140907 319 319 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[cellStartRow] + cellLogicalHeight); 320 320 321 // find out the baseline321 // Find out the baseline. The baseline is set on the first row in a rowspan. 322 322 EVerticalAlign va = cell->style()->verticalAlign(); 323 323 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH) { 324 324 LayoutUnit baselinePosition = cell->cellBaselinePosition(); 325 325 if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) { 326 m_grid[cellStartRow].baseline = max(m_grid[cellStartRow].baseline, baselinePosition - cell->intrinsicPaddingBefore()); 327 baselineDescent = max(baselineDescent, m_rowPos[cellStartRow] + cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore())); 326 m_grid[cellStartRow].baseline = max(m_grid[cellStartRow].baseline, baselinePosition); 327 // 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 328 // become the baseline descent applied to the rest of the row. 329 if (cell->rowSpan() == 1) 330 baselineDescent = max(baselineDescent, cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore())); 331 m_rowPos[cellStartRow + 1] = max<int>(m_rowPos[cellStartRow + 1], m_rowPos[cellStartRow] + m_grid[cellStartRow].baseline + baselineDescent); 328 332 } 329 333 } 330 334 } 331 335 } 332 333 // do we have baseline aligned elements?334 if (m_grid[r].baseline)335 // increase rowheight if baseline requires336 m_rowPos[r + 1] = max<int>(m_rowPos[r + 1], m_grid[r].baseline + baselineDescent);337 336 338 337 // Add the border-spacing to our final position.
Note: See TracChangeset
for help on using the changeset viewer.