Switch RenderTable* to new layout types
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2011 21:01:45 +0000 (21:01 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2011 21:01:45 +0000 (21:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66146

Reviewed by Eric Seidel.

Converting RenderTable* classes to new LayoutUnits from ints.

No new tests as no new functionality.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstLineBoxBaseline):
(WebCore::RenderTable::overflowClipRect):
* rendering/RenderTable.h:
(WebCore::RenderTable::columnPositions):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::clippedOverflowRectForRepaint):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::clippedOverflowRectForRepaint):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::setCellLogicalWidths):
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::calcOuterBorderBefore):
(WebCore::RenderTableSection::calcOuterBorderAfter):
(WebCore::RenderTableSection::calcOuterBorderStart):
(WebCore::RenderTableSection::calcOuterBorderEnd):
(WebCore::RenderTableSection::firstLineBoxBaseline):
(WebCore::RenderTableSection::paintObject):
(WebCore::RenderTableSection::nodeAtPoint):
* rendering/RenderTableSection.h:
(WebCore::RenderTableSection::outerBorderBefore):
(WebCore::RenderTableSection::outerBorderAfter):
(WebCore::RenderTableSection::outerBorderStart):
(WebCore::RenderTableSection::outerBorderEnd):
(WebCore::RenderTableSection::getBaseline):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.png
LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.png
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCol.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTableSection.h

index ee9dc4d..cf177af 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.png and b/LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.png differ
index cf05c76..819af52 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.png and b/LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.png differ
index 768dd85..3befc5a 100644 (file)
@@ -1,3 +1,41 @@
+2011-08-12  Levi Weintraub  <leviw@chromium.org>
+
+        Switch RenderTable* to new layout types
+        https://bugs.webkit.org/show_bug.cgi?id=66146
+
+        Reviewed by Eric Seidel.
+
+        Converting RenderTable* classes to new LayoutUnits from ints.
+
+        No new tests as no new functionality.
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::firstLineBoxBaseline):
+        (WebCore::RenderTable::overflowClipRect):
+        * rendering/RenderTable.h:
+        (WebCore::RenderTable::columnPositions):
+        * rendering/RenderTableCol.cpp:
+        (WebCore::RenderTableCol::clippedOverflowRectForRepaint):
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::clippedOverflowRectForRepaint):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::setCellLogicalWidths):
+        (WebCore::RenderTableSection::calcRowLogicalHeight):
+        (WebCore::RenderTableSection::layoutRows):
+        (WebCore::RenderTableSection::calcOuterBorderBefore):
+        (WebCore::RenderTableSection::calcOuterBorderAfter):
+        (WebCore::RenderTableSection::calcOuterBorderStart):
+        (WebCore::RenderTableSection::calcOuterBorderEnd):
+        (WebCore::RenderTableSection::firstLineBoxBaseline):
+        (WebCore::RenderTableSection::paintObject):
+        (WebCore::RenderTableSection::nodeAtPoint):
+        * rendering/RenderTableSection.h:
+        (WebCore::RenderTableSection::outerBorderBefore):
+        (WebCore::RenderTableSection::outerBorderAfter):
+        (WebCore::RenderTableSection::outerBorderStart):
+        (WebCore::RenderTableSection::outerBorderEnd):
+        (WebCore::RenderTableSection::getBaseline):
+
 2011-08-12  Adam Bergkvist  <adam.bergkvist@ericsson.com>
 
         Reviewed by Alexey Proskuryakov.
index 35cf2db..8923ff9 100644 (file)
@@ -1144,7 +1144,7 @@ void RenderTable::updateFirstLetter()
 {
 }
 
-int RenderTable::firstLineBoxBaseline() const
+LayoutUnit RenderTable::firstLineBoxBaseline() const
 {
     if (isWritingModeRoot())
         return -1;
@@ -1161,9 +1161,9 @@ int RenderTable::firstLineBoxBaseline() const
     return firstNonEmptySection->logicalTop() + firstNonEmptySection->firstLineBoxBaseline();
 }
 
