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

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

Issue 1602773005: Respect break-inside:avoid on table rows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 9 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/LayoutTableCell.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
index 0fc9192c6c566f8e62a348534055b936b1872ee2..f1a72034116bd257f8b8c6a5a79c35cb5f2ddb81 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -999,4 +999,15 @@ bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect);
}
+LayoutUnit LayoutTableCell::calculatePaginationStrutToFitContent(LayoutUnit offset, LayoutUnit strutToNextPage, LayoutUnit contentLogicalHeight) const
+{
+ // If break-inside:avoid/forbid is set on a cell we should avoid setting a strut on lines unless the cell is taller than the page,
+ // in which case we've no choice but to allow it. This special-casing is needed because cells don't propagate struts like normal
+ // layout blocks - the struts are managed directly by the section when it lays out rows and cells.
+ LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(offset);
+ if (toLayoutBox(parent())->getPaginationBreakability() != AllowAnyBreaks && table()->vBorderSpacing() + logicalHeight() + contentLogicalHeight < pageLogicalHeight)
mstensho (USE GERRIT) 2016/04/04 21:05:39 I still think this looks strange. We have decided
+ return LayoutUnit();
+ return LayoutBlockFlow::calculatePaginationStrutToFitContent(offset, strutToNextPage, contentLogicalHeight);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698