Changeset 120616 in webkit


Ignore:
Timestamp:
Jun 18, 2012 12:30:33 PM (12 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: table-height-algorithm-012 fails
https://bugs.webkit.org/show_bug.cgi?id=85652

Reviewed by Julien Chaffraix.

Source/WebCore:

Test: css2.1/20110323/table-height-algorithm-012.htm

fast/css/vertical-align-baseline-rowspan-001.htm
fast/css/vertical-align-baseline-rowspan-002.htm
fast/css/vertical-align-baseline-rowspan-003.htm
fast/css/vertical-align-baseline-rowspan-004.htm
fast/css/vertical-align-baseline-rowspan-005.htm
fast/css/vertical-align-baseline-rowspan-006.htm
fast/css/vertical-align-baseline-rowspan-007.htm
fast/css/vertical-align-baseline-rowspan-008.htm
fast/css/vertical-align-baseline-rowspan-009.htm

A spanning cell with Vertical-align set to 'baseline' should align the cell's content baseline
(which is the bottom of the first line of text or in-flow content) with the baseline of the first of the rows it spans.

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::calcRowLogicalHeight): Only calculate the baseline for the first row in a rowspan. This

ensures that any height added to the rowspan from the baseline is only added to the first row in the span rather than
to each of them.

(WebCore::RenderTableSection::layoutRows): Rather than get the baseline for each row in a rowspan (with the result that

only the baseline for the last row actually sticks), calculate it for the first row in the rowspan only. This function is
inefficient when handling rowspans so this doesn't fix the fact that redundant calculations are performed on each subsequent
row in the span - that should be done separately.

LayoutTests:

  • css2.1/20110323/table-height-algorithm-012-expected.html: Added.
  • css2.1/20110323/table-height-algorithm-012.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-001-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-001.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-002-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-002.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-003-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-003.htm: Added.

These are a few variations on table-height-algorithm-012.htm

  • fast/css/vertical-align-baseline-rowspan-004-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-004.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-005-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-005.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-006-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-006.htm: Added.

These three test the calculation of the baseline RenderTableSection::calcRowLogicalHeight,
where we now always use the first row in the span. Without this the 'Filler Text' in the middle
cell aligns beyond the top of the table.

  • fast/css/vertical-align-baseline-rowspan-007-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-007.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-008-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-008.htm: Added.
  • fast/css/vertical-align-baseline-rowspan-009-expected.html: Added.
  • fast/css/vertical-align-baseline-rowspan-009.htm: Added.

These make sure the alignment used in the first row of the span is correct when things like
the height of the cell and the height of the span are specified.