-IntRect RenderTable::overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy relevancy)
+LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, OverlayScrollbarSizeRelevancy relevancy)
 {
-    IntRect rect = RenderBlock::overflowClipRect(location, relevancy);
+    LayoutRect rect = RenderBlock::overflowClipRect(location, relevancy);
     
     // If we have a caption, expand the clip to include the caption.
     // FIXME: Technically this is wrong, but it's virtually impossible to fix this
index 6c156be..7353390 100644 (file)
@@ -139,7 +139,7 @@ public:
     };
 
     Vector<ColumnStruct>& columns() { return m_columns; }
-    Vector<int>& columnPositions() { return m_columnPos; }
+    Vector<LayoutUnit>& columnPositions() { return m_columnPos; }
     RenderTableSection* header() const { return m_head; }
     RenderTableSection* footer() const { return m_foot; }
     RenderTableSection* firstBody() const { return m_firstBody; }
@@ -222,7 +222,7 @@ private:
     virtual void computePreferredLogicalWidths();
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
     
-    virtual int firstLineBoxBaseline() const;
+    virtual LayoutUnit firstLineBoxBaseline() const;
 
     virtual RenderBlock* firstLineBlock() const;
     virtual void updateFirstLetter();
@@ -231,7 +231,7 @@ private:
 
     virtual void computeLogicalWidth();
 
-    virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
+    virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
 
     virtual void addOverflowFromChildren();
 
@@ -241,7 +241,7 @@ private:
     void recalcSections() const;
     void adjustLogicalHeightForCaption();
 
-    mutable Vector<int> m_columnPos;
+    mutable Vector<LayoutUnit> m_columnPos;
     mutable Vector<ColumnStruct> m_columns;
 
     mutable RenderBlock* m_caption;
index f3190fa..8e99923 100644 (file)
@@ -78,7 +78,7 @@ IntRect RenderTableCol::clippedOverflowRectForRepaint(RenderBoxModelObject* repa
 
     RenderTable* parentTable = table();
     if (!parentTable)
-        return IntRect();
+        return LayoutRect();
     return parentTable->clippedOverflowRectForRepaint(repaintContainer);
 }
 
index f8966f5..3d6ff3c 100644 (file)
@@ -254,7 +254,7 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
 
 void RenderTableSection::setCellLogicalWidths()
 {
-    Vector<int>& columnPos = table()->columnPositions();
+    Vector<LayoutUnit>& columnPos = table()->columnPositions();
 
     LayoutStateMaintainer statePusher(view());
     
@@ -293,7 +293,7 @@ void RenderTableSection::setCellLogicalWidths()
     statePusher.pop(); // only pops if we pushed
 }
 
-int RenderTableSection::calcRowLogicalHeight()
+LayoutUnit RenderTableSection::calcRowLogicalHeight()
 {
 #ifndef NDEBUG
     setNeedsLayoutIsForbidden(true);
@@ -303,7 +303,7 @@ int RenderTableSection::calcRowLogicalHeight()
 
     RenderTableCell* cell;
 
-    int spacing = table()->vBorderSpacing();
+    LayoutUnit spacing = table()->vBorderSpacing();
 
     LayoutStateMaintainer statePusher(view());
 
@@ -313,10 +313,10 @@ int RenderTableSection::calcRowLogicalHeight()
     for (int r = 0; r < m_gridRows; r++) {
         m_rowPos[r + 1] = 0;
         m_grid[r].baseline = 0;
-        int baseline = 0;
-        int bdesc = 0;
-        int ch = m_grid[r].logicalHeight.calcMinValue(0);
-        int pos = m_rowPos[r] + ch + (m_grid[r].rowRenderer ? spacing : 0);
+        LayoutUnit baseline = 0;
+        LayoutUnit bdesc = 0;
+        LayoutUnit ch = m_grid[r].logicalHeight.calcMinValue(0);
+        LayoutUnit pos = m_rowPos[r] + ch + (m_grid[r].rowRenderer ? spacing : 0);
 
         m_rowPos[r + 1] = max(m_rowPos[r + 1], pos);
 
@@ -339,7 +339,7 @@ int RenderTableSection::calcRowLogicalHeight()
                 if (!statePusher.didPush()) {
                     // Technically, we should also push state for the row, but since
                     // rows don't push a coordinate transform, that's not necessary.
-                    statePusher.push(this, IntSize(x(), y()));
+                    statePusher.push(this, locationOffset());
                 }
                 cell->clearIntrinsicPadding();
                 cell->clearOverrideSize();
@@ -347,9 +347,9 @@ int RenderTableSection::calcRowLogicalHeight()
                 cell->layoutIfNeeded();
             }
 
-            int adjustedPaddingBefore = cell->paddingBefore() - cell->intrinsicPaddingBefore();
-            int adjustedPaddingAfter = cell->paddingAfter() - cell->intrinsicPaddingAfter();
-            int adjustedLogicalHeight = cell->logicalHeight() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());
+            LayoutUnit adjustedPaddingBefore = cell->paddingBefore() - cell->intrinsicPaddingBefore();
+            LayoutUnit adjustedPaddingAfter = cell->paddingAfter() - cell->intrinsicPaddingAfter();
+            LayoutUnit adjustedLogicalHeight = cell->logicalHeight() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());
 
             // Explicit heights use the border box in quirks mode.  In strict mode do the right
             // thing and actually add in the border and padding.
