Title: [113162] trunk/Source/WebCore
Revision
113162
Author
[email protected]
Date
2012-04-04 03:37:36 -0700 (Wed, 04 Apr 2012)

Log Message

Switch baseline values to LayoutUnits in RenderTableSection.
https://bugs.webkit.org/show_bug.cgi?id=83017

Reviewed by Julien Chaffraix.

We initially intend to keep table layout on integers post switching the render tree to primarily
use sub-pixel precision. Baseline positions switch to sub-pixel units, and in table layout code are
combined with padding (also sub-pixel), which means we ideally won't truncate their values until
after they're added together. Converting baseline values in RenderTableSection to LayoutUnits.

No new tests. No change in behavior.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderTableSection.h:
(RowStruct):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113161 => 113162)


--- trunk/Source/WebCore/ChangeLog	2012-04-04 10:29:26 UTC (rev 113161)
+++ trunk/Source/WebCore/ChangeLog	2012-04-04 10:37:36 UTC (rev 113162)
@@ -1,3 +1,23 @@
+2012-04-03  Levi Weintraub  <[email protected]>
+
+        Switch baseline values to LayoutUnits in RenderTableSection.
+        https://bugs.webkit.org/show_bug.cgi?id=83017
+
+        Reviewed by Julien Chaffraix.
+
+        We initially intend to keep table layout on integers post switching the render tree to primarily
+        use sub-pixel precision. Baseline positions switch to sub-pixel units, and in table layout code are
+        combined with padding (also sub-pixel), which means we ideally won't truncate their values until
+        after they're added together. Converting baseline values in RenderTableSection to LayoutUnits.
+
+        No new tests. No change in behavior.
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::calcRowLogicalHeight):
+        (WebCore::RenderTableSection::layoutRows):
+        * rendering/RenderTableSection.h:
+        (RowStruct):
+
 2012-04-04  Zan Dobersek  <[email protected]>
 
         [GTK] Scrolling doesn't work in WebKit2 since r110185

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (113161 => 113162)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2012-04-04 10:29:26 UTC (rev 113161)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2012-04-04 10:37:36 UTC (rev 113162)
@@ -336,7 +336,7 @@
 
     for (unsigned r = 0; r < m_grid.size(); r++) {
         m_grid[r].baseline = 0;
-        int baselineDescent = 0;
+        LayoutUnit baselineDescent = 0;
 
         // Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
         m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0, viewRenderer), 0);
@@ -377,7 +377,7 @@
             // find out the baseline
             EVerticalAlign va = cell->style()->verticalAlign();
             if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
-                int baselinePosition = cell->cellBaselinePosition();
+                LayoutUnit baselinePosition = cell->cellBaselinePosition();
                 if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) {
                     m_grid[r].baseline = max(m_grid[r].baseline, baselinePosition - cell->intrinsicPaddingBefore());
                     baselineDescent = max(baselineDescent, m_rowPos[cellStartRow] + cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore()));
@@ -388,7 +388,7 @@
         // do we have baseline aligned elements?
         if (m_grid[r].baseline)
             // increase rowheight if baseline requires
-            m_rowPos[r + 1] = max(m_rowPos[r + 1], m_grid[r].baseline + baselineDescent);
+            m_rowPos[r + 1] = max<int>(m_rowPos[r + 1], m_grid[r].baseline + baselineDescent);
 
         // Add the border-spacing to our final position.
         m_rowPos[r + 1] += m_grid[r].rowRenderer ? spacing : 0;
@@ -620,7 +620,7 @@
                 // If the baseline moved, we may have to update the data for our row. Find out the new baseline.
                 EVerticalAlign va = cell->style()->verticalAlign();
                 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
-                    int baseline = cell->cellBaselinePosition();
+                    LayoutUnit baseline = cell->cellBaselinePosition();
                     if (baseline > cell->borderBefore() + cell->paddingBefore())
                         m_grid[r].baseline = max(m_grid[r].baseline, baseline);
                 }
@@ -637,7 +637,7 @@
                 case TEXT_TOP:
                 case TEXT_BOTTOM:
                 case BASELINE: {
-                    int b = cell->cellBaselinePosition();
+                    LayoutUnit b = cell->cellBaselinePosition();
                     if (b > cell->borderBefore() + cell->paddingBefore())
                         intrinsicPaddingBefore = getBaseline(r) - (b - oldIntrinsicPaddingBefore);
                     break;

Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (113161 => 113162)


--- trunk/Source/WebCore/rendering/RenderTableSection.h	2012-04-04 10:29:26 UTC (rev 113161)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h	2012-04-04 10:37:36 UTC (rev 113162)
@@ -110,7 +110,7 @@
 
         Row row;
         RenderTableRow* rowRenderer;
-        int baseline;
+        LayoutUnit baseline;
         Length logicalHeight;
     };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to