| Index: third_party/WebKit/Source/core/paint/TableCellPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/TableCellPainter.cpp b/third_party/WebKit/Source/core/paint/TableCellPainter.cpp
|
| index ec772402c33a84df07a352337fdd93e55a06a8e5..06c10abee1a4ba826fc7820f941ab377bbddd02e 100644
|
| --- a/third_party/WebKit/Source/core/paint/TableCellPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/TableCellPainter.cpp
|
| @@ -11,45 +11,48 @@
|
| #include "core/paint/ObjectPainter.h"
|
| #include "core/paint/PaintInfo.h"
|
| #include "platform/graphics/GraphicsContextStateSaver.h"
|
| +#include "platform/graphics/paint/DrawingRecorder.h"
|
|
|
| namespace blink {
|
|
|
| static const CollapsedBorderValue& collapsedLeftBorder(
|
| const ComputedStyle& styleForCellFlow,
|
| const LayoutTableCell::CollapsedBorderValues& values) {
|
| - if (styleForCellFlow.isHorizontalWritingMode())
|
| - return styleForCellFlow.isLeftToRightDirection() ? values.startBorder
|
| - : values.endBorder;
|
| - return styleForCellFlow.isFlippedBlocksWritingMode() ? values.afterBorder
|
| - : values.beforeBorder;
|
| + if (styleForCellFlow.isHorizontalWritingMode()) {
|
| + return styleForCellFlow.isLeftToRightDirection() ? values.startBorder()
|
| + : values.endBorder();
|
| + }
|
| + return styleForCellFlow.isFlippedBlocksWritingMode() ? values.afterBorder()
|
| + : values.beforeBorder();
|
| }
|
|
|
| static const CollapsedBorderValue& collapsedRightBorder(
|
| const ComputedStyle& styleForCellFlow,
|
| const LayoutTableCell::CollapsedBorderValues& values) {
|
| - if (styleForCellFlow.isHorizontalWritingMode())
|
| - return styleForCellFlow.isLeftToRightDirection() ? values.endBorder
|
| - : values.startBorder;
|
| - return styleForCellFlow.isFlippedBlocksWritingMode() ? values.beforeBorder
|
| - : values.afterBorder;
|
| + if (styleForCellFlow.isHorizontalWritingMode()) {
|
| + return styleForCellFlow.isLeftToRightDirection() ? values.endBorder()
|
| + : values.startBorder();
|
| + }
|
| + return styleForCellFlow.isFlippedBlocksWritingMode() ? values.beforeBorder()
|
| + : values.afterBorder();
|
| }
|
|
|
| static const CollapsedBorderValue& collapsedTopBorder(
|
| const ComputedStyle& styleForCellFlow,
|
| const LayoutTableCell::CollapsedBorderValues& values) {
|
| if (styleForCellFlow.isHorizontalWritingMode())
|
| - return values.beforeBorder;
|
| - return styleForCellFlow.isLeftToRightDirection() ? values.startBorder
|
| - : values.endBorder;
|
| + return values.beforeBorder();
|
| + return styleForCellFlow.isLeftToRightDirection() ? values.startBorder()
|
| + : values.endBorder();
|
| }
|
|
|
| static const CollapsedBorderValue& collapsedBottomBorder(
|
| const ComputedStyle& styleForCellFlow,
|
| const LayoutTableCell::CollapsedBorderValues& values) {
|
| if (styleForCellFlow.isHorizontalWritingMode())
|
| - return values.afterBorder;
|
| - return styleForCellFlow.isLeftToRightDirection() ? values.endBorder
|
| - : values.startBorder;
|
| + return values.afterBorder();
|
| + return styleForCellFlow.isLeftToRightDirection() ? values.endBorder()
|
| + : values.startBorder();
|
| }
|
|
|
| void TableCellPainter::paint(const PaintInfo& paintInfo,
|
| @@ -65,6 +68,15 @@ static EBorderStyle collapsedBorderStyle(EBorderStyle style) {
|
| return style;
|
| }
|
|
|
| +const DisplayItemClient& TableCellPainter::displayItemClientForBorders() const {
|
| + // TODO(wkorman): We may need to handle PaintInvalidationDelayedFull.
|
| + // http://crbug.com/657186
|
| + return m_layoutTableCell.usesTableAsAdditionalDisplayItemClient()
|
| + ? static_cast<const DisplayItemClient&>(
|
| + *m_layoutTableCell.collapsedBorderValues())
|
| + : m_layoutTableCell;
|
| +}
|
| +
|
| void TableCellPainter::paintCollapsedBorders(
|
| const PaintInfo& paintInfo,
|
| const LayoutPoint& paintOffset,
|
| @@ -119,14 +131,15 @@ void TableCellPainter::paintCollapsedBorders(
|
| paintRect.height() + topWidth / 2 + (bottomWidth + 1) / 2);
|
|
|
| GraphicsContext& graphicsContext = paintInfo.context;
|
| - if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(
|
| - graphicsContext, m_layoutTableCell,
|
| + const DisplayItemClient& client = displayItemClientForBorders();
|
| + if (DrawingRecorder::useCachedDrawingIfPossible(
|
| + graphicsContext, client,
|
| static_cast<DisplayItem::Type>(displayItemType)))
|
| return;
|
|
|
| - LayoutObjectDrawingRecorder recorder(
|
| - graphicsContext, m_layoutTableCell,
|
| - static_cast<DisplayItem::Type>(displayItemType), borderRect);
|
| + DrawingRecorder recorder(graphicsContext, client,
|
| + static_cast<DisplayItem::Type>(displayItemType),
|
| + borderRect);
|
| Color cellColor = m_layoutTableCell.resolveColor(CSSPropertyColor);
|
|
|
| // We never paint diagonals at the joins. We simply let the border with the
|
|
|