@@ -365,7 +365,7 @@ int RenderTableSection::calcRowLogicalHeight()
             // find out the baseline
             EVerticalAlign va = cell->style()->verticalAlign();
             if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
-                int b = cell->cellBaselinePosition();
+                LayoutUnit b = cell->cellBaselinePosition();
                 if (b > cell->borderBefore() + cell->paddingBefore()) {
                     baseline = max(baseline, b - cell->intrinsicPaddingBefore());
                     bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore()));
@@ -409,7 +409,7 @@ void RenderTableSection::layout()
     setNeedsLayout(false);
 }
 
-int RenderTableSection::layoutRows(int toAdd)
+LayoutUnit RenderTableSection::layoutRows(LayoutUnit toAdd)
 {
 #ifndef NDEBUG
     setNeedsLayoutIsForbidden(true);
@@ -417,7 +417,7 @@ int RenderTableSection::layoutRows(int toAdd)
 
     ASSERT(!needsLayout());
 
-    int rHeight;
+    LayoutUnit rHeight;
     int rindx;
     int totalRows = m_gridRows;
     
@@ -427,9 +427,9 @@ int RenderTableSection::layoutRows(int toAdd)
     m_hasOverflowingCell = false;
 
     if (toAdd && totalRows && (m_rowPos[totalRows] || !nextSibling())) {
-        int totalHeight = m_rowPos[totalRows] + toAdd;
+        LayoutUnit totalHeight = m_rowPos[totalRows] + toAdd;
 
-        int dh = toAdd;
+        LayoutUnit dh = toAdd;
         int totalPercent = 0;
         int numAuto = 0;
         for (int r = 0; r < totalRows; r++) {
@@ -440,15 +440,15 @@ int RenderTableSection::layoutRows(int toAdd)
         }
         if (totalPercent) {
             // try to satisfy percent
-            int add = 0;
+            LayoutUnit add = 0;
             totalPercent = min(totalPercent, 100);
             int rh = m_rowPos[1] - m_rowPos[0];
             for (int r = 0; r < totalRows; r++) {
                 if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
-                    int toAdd = min(dh, static_cast<int>((totalHeight * m_grid[r].logicalHeight.percent() / 100) - rh));
+                    LayoutUnit toAdd = min(dh, static_cast<LayoutUnit>((totalHeight * m_grid[r].logicalHeight.percent() / 100) - rh));
                     // If toAdd is negative, then we don't want to shrink the row (this bug
                     // affected Outlook Web Access).
-                    toAdd = max(0, toAdd);
+                    toAdd = max<LayoutUnit>(0, toAdd);
                     add += toAdd;
                     dh -= toAdd;
                     totalPercent -= m_grid[r].logicalHeight.percent();
@@ -460,10 +460,10 @@ int RenderTableSection::layoutRows(int toAdd)
         }
         if (numAuto) {
             // distribute over variable cols
-            int add = 0;
+            LayoutUnit add = 0;
             for (int r = 0; r < totalRows; r++) {
                 if (numAuto > 0 && m_grid[r].logicalHeight.isAuto()) {
-                    int toAdd = dh / numAuto;
+                    LayoutUnit toAdd = dh / numAuto;
                     add += toAdd;
                     dh -= toAdd;
                     numAuto--;
@@ -473,9 +473,9 @@ int RenderTableSection::layoutRows(int toAdd)
         }
         if (dh > 0 && m_rowPos[totalRows]) {
             // if some left overs, distribute equally.
-            int tot = m_rowPos[totalRows];
-            int add = 0;
-            int prev = m_rowPos[0];
+            LayoutUnit tot = m_rowPos[totalRows];
+            LayoutUnit add = 0;
+            LayoutUnit prev = m_rowPos[0];
             for (int r = 0; r < totalRows; r++) {
                 // weight with the original height
                 add += dh * (m_rowPos[r + 1] - prev) / tot;
@@ -485,16 +485,16 @@ int RenderTableSection::layoutRows(int toAdd)
         }
     }
 
-    int hspacing = table()->hBorderSpacing();
-    int vspacing = table()->vBorderSpacing();
-    int nEffCols = table()->numEffCols();
+    LayoutUnit hspacing = table()->hBorderSpacing();
+    LayoutUnit vspacing = table()->vBorderSpacing();
+    LayoutUnit nEffCols = table()->numEffCols();
 
-    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
+    LayoutStateMaintainer statePusher(view(), this, LayoutSize(x(), y()), style()->isFlippedBlocksWritingMode());
 
     for (int r = 0; r < totalRows; r++) {
         // Set the row's x/y position and width/height.
         if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
-            rowRenderer->setLocation(IntPoint(0, m_rowPos[r]));
+            rowRenderer->setLocation(LayoutPoint(0, m_rowPos[r]));
             rowRenderer->setLogicalWidth(logicalWidth());
             rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);
             rowRenderer->updateLayerTransform();
@@ -568,24 +568,24 @@ int RenderTableSection::layoutRows(int toAdd)
                 // 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 b = cell->cellBaselinePosition();
-                    if (b > cell->borderBefore() + cell->paddingBefore())
-                        m_grid[r].baseline = max(m_grid[r].baseline, b);
+                    LayoutUnit baseline = cell->cellBaselinePosition();
+                    if (baseline > cell->borderBefore() + cell->paddingBefore())
+                        m_grid[r].baseline = max(m_grid[r].baseline, baseline);
                 }
             }
 
-            int oldIntrinsicPaddingBefore = cell->intrinsicPaddingBefore();
-            int oldIntrinsicPaddingAfter = cell->intrinsicPaddingAfter();
-            int logicalHeightWithoutIntrinsicPadding = cell->logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
+            LayoutUnit oldIntrinsicPaddingBefore = cell->intrinsicPaddingBefore();
+            LayoutUnit oldIntrinsicPaddingAfter = cell->intrinsicPaddingAfter();
+            LayoutUnit logicalHeightWithoutIntrinsicPadding = cell->logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
 
-            int intrinsicPaddingBefore = 0;
+            LayoutUnit intrinsicPaddingBefore = 0;
             switch (cell->style()->verticalAlign()) {
                 case SUB:
                 case SUPER:
                 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;
@@ -602,19 +602,19 @@ int RenderTableSection::layoutRows(int toAdd)
                     break;
             }
             
-            int intrinsicPaddingAfter = rHeight - logicalHeightWithoutIntrinsicPadding - intrinsicPaddingBefore;
+            LayoutUnit intrinsicPaddingAfter = rHeight - logicalHeightWithoutIntrinsicPadding - intrinsicPaddingBefore;
             cell->setIntrinsicPaddingBefore(intrinsicPaddingBefore);
             cell->setIntrinsicPaddingAfter(intrinsicPaddingAfter);
 
-            IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
+            LayoutRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
 
-            IntPoint cellLocation(0, m_rowPos[rindx]);
+            LayoutPoint cellLocation(0, m_rowPos[rindx]);
             if (!style()->isLeftToRightDirection())
                 cellLocation.setX(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing);
             else
                 cellLocation.setX(table()->columnPositions()[c] + hspacing);
             cell->setLogicalLocation(cellLocation);
-            view()->addLayoutDelta(IntSize(oldCellRect.x() - cell->x(), oldCellRect.y() - cell->y()));
+            view()->addLayoutDelta(oldCellRect.location() - cell->location());
 
             if (intrinsicPaddingBefore != oldIntrinsicPaddingBefore || intrinsicPaddingAfter != oldIntrinsicPaddingAfter)
                 cell->setNeedsLayout(true, false);
@@ -628,7 +628,7 @@ int RenderTableSection::layoutRows(int toAdd)
             if (style()->isHorizontalWritingMode() && view()->layoutState()->pageLogicalHeight() && cell->height() != rHeight)
                 cell->setHeight(rHeight); // FIXME: Pagination might have made us change size.  For now just shrink or grow the cell to fit without doing a relayout.
 
-            IntSize childOffset(cell->x() - oldCellRect.x(), cell->y() - oldCellRect.y());
+            LayoutSize childOffset(cell->location() - oldCellRect.location());
             if (childOffset.width() || childOffset.height()) {
                 view()->addLayoutDelta(childOffset);
 
@@ -667,7 +667,7 @@ int RenderTableSection::layoutRows(int toAdd)
     return height();
 }
 
-int RenderTableSection::calcOuterBorderBefore() const
+LayoutUnit RenderTableSection::calcOuterBorderBefore() const
 {
     int totalCols = table()->numEffCols();
     if (!m_gridRows || !totalCols)
@@ -718,7 +718,7 @@ int RenderTableSection::calcOuterBorderBefore() const
     return borderWidth / 2;
 }
 
-int RenderTableSection::calcOuterBorderAfter() const
+LayoutUnit RenderTableSection::calcOuterBorderAfter() const
 {
     int totalCols = table()->numEffCols();
     if (!m_gridRows || !totalCols)
@@ -769,7 +769,7 @@ int RenderTableSection::calcOuterBorderAfter() const
     return (borderWidth + 1) / 2;
 }
 
-int RenderTableSection::calcOuterBorderStart() const
+LayoutUnit RenderTableSection::calcOuterBorderStart() const
 {
     int totalCols = table()->numEffCols();
     if (!m_gridRows || !totalCols)
@@ -813,7 +813,7 @@ int RenderTableSection::calcOuterBorderStart() const
     return (borderWidth + (table()->style()->isLeftToRightDirection() ? 0 : 1)) / 2;
 }
 
-int RenderTableSection::calcOuterBorderEnd() const
+LayoutUnit RenderTableSection::calcOuterBorderEnd() const
 {
     int totalCols = table()->numEffCols();
     if (!m_gridRows || !totalCols)
@@ -865,12 +865,12 @@ void RenderTableSection::recalcOuterBorder()
     m_outerBorderEnd = calcOuterBorderEnd();
 }
 
-int RenderTableSection::firstLineBoxBaseline() const
+LayoutUnit RenderTableSection::firstLineBoxBaseline() const
 {
     if (!m_gridRows)
         return -1;
 
-    int firstLineBaseline = m_grid[0].baseline;
+    LayoutUnit firstLineBaseline = m_grid[0].baseline;
     if (firstLineBaseline)
         return firstLineBaseline + m_rowPos[0];
 
@@ -996,7 +996,7 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, const LayoutPoint& pa
     // FIXME: Implement RTL.
     if (!m_hasOverflowingCell && style()->isLeftToRightDirection()) {
         LayoutUnit start = (style()->isHorizontalWritingMode() ? localRepaintRect.x() : localRepaintRect.y()) - os;
-        Vector<int>& columnPos = table()->columnPositions();
+        Vector<LayoutUnit>& columnPos = table()->columnPositions();
         startcol = std::lower_bound(columnPos.begin(), columnPos.end(), start) - columnPos.begin();
         if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startcol] > start)))
             --startcol;
@@ -1189,7 +1189,7 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
     unsigned hitRow = nextRow > 0 ? nextRow - 1 : 0;
 
     Vector<LayoutUnit>& columnPos = table()->columnPositions();
-    int offsetInRowDirection = style()->isHorizontalWritingMode() ? location.x() : location.y();
+    LayoutUnit offsetInRowDirection = style()->isHorizontalWritingMode() ? location.x() : location.y();
     if (!style()->isLeftToRightDirection())
         offsetInRowDirection = columnPos[columnPos.size() - 1] - offsetInRowDirection;
 
index 9f1f406..5762bd9 100644 (file)
@@ -43,13 +43,13 @@ public:
 
     virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
 
-    virtual int firstLineBoxBaseline() const;
+    virtual LayoutUnit firstLineBoxBaseline() const;
 
     void addCell(RenderTableCell*, RenderTableRow* row);
 
     void setCellLogicalWidths();
-    int calcRowLogicalHeight();
-    int layoutRows(int logicalHeight);
+    LayoutUnit calcRowLogicalHeight();
+    LayoutUnit layoutRows(LayoutUnit logicalHeight);
 
     RenderTable* table() const { return toRenderTable(parent()); }
 
@@ -78,7 +78,7 @@ public:
     struct RowStruct {
         Row* row;
         RenderTableRow* rowRenderer;
-        int baseline;
+        LayoutUnit baseline;
         Length logicalHeight;
     };
 
@@ -93,16 +93,16 @@ public:
     void appendColumn(int pos);
     void splitColumn(int pos, int first);
 
-    int calcOuterBorderBefore() const;
-    int calcOuterBorderAfter() const;
-    int calcOuterBorderStart() const;
-    int calcOuterBorderEnd() const;
+    LayoutUnit calcOuterBorderBefore() const;
+    LayoutUnit calcOuterBorderAfter() const;
+    LayoutUnit calcOuterBorderStart() const;
+    LayoutUnit calcOuterBorderEnd() const;
     void recalcOuterBorder();
 
-    int outerBorderBefore() const { return m_outerBorderBefore; }
-    int outerBorderAfter() const { return m_outerBorderAfter; }
-    int outerBorderStart() const { return m_outerBorderStart; }
-    int outerBorderEnd() const { return m_outerBorderEnd; }
+    LayoutUnit outerBorderBefore() const { return m_outerBorderBefore; }
+    LayoutUnit outerBorderAfter() const { return m_outerBorderAfter; }
+    LayoutUnit outerBorderStart() const { return m_outerBorderStart; }
+    LayoutUnit outerBorderEnd() const { return m_outerBorderEnd; }
 
     int numRows() const { return m_gridRows; }
     int numColumns() const;
@@ -116,7 +116,7 @@ public:
     bool needsCellRecalc() const { return m_needsCellRecalc; }
     void setNeedsCellRecalc();
 
-    int getBaseline(int row) { return m_grid[row].baseline; }
+    LayoutUnit getBaseline(int row) { return m_grid[row].baseline; }
 
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
@@ -146,7 +146,7 @@ private:
     RenderObjectChildList m_children;
 
     Vector<RowStruct> m_grid;
-    Vector<int> m_rowPos;
+    Vector<LayoutUnit> m_rowPos;
 
     int m_gridRows;
 
@@ -154,10 +154,10 @@ private:
     int m_cCol;
     int m_cRow;
 
-    int m_outerBorderStart;
-    int m_outerBorderEnd;
-    int m_outerBorderBefore;
-    int m_outerBorderAfter;
+    LayoutUnit m_outerBorderStart;
+    LayoutUnit m_outerBorderEnd;
+    LayoutUnit m_outerBorderBefore;
+    LayoutUnit m_outerBorderAfter;
 
     bool m_needsCellRecalc;
     bool m_hasOverflowingCell;