Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (92991 => 92992)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2011-08-12 20:58:53 UTC (rev 92991)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2011-08-12 21:01:45 UTC (rev 92992)
@@ -1144,7 +1144,7 @@
{
}
-int RenderTable::firstLineBoxBaseline() const
+LayoutUnit RenderTable::firstLineBoxBaseline() const
{
if (isWritingModeRoot())
return -1;
@@ -1161,9 +1161,9 @@
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
Modified: trunk/Source/WebCore/rendering/RenderTable.h (92991 => 92992)
--- trunk/Source/WebCore/rendering/RenderTable.h 2011-08-12 20:58:53 UTC (rev 92991)
+++ trunk/Source/WebCore/rendering/RenderTable.h 2011-08-12 21:01:45 UTC (rev 92992)
@@ -139,7 +139,7 @@
};
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 @@
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 @@
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 @@
void recalcSections() const;
void adjustLogicalHeightForCaption();
- mutable Vector<int> m_columnPos;
+ mutable Vector<LayoutUnit> m_columnPos;
mutable Vector<ColumnStruct> m_columns;
mutable RenderBlock* m_caption;
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (92991 => 92992)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2011-08-12 20:58:53 UTC (rev 92991)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2011-08-12 21:01:45 UTC (rev 92992)
@@ -254,7 +254,7 @@
void RenderTableSection::setCellLogicalWidths()
{
- Vector<int>& columnPos = table()->columnPositions();
+ Vector<LayoutUnit>& columnPos = table()->columnPositions();
LayoutStateMaintainer statePusher(view());
@@ -293,7 +293,7 @@
statePusher.pop(); // only pops if we pushed
}
-int RenderTableSection::calcRowLogicalHeight()
+LayoutUnit RenderTableSection::calcRowLogicalHeight()
{
#ifndef NDEBUG
setNeedsLayoutIsForbidden(true);
@@ -303,7 +303,7 @@
RenderTableCell* cell;
- int spacing = table()->vBorderSpacing();
+ LayoutUnit spacing = table()->vBorderSpacing();
LayoutStateMaintainer statePusher(view());
@@ -313,10 +313,10 @@
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 @@
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 @@
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 @@
// 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 @@
setNeedsLayout(false);
}
-int RenderTableSection::layoutRows(int toAdd)
+LayoutUnit RenderTableSection::layoutRows(LayoutUnit toAdd)
{
#ifndef NDEBUG
setNeedsLayoutIsForbidden(true);
@@ -417,7 +417,7 @@
ASSERT(!needsLayout());
- int rHeight;
+ LayoutUnit rHeight;
int rindx;
int totalRows = m_gridRows;
@@ -427,9 +427,9 @@
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 @@
}
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 @@
}
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 @@
}
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 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 @@
// 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 @@
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 @@
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 @@
return height();
}
-int RenderTableSection::calcOuterBorderBefore() const
+LayoutUnit RenderTableSection::calcOuterBorderBefore() const
{
int totalCols = table()->numEffCols();
if (!m_gridRows || !totalCols)
@@ -718,7 +718,7 @@
return borderWidth / 2;
}
-int RenderTableSection::calcOuterBorderAfter() const
+LayoutUnit RenderTableSection::calcOuterBorderAfter() const
{
int totalCols = table()->numEffCols();
if (!m_gridRows || !totalCols)
@@ -769,7 +769,7 @@
return (borderWidth + 1) / 2;
}
-int RenderTableSection::calcOuterBorderStart() const
+LayoutUnit RenderTableSection::calcOuterBorderStart() const
{
int totalCols = table()->numEffCols();
if (!m_gridRows || !totalCols)
@@ -813,7 +813,7 @@
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 @@
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 @@
// 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 @@
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;
Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (92991 => 92992)
--- trunk/Source/WebCore/rendering/RenderTableSection.h 2011-08-12 20:58:53 UTC (rev 92991)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h 2011-08-12 21:01:45 UTC (rev 92992)
@@ -43,13 +43,13 @@
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 @@
struct RowStruct {
Row* row;
RenderTableRow* rowRenderer;
- int baseline;
+ LayoutUnit baseline;
Length logicalHeight;
};
@@ -93,16 +93,16 @@
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 @@
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 @@
RenderObjectChildList m_children;
Vector<RowStruct> m_grid;
- Vector<int> m_rowPos;
+ Vector<LayoutUnit> m_rowPos;
int m_gridRows;
@@ -154,10 +154,10 @@
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;