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

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

Issue 2382043003: Use ceil() when integerizing pagination struts before table rows. (Closed)
Patch Set: rebase master 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/table-in-subpixel-fragmentainer-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/table-in-subpixel-fragmentainer-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698