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

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

Issue 2786463004: Paint backgrounds of a table section/row in one display item (Closed)
Patch Set: - Created 3 years, 8 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 /* 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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 m_overflow.reset(); 1268 m_overflow.reset();
1269 m_overflowingCells.clear(); 1269 m_overflowingCells.clear();
1270 m_forceSlowPaintPathWithOverflowingCell = false; 1270 m_forceSlowPaintPathWithOverflowingCell = false;
1271 #if DCHECK_IS_ON() 1271 #if DCHECK_IS_ON()
1272 bool hasOverflowingCell = false; 1272 bool hasOverflowingCell = false;
1273 #endif 1273 #endif
1274 // Now that our height has been determined, add in overflow from cells. 1274 // Now that our height has been determined, add in overflow from cells.
1275 for (unsigned r = 0; r < totalRows; r++) { 1275 for (unsigned r = 0; r < totalRows; r++) {
1276 unsigned nCols = numCols(r); 1276 unsigned nCols = numCols(r);
1277 for (unsigned c = 0; c < nCols; c++) { 1277 for (unsigned c = 0; c < nCols; c++) {
1278 auto* cell = originatingCellAt(r, c); 1278 const auto* cell = originatingCellAt(r, c);
1279 if (!cell) 1279 if (!cell)
1280 continue; 1280 continue;
1281 addOverflowFromChild(cell); 1281 addOverflowFromChild(*cell);
1282 #if DCHECK_IS_ON() 1282 #if DCHECK_IS_ON()
1283 hasOverflowingCell |= cell->hasVisualOverflow(); 1283 hasOverflowingCell |= cell->hasVisualOverflow();
1284 #endif 1284 #endif
1285 if (cell->hasVisualOverflow() && 1285 if (cell->hasVisualOverflow() &&
1286 !m_forceSlowPaintPathWithOverflowingCell) { 1286 !m_forceSlowPaintPathWithOverflowingCell) {
1287 m_overflowingCells.insert(cell); 1287 m_overflowingCells.insert(cell);
1288 if (m_overflowingCells.size() > maxAllowedOverflowingCellsCount) { 1288 if (m_overflowingCells.size() > maxAllowedOverflowingCellsCount) {
1289 // We need to set m_forcesSlowPaintPath only if there is a least one 1289 // We need to set m_forcesSlowPaintPath only if there is a least one
1290 // overflowing cells as the hit testing code rely on this information. 1290 // overflowing cells as the hit testing code rely on this information.
1291 m_forceSlowPaintPathWithOverflowingCell = true; 1291 m_forceSlowPaintPathWithOverflowingCell = true;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 // section's (see bug 96691). 1514 // section's (see bug 96691).
1515 if (!style()->isLeftToRightDirection()) 1515 if (!style()->isLeftToRightDirection())
1516 tableAlignedRect.setX(columnPos[columnPos.size() - 1] - 1516 tableAlignedRect.setX(columnPos[columnPos.size() - 1] -
1517 tableAlignedRect.maxX()); 1517 tableAlignedRect.maxX());
1518 1518
1519 return tableAlignedRect; 1519 return tableAlignedRect;
1520 } 1520 }
1521 1521
1522 CellSpan LayoutTableSection::dirtiedRows(const LayoutRect& damageRect) const { 1522 CellSpan LayoutTableSection::dirtiedRows(const LayoutRect& damageRect) const {
1523 if (m_forceSlowPaintPathWithOverflowingCell) 1523 if (m_forceSlowPaintPathWithOverflowingCell)
1524 return fullTableRowSpan(); 1524 return fullSectionRowSpan();
1525 1525
1526 if (!m_grid.size()) 1526 if (!m_grid.size())
1527 return CellSpan(0, 0); 1527 return CellSpan(0, 0);
1528 1528
1529 CellSpan coveredRows = spannedRows(damageRect); 1529 CellSpan coveredRows = spannedRows(damageRect);
1530 1530
1531 // To issue paint invalidations for the border we might need to paint 1531 // To issue paint invalidations for the border we might need to paint
1532 // invalidate the first or last row even if they are not spanned themselves. 1532 // invalidate the first or last row even if they are not spanned themselves.
1533 CHECK_LT(coveredRows.start(), m_rowPos.size()); 1533 CHECK_LT(coveredRows.start(), m_rowPos.size());
1534 if (coveredRows.start() == m_rowPos.size() - 1 && 1534 if (coveredRows.start() == m_rowPos.size() - 1 &&
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 if (table()->header() == this && isRepeatingHeaderGroup()) { 2122 if (table()->header() == this && isRepeatingHeaderGroup()) {
2123 transformState.flatten(); 2123 transformState.flatten();
2124 FloatRect rect = transformState.lastPlanarQuad().boundingBox(); 2124 FloatRect rect = transformState.lastPlanarQuad().boundingBox();
2125 rect.setHeight(table()->logicalHeight()); 2125 rect.setHeight(table()->logicalHeight());
2126 transformState.setQuad(FloatQuad(rect)); 2126 transformState.setQuad(FloatQuad(rect));
2127 } 2127 }
2128 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal( 2128 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal(
2129 ancestor, transformState, flags); 2129 ancestor, transformState, flags);
2130 } 2130 }
2131 2131
2132 bool LayoutTableSection::paintedOutputOfObjectHasNoEffectRegardlessOfSize()
2133 const {
2134 // LayoutTableSection paints background from columns.
2135 if (table()->hasColElements())
2136 return false;
2137 return LayoutTableBoxComponent::
2138 paintedOutputOfObjectHasNoEffectRegardlessOfSize();
2139 }
2140
2132 } // namespace blink 2141 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.h ('k') | third_party/WebKit/Source/core/paint/PaintInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698