Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: Source/core/layout/LayoutTableCell.cpp

Issue 910083002: Constify and use LayoutStyle reference in layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined again Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutTableCell.h ('k') | Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTableCell.cpp
diff --git a/Source/core/layout/LayoutTableCell.cpp b/Source/core/layout/LayoutTableCell.cpp
index 00f292de8f5d6d4ddbfe6ef42f7437fffa7a177a..fefca898d222d87637ca8449be4d3094e259880d 100644
--- a/Source/core/layout/LayoutTableCell.cpp
+++ b/Source/core/layout/LayoutTableCell.cpp
@@ -321,7 +321,7 @@ LayoutRect LayoutTableCell::clippedOverflowRectForPaintInvalidation(const Layout
if (!table()->collapseBorders() || table()->needsSectionRecalc())
return RenderBlockFlow::clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState);
- bool rtl = !styleForCellFlow()->isLeftToRightDirection();
+ bool rtl = !styleForCellFlow().isLeftToRightDirection();
int outlineSize = style()->outlineSize();
int left = std::max(borderHalfLeft(true), outlineSize);
int right = std::max(borderHalfRight(true), outlineSize);
@@ -500,8 +500,8 @@ CollapsedBorderValue LayoutTableCell::computeCollapsedStartBorder(IncludeBorderC
// For the start border, we need to check, in order of precedence:
// (1) Our start border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->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 ? resolveColor(startColorProperty) : Color(), BCELL);
// (2) The end border of the preceding cell.
@@ -603,8 +603,8 @@ CollapsedBorderValue LayoutTableCell::computeCollapsedEndBorder(IncludeBorderCol
// For end border, we need to check, in order of precedence:
// (1) Our end border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->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 ? resolveColor(endColorProperty) : Color(), BCELL);
// (2) The start border of the following cell.
@@ -702,8 +702,8 @@ CollapsedBorderValue LayoutTableCell::computeCollapsedBeforeBorder(IncludeBorder
// For before border, we need to check, in order of precedence:
// (1) Our before border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->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 ? resolveColor(beforeColorProperty) : Color(), BCELL);
LayoutTableCell* prevCell = table->cellAbove(this);
@@ -788,8 +788,8 @@ CollapsedBorderValue LayoutTableCell::computeCollapsedAfterBorder(IncludeBorderC
// For after border, we need to check, in order of precedence:
// (1) Our after border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->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 ? resolveColor(afterColorProperty) : Color(), BCELL);
LayoutTableCell* nextCell = table->cellBelow(this);
@@ -896,41 +896,41 @@ int LayoutTableCell::borderAfter() const
int LayoutTableCell::borderHalfLeft(bool outer) const
{
- const LayoutStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ const LayoutStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
}
int LayoutTableCell::borderHalfRight(bool outer) const
{
- const LayoutStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ const LayoutStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
}
int LayoutTableCell::borderHalfTop(bool outer) const
{
- const LayoutStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ const LayoutStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
}
int LayoutTableCell::borderHalfBottom(bool outer) const
{
- const LayoutStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ const LayoutStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
}
int LayoutTableCell::borderHalfStart(bool outer) const
{
CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->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;
}
@@ -938,7 +938,7 @@ int LayoutTableCell::borderHalfEnd(bool outer) const
{
CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
+ return (border.width() + ((styleForCellFlow().isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
return 0;
}
@@ -946,7 +946,7 @@ int LayoutTableCell::borderHalfBefore(bool outer) const
{
CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->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;
}
@@ -954,7 +954,7 @@ int LayoutTableCell::borderHalfAfter(bool outer) const
{
CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
+ return (border.width() + ((styleForCellFlow().isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
return 0;
}
« no previous file with comments | « Source/core/layout/LayoutTableCell.h ('k') | Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698