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

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

Issue 2584143003: Repeat footers in paginated context (Closed)
Patch Set: bug 656232 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/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index 1f2289c777b675937a03db1a95f2ac09b97639e3..0366220e38a9f37d690e74443172ff85dbde38f9 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -69,6 +69,7 @@ LayoutTable::LayoutTable(Element* element)
border_end_(0) {
DCHECK(!ChildrenInline());
effective_column_positions_.Fill(0, 1);
+ position_of_repeating_footer_group_on_page_.Fill(LayoutUnit(), 1);
}
LayoutTable::~LayoutTable() {}
@@ -645,6 +646,15 @@ void LayoutTable::UpdateLayout() {
: kTableHeightNotChanging;
old_available_logical_height_ = current_available_logical_height;
+ // Lay out table footer.
mstensho (USE GERRIT) 2017/04/24 11:57:15 Is it necessary to do this out-of-order? We should
+ if (LayoutTableSection* section = Footer()) {
+ if (section->GetPaginationBreakability() != kAllowAnyBreaks) {
+ section->LayoutIfNeeded();
+ int section_logical_height = section->CalcRowLogicalHeight();
+ section->SetLogicalHeight(LayoutUnit(section_logical_height));
+ }
+ }
+
// Lay out table header group.
if (LayoutTableSection* section = Header()) {
LayoutSection(*section, layouter, section_logical_left,
@@ -846,7 +856,7 @@ void LayoutTable::PaintObject(const PaintInfo& paint_info,
TablePainter(*this).PaintObject(paint_info, paint_offset);
}
-void LayoutTable::SubtractCaptionRect(LayoutRect& rect) const {
+void LayoutTable::SubtractCaptionRect(LayoutRect& rect, bool after_only) const {
for (unsigned i = 0; i < captions_.size(); i++) {
LayoutUnit caption_logical_height = captions_[i]->LogicalHeight() +
captions_[i]->MarginBefore() +
@@ -854,6 +864,8 @@ void LayoutTable::SubtractCaptionRect(LayoutRect& rect) const {
bool caption_is_before =
(captions_[i]->Style()->CaptionSide() != ECaptionSide::kBottom) ^
Style()->IsFlippedBlocksWritingMode();
+ if (caption_is_before && after_only)
+ continue;
if (Style()->IsHorizontalWritingMode()) {
rect.SetHeight(rect.Height() - caption_logical_height);
if (caption_is_before)

Powered by Google App Engine
This is Rietveld 408576698