Title: [149585] trunk
Revision
149585
Author
[email protected]
Date
2013-05-06 00:32:33 -0700 (Mon, 06 May 2013)

Log Message

REGRESSION(r140907) - Backport blink r149612 to fix vertical-align and rowspan issue
https://bugs.webkit.org/show_bug.cgi?id=115611

Source/WebCore:

Patch by Julien Chaffraix.
Patch by Robert Hogan <[email protected]> on 2013-05-06
Reviewed by Benjamin Poulain.

Backport phttps://src.chromium.org/viewvc/blink?view=rev&revision=149612 from
https://chromiumcodereview.appspot.com/14105010

Fix the rows' height computation with vertical-align: baseline and rowspan.
r140907 was careful in avoiding updating the baseline descent for
spanning cells. However it still added the non-spanning cells baseline
descent to the spanning cells' row height computation.
This change avoids the previous issue by not adding the baseline
descent in this case.

Test: fast/table/baseline-align-rowspan.html

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):

LayoutTests:

Patch by Robert Hogan <[email protected]> on 2013-05-06
Reviewed by Benjamin Poulain.

* fast/table/baseline-align-rowspan-expected.txt: Added.
* fast/table/baseline-align-rowspan.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (149584 => 149585)


--- trunk/LayoutTests/ChangeLog	2013-05-06 05:43:48 UTC (rev 149584)
+++ trunk/LayoutTests/ChangeLog	2013-05-06 07:32:33 UTC (rev 149585)
@@ -1,3 +1,13 @@
+2013-05-06  Robert Hogan  <[email protected]>
+
+        REGRESSION(r140907) - Backport blink r149612 to fix vertical-align and rowspan issue
+        https://bugs.webkit.org/show_bug.cgi?id=115611
+
+        Reviewed by Benjamin Poulain.
+
+        * fast/table/baseline-align-rowspan-expected.txt: Added.
+        * fast/table/baseline-align-rowspan.html: Added.
+
 2013-05-05  Chris Fleizach  <[email protected]>
 
         AX: aria-checked not exposed correctly on menuitemcheckbox or menuitemradio roles

Added: trunk/LayoutTests/fast/table/baseline-align-rowspan-expected.txt (0 => 149585)


--- trunk/LayoutTests/fast/table/baseline-align-rowspan-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/table/baseline-align-rowspan-expected.txt	2013-05-06 07:32:33 UTC (rev 149585)
@@ -0,0 +1,15 @@
+This test checks that baseline aligned cells with rowspan don't artificially grow the row's height.
+
+For this test to pass, there should be 2 PASS.
+
+This first sentence should	be baseline	aligned and there should be no gap below.
+PASS
+This second
+
+be baseline
+
+sentence should also
+
+aligned across the rowspan.
+
+PASS

Added: trunk/LayoutTests/fast/table/baseline-align-rowspan.html (0 => 149585)


--- trunk/LayoutTests/fast/table/baseline-align-rowspan.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/baseline-align-rowspan.html	2013-05-06 07:32:33 UTC (rev 149585)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<style>
+td {
+    font: 10px/1 Ahem;
+    vertical-align: baseline;
+    border: 1px solid;
+}
+</style>
+</head>
+<body _onload_="checkLayout('tr')">
+<p>This test checks that baseline aligned cells with rowspan don't artificially grow the row's height.</p>
+<p>For this test to pass, there should be 2 PASS.</p>
+<table>
+    <tr data-expected-height="24">
+        <td>This first sentence should</td>
+        <td rowspan="2">be baseline</td>
+        <td>aligned and there should be no gap below.</td>
+    </tr>
+    <tr data-expected-height="54">
+        <td><p>This second</p><p>be baseline</p></td>
+        <td><p>sentence should also</p><p>aligned across the rowspan.</p></td>
+    </tr>
+</table>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (149584 => 149585)


--- trunk/Source/WebCore/ChangeLog	2013-05-06 05:43:48 UTC (rev 149584)
+++ trunk/Source/WebCore/ChangeLog	2013-05-06 07:32:33 UTC (rev 149585)
@@ -1,3 +1,26 @@
+2013-05-06  Robert Hogan  <[email protected]>
+
+        REGRESSION(r140907) - Backport blink r149612 to fix vertical-align and rowspan issue
+        https://bugs.webkit.org/show_bug.cgi?id=115611
+
+        Patch by Julien Chaffraix.
+        Reviewed by Benjamin Poulain.
+
+        Backport phttps://src.chromium.org/viewvc/blink?view=rev&revision=149612 from 
+        https://chromiumcodereview.appspot.com/14105010
+        
+        Fix the rows' height computation with vertical-align: baseline and rowspan.
+        r140907 was careful in avoiding updating the baseline descent for
+        spanning cells. However it still added the non-spanning cells baseline
+        descent to the spanning cells' row height computation.
+        This change avoids the previous issue by not adding the baseline
+        descent in this case.
+
+        Test: fast/table/baseline-align-rowspan.html
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::calcRowLogicalHeight):
+
 2013-05-05  Anders Carlsson  <[email protected]>
 
         Remove Vector::prepend

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (149584 => 149585)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-05-06 05:43:48 UTC (rev 149584)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-05-06 07:32:33 UTC (rev 149585)
@@ -339,10 +339,14 @@
                     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);
                     }
                 }
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to