Location:
trunk
Files:
20 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120615 r120616  
     12012-06-18  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: table-height-algorithm-012 fails
     4        https://bugs.webkit.org/show_bug.cgi?id=85652
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        * css2.1/20110323/table-height-algorithm-012-expected.html: Added.
     9        * css2.1/20110323/table-height-algorithm-012.htm: Added.
     10        * fast/css/vertical-align-baseline-rowspan-001-expected.html: Added.
     11        * fast/css/vertical-align-baseline-rowspan-001.htm: Added.
     12        * fast/css/vertical-align-baseline-rowspan-002-expected.html: Added.
     13        * fast/css/vertical-align-baseline-rowspan-002.htm: Added.
     14        * fast/css/vertical-align-baseline-rowspan-003-expected.html: Added.
     15        * fast/css/vertical-align-baseline-rowspan-003.htm: Added.
     16            These are a few variations on table-height-algorithm-012.htm
     17        * fast/css/vertical-align-baseline-rowspan-004-expected.html: Added.
     18        * fast/css/vertical-align-baseline-rowspan-004.htm: Added.
     19        * fast/css/vertical-align-baseline-rowspan-005-expected.html: Added.
     20        * fast/css/vertical-align-baseline-rowspan-005.htm: Added.
     21        * fast/css/vertical-align-baseline-rowspan-006-expected.html: Added.
     22        * fast/css/vertical-align-baseline-rowspan-006.htm: Added.
     23            These three test the calculation of the baseline RenderTableSection::calcRowLogicalHeight,
     24            where we now always use the first row in the span. Without this the 'Filler Text' in the middle
     25            cell aligns beyond the top of the table.
     26        * fast/css/vertical-align-baseline-rowspan-007-expected.html: Added.
     27        * fast/css/vertical-align-baseline-rowspan-007.htm: Added.
     28        * fast/css/vertical-align-baseline-rowspan-008-expected.html: Added.
     29        * fast/css/vertical-align-baseline-rowspan-008.htm: Added.
     30        * fast/css/vertical-align-baseline-rowspan-009-expected.html: Added.
     31        * fast/css/vertical-align-baseline-rowspan-009.htm: Added.
     32            These make sure the alignment used in the first row of the span is correct when things like
     33            the height of the cell and the height of the span are specified.
     34
     35
    1362012-06-18  Hayato Ito  <hayato@chromium.org>
    237
  • trunk/Source/WebCore/ChangeLog

    r120615 r120616  
     12012-06-18  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: table-height-algorithm-012 fails
     4        https://bugs.webkit.org/show_bug.cgi?id=85652
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        Test: css2.1/20110323/table-height-algorithm-012.htm
     9              fast/css/vertical-align-baseline-rowspan-001.htm
     10              fast/css/vertical-align-baseline-rowspan-002.htm
     11              fast/css/vertical-align-baseline-rowspan-003.htm
     12              fast/css/vertical-align-baseline-rowspan-004.htm
     13              fast/css/vertical-align-baseline-rowspan-005.htm
     14              fast/css/vertical-align-baseline-rowspan-006.htm
     15              fast/css/vertical-align-baseline-rowspan-007.htm
     16              fast/css/vertical-align-baseline-rowspan-008.htm
     17              fast/css/vertical-align-baseline-rowspan-009.htm
     18
     19        A spanning cell with Vertical-align set to 'baseline' should align the cell's content baseline
     20        (which is the bottom of the first line of text or in-flow content) with the baseline of the first of the rows it spans.
     21
     22        * rendering/RenderTableSection.cpp:
     23        (WebCore::RenderTableSection::calcRowLogicalHeight): Only calculate the baseline for the first row in a rowspan. This
     24          ensures that any height added to the rowspan from the baseline is only added to the first row in the span rather than
     25          to each of them.
     26        (WebCore::RenderTableSection::layoutRows): Rather than get the baseline for each row in a rowspan (with the result that
     27          only the baseline for the last row actually sticks), calculate it for the first row in the rowspan only. This function is
     28          inefficient when handling rowspans so this doesn't fix the fact that redundant calculations are performed on each subsequent
     29          row in the span - that should be done separately.
     30
    1312012-06-18  Hayato Ito  <hayato@chromium.org>
    232
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r120605 r120616  
    374374                LayoutUnit baselinePosition = cell->cellBaselinePosition();
    375375                if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) {
    376                     m_grid[r].baseline = max(m_grid[r].baseline, baselinePosition - cell->intrinsicPaddingBefore());
     376                    m_grid[cellStartRow].baseline = max(m_grid[cellStartRow].baseline, baselinePosition - cell->intrinsicPaddingBefore());
    377377                    baselineDescent = max(baselineDescent, m_rowPos[cellStartRow] + cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore()));
    378378                }
     
    634634                case LENGTH:
    635635                case BASELINE: {
    636                     LayoutUnit b = cell->cellBaselinePosition();
    637                     if (b > cell->borderBefore() + cell->paddingBefore())
    638                         intrinsicPaddingBefore = getBaseline(r) - (b - oldIntrinsicPaddingBefore);
     636                    LayoutUnit baseline = cell->cellBaselinePosition();
     637                    if (baseline > cell->borderBefore() + cell->paddingBefore())
     638                        intrinsicPaddingBefore = getBaseline(cell->rowIndex()) - (baseline - oldIntrinsicPaddingBefore);
    639639                    break;
    640640                }
Note: See TracChangeset for help on using the changeset viewer.