OLD | NEW |
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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 if (remainingLogicalHeight >= rowLogicalHeight) | 1272 if (remainingLogicalHeight >= rowLogicalHeight) |
1273 return 0; // It fits fine where it is. No need to break. | 1273 return 0; // It fits fine where it is. No need to break. |
1274 LayoutUnit paginationStrut = calculatePaginationStrutToFitContent( | 1274 LayoutUnit paginationStrut = calculatePaginationStrutToFitContent( |
1275 logicalOffset, remainingLogicalHeight, rowLogicalHeight); | 1275 logicalOffset, remainingLogicalHeight, rowLogicalHeight); |
1276 if (paginationStrut == remainingLogicalHeight && | 1276 if (paginationStrut == remainingLogicalHeight && |
1277 remainingLogicalHeight == pageLogicalHeight) { | 1277 remainingLogicalHeight == pageLogicalHeight) { |
1278 // Don't break if we were at the top of a page, and we failed to fit the con
tent | 1278 // Don't break if we were at the top of a page, and we failed to fit the con
tent |
1279 // completely. No point in leaving a page completely blank. | 1279 // completely. No point in leaving a page completely blank. |
1280 return 0; | 1280 return 0; |
1281 } | 1281 } |
1282 return paginationStrut.toInt(); | 1282 // Table layout parts only work on integers, so we have to round. Round up, to |
| 1283 // make sure that no fraction ever gets left behind in the previous |
| 1284 // fragmentainer. |
| 1285 return paginationStrut.ceil(); |
1283 } | 1286 } |
1284 | 1287 |
1285 void LayoutTableSection::computeOverflowFromCells() { | 1288 void LayoutTableSection::computeOverflowFromCells() { |
1286 unsigned totalRows = m_grid.size(); | 1289 unsigned totalRows = m_grid.size(); |
1287 unsigned nEffCols = table()->numEffectiveColumns(); | 1290 unsigned nEffCols = table()->numEffectiveColumns(); |
1288 computeOverflowFromCells(totalRows, nEffCols); | 1291 computeOverflowFromCells(totalRows, nEffCols); |
1289 } | 1292 } |
1290 | 1293 |
1291 void LayoutTableSection::computeOverflowFromCells(unsigned totalRows, | 1294 void LayoutTableSection::computeOverflowFromCells(unsigned totalRows, |
1292 unsigned nEffCols) { | 1295 unsigned nEffCols) { |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 // Repeating table headers are painted once per fragmentation page/column. Thi
s does not go through the regular fragmentation machinery, | 1932 // Repeating table headers are painted once per fragmentation page/column. Thi
s does not go through the regular fragmentation machinery, |
1930 // so we need special code to expand the invalidation rect to contain all posi
tions of the header in all columns. | 1933 // so we need special code to expand the invalidation rect to contain all posi
tions of the header in all columns. |
1931 // Note that this is in flow thread coordinates, not visual coordinates. The e
nclosing LayoutFlowThread will convert to visual coordinates. | 1934 // Note that this is in flow thread coordinates, not visual coordinates. The e
nclosing LayoutFlowThread will convert to visual coordinates. |
1932 if (table()->header() == this && isRepeatingHeaderGroup()) | 1935 if (table()->header() == this && isRepeatingHeaderGroup()) |
1933 rect.setHeight(table()->logicalHeight()); | 1936 rect.setHeight(table()->logicalHeight()); |
1934 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, | 1937 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, |
1935 flags); | 1938 flags); |
1936 } | 1939 } |
1937 | 1940 |
1938 } // namespace blink | 1941 } // namespace blink |
OLD | NEW |