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

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

Issue 2214093002: Make sure there's a table header before attempting to account for its offset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621258-2
Patch Set: 634155 Created 4 years, 4 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/no-repeating-thead-no-crash-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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 if (rowLayoutObject) { 996 if (rowLayoutObject) {
997 rowLayoutObject->setLocation(LayoutPoint(0, m_rowPos[r])); 997 rowLayoutObject->setLocation(LayoutPoint(0, m_rowPos[r]));
998 rowLayoutObject->setLogicalWidth(logicalWidth()); 998 rowLayoutObject->setLogicalWidth(logicalWidth());
999 rowLayoutObject->setLogicalHeight(LayoutUnit(m_rowPos[r + 1] - m_row Pos[r] - vspacing)); 999 rowLayoutObject->setLogicalHeight(LayoutUnit(m_rowPos[r + 1] - m_row Pos[r] - vspacing));
1000 rowLayoutObject->updateLayerTransformAfterLayout(); 1000 rowLayoutObject->updateLayerTransformAfterLayout();
1001 if (isPaginated) { 1001 if (isPaginated) {
1002 paginationStrutOnRow = paginationStrutForRow(rowLayoutObject, La youtUnit(m_rowPos[r])); 1002 paginationStrutOnRow = paginationStrutForRow(rowLayoutObject, La youtUnit(m_rowPos[r]));
1003 if (paginationStrutOnRow) { 1003 if (paginationStrutOnRow) {
1004 // If there isn't room for at least one content row on a pag e with a header group, then 1004 // If there isn't room for at least one content row on a pag e with a header group, then
1005 // we won't repeat the header on each page. 1005 // we won't repeat the header on each page.
1006 if (r == 0 && table()->sectionAbove(this) == table()->header ()) 1006 if (!r && table()->header() && table()->sectionAbove(this) = = table()->header())
1007 state.setHeightOffsetForTableHeaders(state.heightOffsetF orTableHeaders() - table()->header()->logicalHeight()); 1007 state.setHeightOffsetForTableHeaders(state.heightOffsetF orTableHeaders() - table()->header()->logicalHeight());
1008 // If we have a header group we will paint it at the top of each page, move the rows 1008 // If we have a header group we will paint it at the top of each page, move the rows
1009 // down to accomodate it. 1009 // down to accomodate it.
1010 paginationStrutOnRow += state.heightOffsetForTableHeaders(). toInt(); 1010 paginationStrutOnRow += state.heightOffsetForTableHeaders(). toInt();
1011 for (unsigned rowIndex = r; rowIndex <= totalRows; rowIndex+ +) 1011 for (unsigned rowIndex = r; rowIndex <= totalRows; rowIndex+ +)
1012 m_rowPos[rowIndex] += paginationStrutOnRow; 1012 m_rowPos[rowIndex] += paginationStrutOnRow;
1013 } 1013 }
1014 } 1014 }
1015 } 1015 }
1016 1016
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery, 1745 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery,
1746 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns. 1746 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns.
1747 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates. 1747 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates.
1748 if (table()->header() == this && hasRepeatingHeaderGroup()) 1748 if (table()->header() == this && hasRepeatingHeaderGroup())
1749 rect.setHeight(table()->logicalHeight()); 1749 rect.setHeight(table()->logicalHeight());
1750 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags); 1750 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags);
1751 } 1751 }
1752 1752
1753 1753
1754 } // namespace blink 1754 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/no-repeating-thead-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698