Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (119032 => 119033)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-05-31 03:14:38 UTC (rev 119032)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-05-31 03:15:06 UTC (rev 119033)
@@ -260,7 +260,7 @@
if (!table()->collapseBorders() || table()->needsSectionRecalc())
return RenderBlock::clippedOverflowRectForRepaint(repaintContainer);
- bool rtl = !table()->style()->isLeftToRightDirection();
+ bool rtl = !styleForCellFlow()->isLeftToRightDirection();
int outlineSize = style()->outlineSize();
int left = max(borderHalfLeft(true), outlineSize);
int right = max(borderHalfRight(true), outlineSize);
@@ -420,8 +420,8 @@
// For the start border, we need to check, in order of precedence:
// (1) Our start border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, table->style()->direction(), table->style()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, table->style()->direction(), table->style()->writingMode()) : 0;
+ int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
+ int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
CollapsedBorderValue result(style()->borderStart(), includeColor ? style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
// (2) The end border of the preceding cell.
@@ -491,8 +491,8 @@
// For end border, we need to check, in order of precedence:
// (1) Our end border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, table->style()->direction(), table->style()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, table->style()->direction(), table->style()->writingMode()) : 0;
+ int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
+ int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
CollapsedBorderValue result = CollapsedBorderValue(style()->borderEnd(), includeColor ? style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
// (2) The start border of the following cell.
@@ -564,8 +564,8 @@
// For before border, we need to check, in order of precedence:
// (1) Our before border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, table->style()->direction(), table->style()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, table->style()->direction(), table->style()->writingMode()) : 0;
+ int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
+ int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
CollapsedBorderValue result = CollapsedBorderValue(style()->borderBefore(), includeColor ? style()->visitedDependentColor(beforeColorProperty) : Color(), BCELL);
RenderTableCell* prevCell = table->cellAbove(this);
@@ -650,8 +650,8 @@
// For after border, we need to check, in order of precedence:
// (1) Our after border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, table->style()->direction(), table->style()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, table->style()->direction(), table->style()->writingMode()) : 0;
+ int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
+ int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
CollapsedBorderValue result = CollapsedBorderValue(style()->borderAfter(), includeColor ? style()->visitedDependentColor(afterColorProperty) : Color(), BCELL);
RenderTableCell* nextCell = table->cellBelow(this);
@@ -713,32 +713,32 @@
return result;
}
-inline CollapsedBorderValue RenderTableCell::cachedCollapsedLeftBorder(RenderStyle* tableStyle) const
+inline CollapsedBorderValue RenderTableCell::cachedCollapsedLeftBorder(const RenderStyle* styleForCellFlow) const
{
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd);
- return tableStyle->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBefore);
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd);
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBefore);
}
-inline CollapsedBorderValue RenderTableCell::cachedCollapsedRightBorder(RenderStyle* tableStyle) const
+inline CollapsedBorderValue RenderTableCell::cachedCollapsedRightBorder(const RenderStyle* styleForCellFlow) const
{
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart);
- return tableStyle->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAfter);
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart);
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAfter);
}
-inline CollapsedBorderValue RenderTableCell::cachedCollapsedTopBorder(RenderStyle* tableStyle) const
+inline CollapsedBorderValue RenderTableCell::cachedCollapsedTopBorder(const RenderStyle* styleForCellFlow) const
{
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBefore);
- return tableStyle->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd);
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBefore);
+ return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd);
}
-inline CollapsedBorderValue RenderTableCell::cachedCollapsedBottomBorder(RenderStyle* tableStyle) const
+inline CollapsedBorderValue RenderTableCell::cachedCollapsedBottomBorder(const RenderStyle* styleForCellFlow) const
{
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAfter);
- return tableStyle->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart);
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAfter);
+ return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart);
}
int RenderTableCell::borderLeft() const
@@ -785,41 +785,41 @@
int RenderTableCell::borderHalfLeft(bool outer) const
{
- RenderStyle* tableStyle = table()->style();
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
- return tableStyle->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ const RenderStyle* styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
}
int RenderTableCell::borderHalfRight(bool outer) const
{
- RenderStyle* tableStyle = table()->style();
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
- return tableStyle->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ const RenderStyle* styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
}
int RenderTableCell::borderHalfTop(bool outer) const
{
- RenderStyle* tableStyle = table()->style();
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
- return tableStyle->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ const RenderStyle* styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
}
int RenderTableCell::borderHalfBottom(bool outer) const
{
- RenderStyle* tableStyle = table()->style();
- if (tableStyle->isHorizontalWritingMode())
- return tableStyle->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
- return tableStyle->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ const RenderStyle* styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow->isHorizontalWritingMode())
+ return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
}
int RenderTableCell::borderHalfStart(bool outer) const
{
CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((table()->style()->isLeftToRightDirection() ^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left.
+ return (border.width() + ((styleForCellFlow()->isLeftToRightDirection() ^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left.
return 0;
}
@@ -827,7 +827,7 @@
{
CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((table()->style()->isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
+ return (border.width() + ((styleForCellFlow()->isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
return 0;
}
@@ -835,7 +835,7 @@
{
CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((table()->style()->isFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left.
+ return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left.
return 0;
}
@@ -843,7 +843,7 @@
{
CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((table()->style()->isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
+ return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
return 0;
}
@@ -968,11 +968,11 @@
if (!table()->currentBorderValue() || graphicsContext->paintingDisabled())
return;
- RenderStyle* tableStyle = table()->style();
- CollapsedBorderValue leftVal = cachedCollapsedLeftBorder(tableStyle);
- CollapsedBorderValue rightVal = cachedCollapsedRightBorder(tableStyle);
- CollapsedBorderValue topVal = cachedCollapsedTopBorder(tableStyle);
- CollapsedBorderValue bottomVal = cachedCollapsedBottomBorder(tableStyle);
+ const RenderStyle* styleForCellFlow = this->styleForCellFlow();
+ CollapsedBorderValue leftVal = cachedCollapsedLeftBorder(styleForCellFlow);
+ CollapsedBorderValue rightVal = cachedCollapsedRightBorder(styleForCellFlow);
+ CollapsedBorderValue topVal = cachedCollapsedTopBorder(styleForCellFlow);
+ CollapsedBorderValue bottomVal = cachedCollapsedBottomBorder(styleForCellFlow);
// Adjust our x/y/width/height so that we paint the collapsed borders at the correct location.
int topWidth = topVal.width();