Title: [195251] releases/WebKitGTK/webkit-2.10
Revision
195251
Author
[email protected]
Date
2016-01-18 23:51:45 -0800 (Mon, 18 Jan 2016)

Log Message

Merge r194867 - Padding added to table-cell element after font-size change.
https://bugs.webkit.org/show_bug.cgi?id=152796

Reviewed by David Hyatt.

Do not include intrinsicPaddingBefore value while figuring out the height of a row.
In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
without the additional padding (normal padding is included).

Source/WebCore:

Test: fast/table/table-baseline-grows.html

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

LayoutTests:

* TestExpectations: This test fails even without the patch when Ahem font is not used.
* fast/table/table-baseline-grows-expected.html: Added.
* fast/table/table-baseline-grows.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195250 => 195251)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-19 07:44:38 UTC (rev 195250)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-19 07:51:45 UTC (rev 195251)
@@ -1,3 +1,18 @@
+2016-01-11  Zalan Bujtas  <[email protected]>
+
+        Padding added to table-cell element after font-size change.
+        https://bugs.webkit.org/show_bug.cgi?id=152796
+
+        Reviewed by David Hyatt.
+
+        Do not include intrinsicPaddingBefore value while figuring out the height of a row.
+        In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
+        without the additional padding (normal padding is included).
+
+        * TestExpectations: This test fails even without the patch when Ahem font is not used.
+        * fast/table/table-baseline-grows-expected.html: Added.
+        * fast/table/table-baseline-grows.html: Added.
+
 2016-01-09  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r194426): First email field is not autofilled on amazon.com

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows-expected.html (0 => 195251)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows-expected.html	2016-01-19 07:51:45 UTC (rev 195251)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that baseline position is reset properly after font size change.</title>
+<style>
+td {
+	font-size: 30px;
+	vertical-align: baseline;
+}
+</style>
+</head>
+<body><table><tr><td>foo</td><td>bar</td></tr></table></body>
+</html>

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows.html (0 => 195251)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/table/table-baseline-grows.html	2016-01-19 07:51:45 UTC (rev 195251)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that baseline position is reset properly after font size change.</title>
+<style>
+td {
+	font-size: 30px;
+	vertical-align: baseline;
+}
+</style>
+</head>
+<body><table><tr><td id=first>foo</td><td>bar</td></tr></table></body>
+<script>
+
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+var cell = document.getElementById("first"); 
+setTimeout(function() {
+    cell.style.fontSize = "260px";
+    cell.offsetWidth;
+    cell.style.fontSize = "30px";
+    if (window.testRunner)
+        testRunner.notifyDone(); 
+  }, 0);
+</script>
+</html>
\ No newline at end of file

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195250 => 195251)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-19 07:44:38 UTC (rev 195250)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-19 07:51:45 UTC (rev 195251)
@@ -1,3 +1,19 @@
+2016-01-11  Zalan Bujtas  <[email protected]>
+
+        Padding added to table-cell element after font-size change.
+        https://bugs.webkit.org/show_bug.cgi?id=152796
+
+        Reviewed by David Hyatt.
+
+        Do not include intrinsicPaddingBefore value while figuring out the height of a row.
+        In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
+        without the additional padding (normal padding is included).
+
+        Test: fast/table/table-baseline-grows.html
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::calcRowLogicalHeight):
+
 2016-01-09  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r194426): First email field is not autofilled on amazon.com

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTableSection.cpp (195250 => 195251)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTableSection.cpp	2016-01-19 07:44:38 UTC (rev 195250)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTableSection.cpp	2016-01-19 07:51:45 UTC (rev 195251)
@@ -333,15 +333,16 @@
 
                 // Find out the baseline. The baseline is set on the first row in a rowspan.
                 if (cell->isBaselineAligned()) {
-                    LayoutUnit baselinePosition = cell->cellBaselinePosition();
-                    if (baselinePosition > cell->borderAndPaddingBefore()) {
+                    LayoutUnit baselinePosition = cell->cellBaselinePosition() - cell->intrinsicPaddingBefore();
+                    LayoutUnit borderAndComputedPaddingBefore = cell->borderAndPaddingBefore() - cell->intrinsicPaddingBefore();
+                    if (baselinePosition > borderAndComputedPaddingBefore) {
                         m_grid[cellStartRow].baseline = std::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. 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 = std::max(baselineDescent, cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore()));
+                            baselineDescent = std::max(baselineDescent, cellLogicalHeight - baselinePosition);
                             cellStartRowBaselineDescent = baselineDescent;
                         }
                         m_rowPos[cellStartRow + 1] = std::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