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

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

Issue 2861653006: Fix LayoutTableRow::AddOverflowFromCell() (Closed)
Patch Set: Deflake the test Created 3 years, 7 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 a2b8f5d5a253ddc953d75c7d6270bb10bb158fa0..54b6566a729ab2b0e9239cb1ceeab910c457e7f1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -292,30 +292,35 @@ void LayoutTableRow::ComputeOverflow() {
}
void LayoutTableRow::AddOverflowFromCell(const LayoutTableCell* cell) {
- // Non-row-spanning-cells don't create overflow (they are fully contained
- // within this row).
- // TODO(crbug.com/603993): This seems incorrect because cell may have visual
- // effect overflow that should be included in this row.
- if (cell->RowSpan() == 1)
- return;
-
- // Cells only generates visual overflow.
- LayoutRect cell_visual_overflow_rect =
- cell->VisualOverflowRectForPropagation(StyleRef());
-
- // 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.
- cell_visual_overflow_rect.MoveBy(-Location());
- AddContentsVisualOverflow(cell_visual_overflow_rect);
-
// 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()) {
+ // Here don't check background existence to avoid requirement to invalidate
+ // overflow on change of background existence.
+ if (cell->RowSpan() > 1) {
LayoutRect cell_background_rect = cell->FrameRect();
cell_background_rect.MoveBy(-Location());
AddSelfVisualOverflow(cell_background_rect);
}
+
+ // Should propagate cell's overflow to row if the cell has row span or has
+ // overflow.
+ if (cell->RowSpan() == 1 && !cell->HasOverflowModel())
+ return;
+
+ // 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 the rects by cell_row_offset below.
+ LayoutSize cell_row_offset = cell->Location() - Location();
+
+ LayoutRect cell_visual_overflow_rect =
+ cell->VisualOverflowRectForPropagation(StyleRef());
+ cell_visual_overflow_rect.Move(cell_row_offset);
+ AddContentsVisualOverflow(cell_visual_overflow_rect);
+
+ LayoutRect cell_layout_overflow_rect =
+ cell->LayoutOverflowRectForPropagation(StyleRef());
+ cell_layout_overflow_rect.Move(cell_row_offset);
+ AddLayoutOverflow(cell_layout_overflow_rect);
}
bool LayoutTableRow::IsFirstRowInSectionAfterHeader() const {

Powered by Google App Engine
This is Rietveld 408576698