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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 1676933004: Table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colgroup paint bug125336 fix Created 4 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
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 901dfb458dbcee07d724b2053983d012986aeb79..715be719547269ef02b06477499d0443c6b6387f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1647,4 +1647,30 @@ void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign
cell->setLogicalLocation(cellLocation);
}
+LayoutRect LayoutTableSection::positionByCellSpan() const
+{
+ LayoutRect position;
+ LayoutTableRow* firstRow = this->firstRow();
+ LayoutTableRow* lastRow = this->lastRow();
+ if (firstRow && lastRow) {
+ position = firstRow->positionByCellSpan();
+ position.unite(lastRow->positionByCellSpan());
+ }
+ return position;
+}
+
+// Ideal cell is a cell that spans single row/column.
+// It is used to calculate position of colgroup/col/row
+// It is needed because actual cells can be arbitrary rectangles, or non-existent
+LayoutRect LayoutTableSection::positionOfIdealCell(unsigned row, unsigned col) const
+{
+ LayoutRect position;
+ LayoutTable * table = this->table();
+ unsigned left = table->columnPositions()[col];
+ unsigned top = m_rowPos[row];
+ unsigned right = table->columnPositions()[col+1];
+ unsigned bottom = m_rowPos[row+1];
+ left += table->hBorderSpacing();
+ return LayoutRect(LayoutPoint(left, top), LayoutSize(right - left, bottom-top));
+}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698