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

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: First round of rebaseline-cl 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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 m_overflow.reset(); 1273 m_overflow.reset();
1274 m_overflowingCells.clear(); 1274 m_overflowingCells.clear();
1275 m_forceSlowPaintPathWithOverflowingCell = false; 1275 m_forceSlowPaintPathWithOverflowingCell = false;
1276 #if DCHECK_IS_ON() 1276 #if DCHECK_IS_ON()
1277 bool hasOverflowingCell = false; 1277 bool hasOverflowingCell = false;
1278 #endif 1278 #endif
1279 // Now that our height has been determined, add in overflow from cells. 1279 // Now that our height has been determined, add in overflow from cells.
1280 for (unsigned r = 0; r < totalRows; r++) { 1280 for (unsigned r = 0; r < totalRows; r++) {
1281 unsigned nCols = numCols(r); 1281 unsigned nCols = numCols(r);
1282 for (unsigned c = 0; c < nCols; c++) { 1282 for (unsigned c = 0; c < nCols; c++) {
1283 CellStruct& cs = cellAt(r, c); 1283 const auto* cell = originatingCellAt(r, c);
chrishtr 2017/03/31 22:59:06 Why the changes here?
Xianzhu 2017/03/31 23:26:30 I added originatingCellAt() in a previous CL. The
1284 LayoutTableCell* cell = cs.primaryCell(); 1284 if (!cell)
1285 if (!cell || cs.inColSpan)
1286 continue;
1287 if (r < totalRows - 1 && cell == primaryCellAt(r + 1, c))
1288 continue; 1285 continue;
1289 addOverflowFromChild(cell); 1286 addOverflowFromChild(cell);
1290 #if DCHECK_IS_ON() 1287 #if DCHECK_IS_ON()
1291 hasOverflowingCell |= cell->hasVisualOverflow(); 1288 hasOverflowingCell |= cell->hasVisualOverflow();
1292 #endif 1289 #endif
1293 if (cell->hasVisualOverflow() && 1290 if (cell->hasVisualOverflow() &&
1294 !m_forceSlowPaintPathWithOverflowingCell) { 1291 !m_forceSlowPaintPathWithOverflowingCell) {
1295 m_overflowingCells.insert(cell); 1292 m_overflowingCells.insert(cell);
1296 if (m_overflowingCells.size() > maxAllowedOverflowingCellsCount) { 1293 if (m_overflowingCells.size() > maxAllowedOverflowingCellsCount) {
1297 // We need to set m_forcesSlowPaintPath only if there is a least one 1294 // We need to set m_forcesSlowPaintPath only if there is a least one
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 // section's (see bug 96691). 1520 // section's (see bug 96691).
1524 if (!style()->isLeftToRightDirection()) 1521 if (!style()->isLeftToRightDirection())
1525 tableAlignedRect.setX(columnPos[columnPos.size() - 1] - 1522 tableAlignedRect.setX(columnPos[columnPos.size() - 1] -
1526 tableAlignedRect.maxX()); 1523 tableAlignedRect.maxX());
1527 1524
1528 return tableAlignedRect; 1525 return tableAlignedRect;
1529 } 1526 }
1530 1527
1531 CellSpan LayoutTableSection::dirtiedRows(const LayoutRect& damageRect) const { 1528 CellSpan LayoutTableSection::dirtiedRows(const LayoutRect& damageRect) const {
1532 if (m_forceSlowPaintPathWithOverflowingCell) 1529 if (m_forceSlowPaintPathWithOverflowingCell)
1533 return fullTableRowSpan(); 1530 return fullSectionRowSpan();
1534 1531
1535 if (!m_grid.size()) 1532 if (!m_grid.size())
1536 return CellSpan(0, 0); 1533 return CellSpan(0, 0);
1537 1534
1538 CellSpan coveredRows = spannedRows(damageRect); 1535 CellSpan coveredRows = spannedRows(damageRect);
1539 1536
1540 // To issue paint invalidations for the border we might need to paint 1537 // To issue paint invalidations for the border we might need to paint
1541 // invalidate the first or last row even if they are not spanned themselves. 1538 // invalidate the first or last row even if they are not spanned themselves.
1542 CHECK_LT(coveredRows.start(), m_rowPos.size()); 1539 CHECK_LT(coveredRows.start(), m_rowPos.size());
1543 if (coveredRows.start() == m_rowPos.size() - 1 && 1540 if (coveredRows.start() == m_rowPos.size() - 1 &&
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 if (table()->header() == this && isRepeatingHeaderGroup()) { 2128 if (table()->header() == this && isRepeatingHeaderGroup()) {
2132 transformState.flatten(); 2129 transformState.flatten();
2133 FloatRect rect = transformState.lastPlanarQuad().boundingBox(); 2130 FloatRect rect = transformState.lastPlanarQuad().boundingBox();
2134 rect.setHeight(table()->logicalHeight()); 2131 rect.setHeight(table()->logicalHeight());
2135 transformState.setQuad(FloatQuad(rect)); 2132 transformState.setQuad(FloatQuad(rect));
2136 } 2133 }
2137 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal( 2134 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal(
2138 ancestor, transformState, flags); 2135 ancestor, transformState, flags);
2139 } 2136 }
2140 2137
2138 bool LayoutTableSection::paintedOutputOfObjectHasNoEffectRegardlessOfSize()
2139 const {
2140 // LayoutTableSection paints background from columns.
2141 if (table()->hasColElements())
wkorman 2017/03/31 22:15:41 Sometimes I expect table might have col elements b
Xianzhu 2017/03/31 23:26:30 paintedOutputOfObjectHasNoEffectRegardlessOfSize()
2142 return false;
2143 return LayoutTableBoxComponent::
2144 paintedOutputOfObjectHasNoEffectRegardlessOfSize();
2145 }
2146
2141 } // namespace blink 2147 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698