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

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

Issue 2786463004: Paint backgrounds of a table section/row in one display item (Closed)
Patch Set: - Created 3 years, 8 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/LayoutTableRow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
index 3184ad5c5a4ef04f7f70463640b98b687cc92e81..d9bc0f0223ff1235d5bbbf5d6826e10dd9eecc22 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -305,11 +305,16 @@ void LayoutTableRow::addOverflowFromCell(const LayoutTableCell* cell) {
// The cell and the row share the section's coordinate system. However
// the visual overflow should be determined in the coordinate system of
// the row, that's why we shift it below.
- LayoutUnit cellOffsetLogicalTopDifference =
- cell->location().y() - location().y();
- cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference);
-
+ cellVisualOverflowRect.moveBy(-location());
addContentsVisualOverflow(cellVisualOverflowRect);
+
+ // Table row paints its background behind cells. If the cell spans multiple
+ // rows, the row's visual rect should be expanded to cover the cell.
+ if (styleRef().hasBackground()) {
+ LayoutRect cellBackgroundRect = cell->frameRect();
+ cellBackgroundRect.moveBy(-location());
+ addSelfVisualOverflow(cellBackgroundRect);
+ }
}
bool LayoutTableRow::isFirstRowInSectionAfterHeader() const {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698