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

Side by Side Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 2455733003: Provide a dedicated getter for the offset to a repeatable THEAD. (Closed)
Patch Set: code review Created 4 years, 1 month 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/LayoutTable.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/TableSectionPainter.h" 5 #include "core/paint/TableSectionPainter.h"
6 6
7 #include "core/layout/LayoutTableCell.h" 7 #include "core/layout/LayoutTableCell.h"
8 #include "core/layout/LayoutTableCol.h" 8 #include "core/layout/LayoutTableCol.h"
9 #include "core/layout/LayoutTableRow.h" 9 #include "core/layout/LayoutTableRow.h"
10 #include "core/paint/BoxClipper.h" 10 #include "core/paint/BoxClipper.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 if (!m_layoutTableSection.isRepeatingHeaderGroup()) 48 if (!m_layoutTableSection.isRepeatingHeaderGroup())
49 return; 49 return;
50 50
51 LayoutTable* table = m_layoutTableSection.table(); 51 LayoutTable* table = m_layoutTableSection.table();
52 LayoutPoint paginationOffset = paintOffset; 52 LayoutPoint paginationOffset = paintOffset;
53 LayoutUnit pageHeight = table->pageLogicalHeightForOffset(LayoutUnit()); 53 LayoutUnit pageHeight = table->pageLogicalHeightForOffset(LayoutUnit());
54 54
55 // Move paginationOffset to the top of the next page. 55 // Move paginationOffset to the top of the next page.
56 // The header may have a pagination strut before it so we need to account for 56 // The header may have a pagination strut before it so we need to account for
57 // that when establishing its position. 57 // that when establishing its position.
58 LayoutUnit headerGroupOffset = table->pageLogicalOffset(); 58 LayoutUnit headerGroupOffset = table->blockOffsetToFirstRepeatableHeader();
59 if (LayoutTableRow* row = m_layoutTableSection.firstRow()) 59 if (LayoutTableRow* row = m_layoutTableSection.firstRow())
60 headerGroupOffset += row->paginationStrut(); 60 headerGroupOffset += row->paginationStrut();
61 LayoutUnit offsetToNextPage = 61 LayoutUnit offsetToNextPage =
62 pageHeight - intMod(headerGroupOffset, pageHeight); 62 pageHeight - intMod(headerGroupOffset, pageHeight);
63 paginationOffset.move(LayoutUnit(), offsetToNextPage); 63 paginationOffset.move(LayoutUnit(), offsetToNextPage);
64 // Now move paginationOffset to the top of the page the cull rect starts on. 64 // Now move paginationOffset to the top of the page the cull rect starts on.
65 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) { 65 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) {
66 paginationOffset.move(LayoutUnit(), pageHeight * 66 paginationOffset.move(LayoutUnit(), pageHeight *
67 ((paintInfo.cullRect().m_rect.y() - 67 ((paintInfo.cullRect().m_rect.y() -
68 paginationOffset.y()) / 68 paginationOffset.y()) /
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 LayoutRect bounds = BoxPainter(m_layoutTableSection) 393 LayoutRect bounds = BoxPainter(m_layoutTableSection)
394 .boundsForDrawingRecorder(paintInfo, paintOffset); 394 .boundsForDrawingRecorder(paintInfo, paintOffset);
395 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, 395 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection,
396 type, bounds); 396 type, bounds);
397 BoxPainter::paintBoxShadow( 397 BoxPainter::paintBoxShadow(
398 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), 398 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()),
399 m_layoutTableSection.styleRef(), shadowStyle); 399 m_layoutTableSection.styleRef(), shadowStyle);
400 } 400 }
401 401
402 } // namespace blink 402 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698