<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Padding added to table-cell element after font-size change"
   href="https://bugs.webkit.org/show_bug.cgi?id=152796#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Padding added to table-cell element after font-size change"
   href="https://bugs.webkit.org/show_bug.cgi?id=152796">bug 152796</a>
              from <span class="vcard"><a class="email" href="mailto:zalan&#64;apple.com" title="zalan &lt;zalan&#64;apple.com&gt;"> <span class="fn">zalan</span></a>
</span></b>
        <pre>baseline position compute is broken.

diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index ff9877b..a96cede 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
&#64;&#64; -333,15 +333,15 &#64;&#64; LayoutUnit RenderTableSection::calcRowLogicalHeight()

                 // Find out the baseline. The baseline is set on the first row in a rowspan.
                 if (cell-&gt;isBaselineAligned()) {
-                    LayoutUnit baselinePosition = cell-&gt;cellBaselinePosition();
-                    if (baselinePosition &gt; cell-&gt;borderAndPaddingBefore()) {
+                    LayoutUnit baselinePosition = cell-&gt;cellBaselinePosition() - cell-&gt;intrinsicPaddingBefore();
+                    if (baselinePosition &gt; cell-&gt;borderAndPaddingBefore() - cell-&gt;intrinsicPaddingBefore()) {
                         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.
                         LayoutUnit cellStartRowBaselineDescent = 0;
                         if (cell-&gt;rowSpan() == 1) {
-                            baselineDescent = std::max(baselineDescent, cellLogicalHeight - (baselinePosition - cell-&gt;intrinsicPaddingBefore()));
+                            baselineDescent = std::max(baselineDescent, cellLogicalHeight - baselinePosition);
                             cellStartRowBaselineDescent = baselineDescent;
                         }
                         m_rowPos[cellStartRow + 1] = std::max(m_rowPos[cellStartRow + 1], m_rowPos[cellStartRow] + m_grid[cellStartRow].baseline + cellStartRowBaselineDescent);</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>