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

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

Issue 2422953003: Repeating header groups should align properly when captions are present (Closed)
Patch Set: Repeating header groups should align properly when captions are present BUG=652792 CQ_INCLUDE_TRYBO… 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
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 66 paginationOffset.move(
67 0, pageHeight.toInt() * 67 0, pageHeight.toInt() *
68 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / 68 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) /
69 pageHeight) 69 pageHeight)
70 .toInt()); 70 .toInt());
71 LayoutUnit bottomBound = 71 LayoutUnit bottomBound =
72 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), 72 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()),
73 paintOffset.y() + table->logicalHeight()); 73 paintOffset.y() + table->logicalHeight());
74 paginationOffset.move(0, -m_layoutTableSection.logicalTop().toInt());
mstensho (USE GERRIT) 2016/10/18 17:08:49 LayoutUnit() is cheaper than 0.
74 while (paginationOffset.y() < bottomBound) { 75 while (paginationOffset.y() < bottomBound) {
75 LayoutPoint nestedOffset = 76 LayoutPoint nestedOffset =
76 paginationOffset + 77 paginationOffset +
77 LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt()); 78 LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt());
78 if (itemToPaint == PaintCollapsedBorders) 79 if (itemToPaint == PaintCollapsedBorders)
79 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue); 80 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue);
80 else 81 else
81 paintSection(paintInfo, nestedOffset); 82 paintSection(paintInfo, nestedOffset);
82 paginationOffset.move(0, pageHeight.toInt()); 83 paginationOffset.move(0, pageHeight.toInt());
83 } 84 }
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 LayoutRect bounds = BoxPainter(m_layoutTableSection) 391 LayoutRect bounds = BoxPainter(m_layoutTableSection)
391 .boundsForDrawingRecorder(paintInfo, paintOffset); 392 .boundsForDrawingRecorder(paintInfo, paintOffset);
392 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, 393 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection,
393 type, bounds); 394 type, bounds);
394 BoxPainter::paintBoxShadow( 395 BoxPainter::paintBoxShadow(
395 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), 396 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()),
396 m_layoutTableSection.styleRef(), shadowStyle); 397 m_layoutTableSection.styleRef(), shadowStyle);
397 } 398 }
398 399
399 } // namespace blink 400 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/single-line-cells-repeating-thead-with-two-captions-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698