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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 2363313002: Offset repeating theads correctly when two tables adjoin at a page border (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1118
1119 ASSERT(!needsLayout()); 1119 ASSERT(!needsLayout());
1120 1120
1121 setLogicalHeight(LayoutUnit(m_rowPos[totalRows])); 1121 setLogicalHeight(LayoutUnit(m_rowPos[totalRows]));
1122 1122
1123 computeOverflowFromCells(totalRows, nEffCols); 1123 computeOverflowFromCells(totalRows, nEffCols);
1124 } 1124 }
1125 1125
1126 int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row, LayoutUnit lo gicalOffset) const 1126 int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row, LayoutUnit lo gicalOffset) const
1127 { 1127 {
1128 DCHECK(row);
1128 // Even if the row allows us to break-inside, we will want to put a strut on the row if we have a header 1129 // Even if the row allows us to break-inside, we will want to put a strut on the row if we have a header
1129 // group that wants to appear at the top of each page. 1130 // group that wants to appear at the top of each page.
1130 bool tableHeaderForcesStrut = table()->header() ? table()->header()->getPagi nationBreakability() != AllowAnyBreaks : false; 1131 bool tableHeaderForcesStrut = table()->header() ? table()->header()->getPagi nationBreakability() != AllowAnyBreaks : false;
1131 if (row->getPaginationBreakability() == AllowAnyBreaks && !tableHeaderForces Strut) 1132 if (row->getPaginationBreakability() == AllowAnyBreaks && !tableHeaderForces Strut)
1132 return 0; 1133 return 0;
1133 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 1134 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
1134 if (!pageLogicalHeight) 1135 if (!pageLogicalHeight)
1135 return 0; 1136 return 0;
1136 // If the row is too tall for the page don't insert a strut. 1137 // If the row is too tall for the page don't insert a strut.
1137 LayoutUnit rowLogicalHeight = row->logicalHeight(); 1138 LayoutUnit rowLogicalHeight = row->logicalHeight();
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery, 1725 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery,
1725 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns. 1726 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns.
1726 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates. 1727 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates.
1727 if (table()->header() == this && hasRepeatingHeaderGroup()) 1728 if (table()->header() == this && hasRepeatingHeaderGroup())
1728 rect.setHeight(table()->logicalHeight()); 1729 rect.setHeight(table()->logicalHeight());
1729 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags); 1730 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags);
1730 } 1731 }
1731 1732
1732 1733
1733 } // namespace blink 1734 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698