OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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
that when establishing its position. | 56 // The header may have a pagination strut before it so we need to account for
that when establishing its position. |
57 LayoutUnit headerGroupOffset = table->pageLogicalOffset(); | 57 LayoutUnit headerGroupOffset = table->pageLogicalOffset(); |
58 if (LayoutTableRow* row = m_layoutTableSection.firstRow()) | 58 if (LayoutTableRow* row = m_layoutTableSection.firstRow()) |
59 headerGroupOffset += m_layoutTableSection.paginationStrutForRow( | 59 headerGroupOffset += row->paginationStrut(); |
60 row, table->pageLogicalOffset()); | |
61 LayoutUnit offsetToNextPage = | 60 LayoutUnit offsetToNextPage = |
62 pageHeight - intMod(headerGroupOffset, pageHeight); | 61 pageHeight - intMod(headerGroupOffset, pageHeight); |
63 paginationOffset.move(0, offsetToNextPage.toInt()); | 62 paginationOffset.move(0, offsetToNextPage.toInt()); |
64 // Now move paginationOffset to the top of the page the cull rect starts on. | 63 // Now move paginationOffset to the top of the page the cull rect starts on. |
65 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) | 64 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) |
66 paginationOffset.move( | 65 paginationOffset.move( |
67 0, pageHeight.toInt() * | 66 0, pageHeight.toInt() * |
68 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / | 67 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / |
69 pageHeight) | 68 pageHeight) |
70 .toInt()); | 69 .toInt()); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 LayoutRect bounds = BoxPainter(m_layoutTableSection) | 382 LayoutRect bounds = BoxPainter(m_layoutTableSection) |
384 .boundsForDrawingRecorder(paintInfo, paintOffset); | 383 .boundsForDrawingRecorder(paintInfo, paintOffset); |
385 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, | 384 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, |
386 type, bounds); | 385 type, bounds); |
387 BoxPainter::paintBoxShadow( | 386 BoxPainter::paintBoxShadow( |
388 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), | 387 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), |
389 m_layoutTableSection.styleRef(), shadowStyle); | 388 m_layoutTableSection.styleRef(), shadowStyle); |
390 } | 389 } |
391 | 390 |
392 } // namespace blink | 391 } // namespace blink |
OLD | NEW |