| Index: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
|
| index 89b925af6f41a1551f1d609cd14bd23c85fada16..39bd9e1a6937d8716978b2752a6fe52ec38cfad4 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
|
| @@ -1647,4 +1647,53 @@ void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign
|
| cell->setLogicalLocation(cellLocation);
|
| }
|
|
|
| +LayoutRect LayoutTableSection::getCellPosition(unsigned row, unsigned effectiveColumn) const
|
| +{
|
| + LayoutTable * table = this->table();
|
| +
|
| + LayoutUnit left = LayoutUnit(table->effectiveColumnPositions()[effectiveColumn]);
|
| + LayoutUnit top = LayoutUnit(m_rowPos[row]);
|
| + LayoutUnit right = LayoutUnit(table->effectiveColumnPositions()[effectiveColumn+1]);
|
| + LayoutUnit bottom = LayoutUnit(m_rowPos[row+1]);
|
| + left += LayoutUnit(table->hBorderSpacing());
|
| +
|
| + return LayoutRect(left, top, right - left, bottom - top);
|
| +}
|
| +
|
| +LayoutRect LayoutTableSection::getCellPhysicalPosition(unsigned row, unsigned effectiveColumn) const
|
| +{
|
| + return mapLogicalToPhysicalPosition(getCellPosition(row, effectiveColumn));
|
| +}
|
| +
|
| +LayoutRect LayoutTableSection::mapLogicalToPhysicalPosition(const LayoutRect& position) const
|
| +{
|
| + WritingMode writingMode = style()->getWritingMode();
|
| + bool isLTR = style()->isLeftToRightDirection();
|
| +
|
| + LayoutRect transformedPosition = position;
|
| + if (blink::isHorizontalWritingMode(writingMode)) {
|
| + if (!isLTR)
|
| + transformedPosition.setX(size().width() - transformedPosition.maxX());
|
| + } else {
|
| + transformedPosition = transformedPosition.transposedRect();
|
| + if (!isLTR)
|
| + transformedPosition.setY(size().height() - transformedPosition.maxY());
|
| + if (blink::isFlippedBlocksWritingMode(writingMode))
|
| + transformedPosition.setX(size().width() - transformedPosition.maxX());
|
| + }
|
| + return transformedPosition;
|
| +}
|
| +
|
| +LayoutRect LayoutTableSection::positionForBackgroundDrawing() const
|
| +{
|
| + LayoutRect position;
|
| + LayoutTableRow* firstRow = this->firstRow();
|
| + LayoutTableRow* lastRow = this->lastRow();
|
| + if (firstRow && lastRow) {
|
| + position = firstRow->positionForBackgroundDrawing();
|
| + position.unite(lastRow->positionForBackgroundDrawing());
|
| + }
|
| + return position;
|
| +}
|
| +
|
| } // namespace blink
|
|
|