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

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

Issue 2545243002: Don't repeat thead if the first row exceeds the height of the page (Closed)
Patch Set: bug 669690 Created 4 years 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/LayoutTableSection.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // captions and border spacing from the table. 74 // captions and border spacing from the table.
75 LayoutRect sectionsRect(LayoutPoint(), table->size()); 75 LayoutRect sectionsRect(LayoutPoint(), table->size());
76 table->subtractCaptionRect(sectionsRect); 76 table->subtractCaptionRect(sectionsRect);
77 LayoutUnit totalHeightOfRows = 77 LayoutUnit totalHeightOfRows =
78 sectionsRect.height() - table->vBorderSpacing(); 78 sectionsRect.height() - table->vBorderSpacing();
79 LayoutUnit bottomBound = 79 LayoutUnit bottomBound =
80 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), 80 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()),
81 paintOffset.y() + totalHeightOfRows); 81 paintOffset.y() + totalHeightOfRows);
82 82
83 while (paginationOffset.y() < bottomBound) { 83 while (paginationOffset.y() < bottomBound) {
84 LayoutPoint nestedOffset = 84 if (itemToPaint == PaintCollapsedBorders) {
85 paginationOffset + 85 paintCollapsedSectionBorders(paintInfo, paginationOffset,
86 LayoutPoint(LayoutUnit(), 86 currentBorderValue);
87 m_layoutTableSection.offsetForRepeatingHeader()); 87 } else {
88 if (itemToPaint == PaintCollapsedBorders) 88 paintSection(paintInfo, paginationOffset);
89 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue); 89 }
90 else
91 paintSection(paintInfo, nestedOffset);
92 paginationOffset.move(0, pageHeight.toInt()); 90 paginationOffset.move(0, pageHeight.toInt());
93 } 91 }
94 } 92 }
95 93
96 void TableSectionPainter::paint(const PaintInfo& paintInfo, 94 void TableSectionPainter::paint(const PaintInfo& paintInfo,
97 const LayoutPoint& paintOffset) { 95 const LayoutPoint& paintOffset) {
98 ObjectPainter(m_layoutTableSection).checkPaintOffset(paintInfo, paintOffset); 96 ObjectPainter(m_layoutTableSection).checkPaintOffset(paintInfo, paintOffset);
99 paintSection(paintInfo, paintOffset); 97 paintSection(paintInfo, paintOffset);
100 LayoutTable* table = m_layoutTableSection.table(); 98 LayoutTable* table = m_layoutTableSection.table();
101 if (table->header() == m_layoutTableSection) 99 if (table->header() == m_layoutTableSection)
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 m_layoutTableSection.styleRef()); 404 m_layoutTableSection.styleRef());
407 } else { 405 } else {
408 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting 406 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting
409 // paintRect by half widths of collapsed borders. 407 // paintRect by half widths of collapsed borders.
410 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect, 408 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect,
411 m_layoutTableSection.styleRef()); 409 m_layoutTableSection.styleRef());
412 } 410 }
413 } 411 }
414 412
415 } // namespace blink 413 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698