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

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

Issue 2426553004: Clean up break-inside restriction propagation from table headers. (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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableRow.cpp ('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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 ASSERT(!needsLayout()); 1246 ASSERT(!needsLayout());
1247 1247
1248 setLogicalHeight(LayoutUnit(m_rowPos[totalRows])); 1248 setLogicalHeight(LayoutUnit(m_rowPos[totalRows]));
1249 1249
1250 computeOverflowFromCells(totalRows, nEffCols); 1250 computeOverflowFromCells(totalRows, nEffCols);
1251 } 1251 }
1252 1252
1253 int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row, 1253 int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row,
1254 LayoutUnit logicalOffset) const { 1254 LayoutUnit logicalOffset) const {
1255 DCHECK(row); 1255 DCHECK(row);
1256 // Even if the row allows us to break-inside, we will want to put a strut on 1256 if (row->getPaginationBreakability() == AllowAnyBreaks)
1257 // the row if we have a header group that wants to appear at the top of each
1258 // page.
1259 bool tableHeaderForcesStrut =
1260 table()->header()
1261 ? table()->header()->getPaginationBreakability() != AllowAnyBreaks
1262 : false;
1263 if (row->getPaginationBreakability() == AllowAnyBreaks &&
1264 !tableHeaderForcesStrut)
1265 return 0; 1257 return 0;
1266 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 1258 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
1267 if (!pageLogicalHeight) 1259 if (!pageLogicalHeight)
1268 return 0; 1260 return 0;
1269 // If the row is too tall for the page don't insert a strut. 1261 // If the row is too tall for the page don't insert a strut.
1270 LayoutUnit rowLogicalHeight = row->logicalHeight(); 1262 LayoutUnit rowLogicalHeight = row->logicalHeight();
1271 if (rowLogicalHeight > pageLogicalHeight) 1263 if (rowLogicalHeight > pageLogicalHeight)
1272 return 0; 1264 return 0;
1273 1265
1274 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset( 1266 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 // the header in all columns. 2003 // the header in all columns.
2012 // Note that this is in flow thread coordinates, not visual coordinates. The 2004 // Note that this is in flow thread coordinates, not visual coordinates. The
2013 // enclosing LayoutFlowThread will convert to visual coordinates. 2005 // enclosing LayoutFlowThread will convert to visual coordinates.
2014 if (table()->header() == this && isRepeatingHeaderGroup()) 2006 if (table()->header() == this && isRepeatingHeaderGroup())
2015 rect.setHeight(table()->logicalHeight()); 2007 rect.setHeight(table()->logicalHeight());
2016 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, 2008 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect,
2017 flags); 2009 flags);
2018 } 2010 }
2019 2011
2020 } // namespace blink 2012 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableRow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698