Changeset 145305 in webkit
- Timestamp:
- Mar 8, 2013 10:40:13 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145300 r145305 1 2013-03-07 Robert Hogan <robert@webkit.org> 2 3 REGRESSION(r140907): Incorrect baseline for cells with media content during load 4 https://bugs.webkit.org/show_bug.cgi?id=108357 5 6 Reviewed by Julien Chaffraix. 7 8 * fast/css/vertical-align-baseline-rowspan-012-expected.html: Added. 9 * fast/css/vertical-align-baseline-rowspan-012.html: Added. 10 * http/tests/css/vertical-align-baseline-after-image-load-2-expected.html: Added. 11 * http/tests/css/vertical-align-baseline-after-image-load-2.html: Added. 12 * http/tests/css/vertical-align-baseline-after-image-load-3-expected.html: Added. 13 * http/tests/css/vertical-align-baseline-after-image-load-3.html: Added. 14 * http/tests/css/vertical-align-baseline-after-image-load-expected.html: Added. 15 * http/tests/css/vertical-align-baseline-after-image-load.html: Added. 16 1 17 2013-03-08 Sheriff Bot <webkit.review.bot@gmail.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r145304 r145305 1 2013-03-07 Robert Hogan <robert@webkit.org> 2 3 REGRESSION(r140907): Incorrect baseline for cells with media content during load 4 https://bugs.webkit.org/show_bug.cgi?id=108357 5 6 Reviewed by Julien Chaffraix. 7 8 If a cell has replaced content, the intrinsic height of its content can change between layouts. If that's the case then the intrinsic padding we used 9 for layout (the padding required to push the contents of the cell down to the row's baseline) is included in the new height and baseline and makes both 10 of them wrong. So if a cell's content's intrinsic height has changed push the new content up into the intrinsic padding and relayout so that the rest of 11 table and row layout can use the correct baseline and height for this cell. 12 13 Tests: fast/css/vertical-align-baseline-rowspan-012.html 14 http/tests/css/vertical-align-baseline-after-image-load-2.html 15 http/tests/css/vertical-align-baseline-after-image-load-3.html 16 http/tests/css/vertical-align-baseline-after-image-load.html 17 18 * rendering/RenderTableCell.cpp: 19 (WebCore::RenderTableCell::layout): 20 * rendering/RenderTableCell.h: 21 (WebCore::RenderTableCell::isBaselineAligned): 22 * rendering/RenderTableSection.cpp: 23 (WebCore::RenderTableSection::calcRowLogicalHeight): 24 (WebCore::RenderTableSection::layoutRows): 25 1 26 2013-03-08 Chris Fleizach <cfleizach@apple.com> 2 27 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r143926 r145305 244 244 StackStats::LayoutCheckPoint layoutCheckPoint; 245 245 updateFirstLetter(); 246 247 int oldCellBaseline = cellBaselinePosition(); 246 248 layoutBlock(cellWidthChanged()); 249 250 // If we have replaced content, the intrinsic height of our content may have changed since the last time we laid out. If that's the case the intrinsic padding we used 251 // for layout (the padding required to push the contents of the cell down to the row's baseline) is included in our new height and baseline and makes both 252 // of them wrong. So if our content's intrinsic height has changed push the new content up into the intrinsic padding and relayout so that the rest of 253 // table and row layout can use the correct baseline and height for this cell. 254 if (isBaselineAligned() && cellBaselinePosition() > section()->rowBaseline(rowIndex())) { 255 int newIntrinsicPaddingBefore = max<LayoutUnit>(0, intrinsicPaddingBefore() - max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); 256 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); 257 setNeedsLayout(true, MarkOnlyThis); 258 layoutBlock(cellWidthChanged()); 259 } 260 247 261 setCellWidthChanged(false); 248 262 } -
trunk/Source/WebCore/rendering/RenderTableCell.h
r145242 r145305 126 126 127 127 LayoutUnit cellBaselinePosition() const; 128 bool isBaselineAligned() const 129 { 130 EVerticalAlign va = style()->verticalAlign(); 131 return va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH; 132 } 128 133 129 134 void computeIntrinsicPadding(int rowHeight); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r144565 r145305 320 320 321 321 // Find out the baseline. The baseline is set on the first row in a rowspan. 322 EVerticalAlign va = cell->style()->verticalAlign(); 323 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH) { 322 if (cell->isBaselineAligned()) { 324 323 LayoutUnit baselinePosition = cell->cellBaselinePosition(); 325 324 if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) { … … 584 583 585 584 // If the baseline moved, we may have to update the data for our row. Find out the new baseline. 586 EVerticalAlign va = cell->style()->verticalAlign(); 587 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH) { 585 if (cell->isBaselineAligned()) { 588 586 LayoutUnit baseline = cell->cellBaselinePosition(); 589 587 if (baseline > cell->borderBefore() + cell->paddingBefore())
Note: See TracChangeset
for help on using the changeset viewer.