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

Side by Side Diff: Source/core/rendering/RenderTableSection.cpp

Issue 620753006: Rendering API cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 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
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | Source/core/rendering/RenderText.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 1283
1284 CellSpan RenderTableSection::dirtiedRows(const LayoutRect& damageRect) const 1284 CellSpan RenderTableSection::dirtiedRows(const LayoutRect& damageRect) const
1285 { 1285 {
1286 if (m_forceSlowPaintPathWithOverflowingCell) 1286 if (m_forceSlowPaintPathWithOverflowingCell)
1287 return fullTableRowSpan(); 1287 return fullTableRowSpan();
1288 1288
1289 CellSpan coveredRows = spannedRows(damageRect); 1289 CellSpan coveredRows = spannedRows(damageRect);
1290 1290
1291 // To issue paint invalidations for the border we might need to paint invali date the first or last row even if they are not spanned themselves. 1291 // To issue paint invalidations for the border we might need to paint invali date the first or last row even if they are not spanned themselves.
1292 if (coveredRows.start() >= m_rowPos.size() - 1 && m_rowPos[m_rowPos.size() - 1] + table()->outerBorderAfter() >= damageRect.y()) 1292 if (coveredRows.start() >= m_rowPos.size() - 1 && m_rowPos[m_rowPos.size() - 1] + table()->outerBorderAfter() >= damageRect.y())
1293 --coveredRows.start(); 1293 coveredRows.decreaseStart();
1294 1294
1295 if (!coveredRows.end() && m_rowPos[0] - table()->outerBorderBefore() <= dama geRect.maxY()) 1295 if (!coveredRows.end() && m_rowPos[0] - table()->outerBorderBefore() <= dama geRect.maxY())
1296 ++coveredRows.end(); 1296 coveredRows.increaseEnd();
1297 1297
1298 return coveredRows; 1298 return coveredRows;
1299 } 1299 }
1300 1300
1301 CellSpan RenderTableSection::dirtiedColumns(const LayoutRect& damageRect) const 1301 CellSpan RenderTableSection::dirtiedColumns(const LayoutRect& damageRect) const
1302 { 1302 {
1303 if (m_forceSlowPaintPathWithOverflowingCell) 1303 if (m_forceSlowPaintPathWithOverflowingCell)
1304 return fullTableColumnSpan(); 1304 return fullTableColumnSpan();
1305 1305
1306 CellSpan coveredColumns = spannedColumns(damageRect); 1306 CellSpan coveredColumns = spannedColumns(damageRect);
1307 1307
1308 const Vector<int>& columnPos = table()->columnPositions(); 1308 const Vector<int>& columnPos = table()->columnPositions();
1309 // To issue paint invalidations for the border we might need to paint invali date the first or last column even if they are not spanned themselves. 1309 // To issue paint invalidations for the border we might need to paint invali date the first or last column even if they are not spanned themselves.
1310 if (coveredColumns.start() >= columnPos.size() - 1 && columnPos[columnPos.si ze() - 1] + table()->outerBorderEnd() >= damageRect.x()) 1310 if (coveredColumns.start() >= columnPos.size() - 1 && columnPos[columnPos.si ze() - 1] + table()->outerBorderEnd() >= damageRect.x())
1311 --coveredColumns.start(); 1311 coveredColumns.decreaseStart();
1312 1312
1313 if (!coveredColumns.end() && columnPos[0] - table()->outerBorderStart() <= d amageRect.maxX()) 1313 if (!coveredColumns.end() && columnPos[0] - table()->outerBorderStart() <= d amageRect.maxX())
1314 ++coveredColumns.end(); 1314 coveredColumns.increaseEnd();
1315 1315
1316 return coveredColumns; 1316 return coveredColumns;
1317 } 1317 }
1318 1318
1319 CellSpan RenderTableSection::spannedRows(const LayoutRect& flippedRect) const 1319 CellSpan RenderTableSection::spannedRows(const LayoutRect& flippedRect) const
1320 { 1320 {
1321 // Find the first row that starts after rect top. 1321 // Find the first row that starts after rect top.
1322 unsigned nextRow = std::upper_bound(m_rowPos.begin(), m_rowPos.end(), flippe dRect.y()) - m_rowPos.begin(); 1322 unsigned nextRow = std::upper_bound(m_rowPos.begin(), m_rowPos.end(), flippe dRect.y()) - m_rowPos.begin();
1323 1323
1324 if (nextRow == m_rowPos.size()) 1324 if (nextRow == m_rowPos.size())
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1610 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1611 if (!style()->isLeftToRightDirection()) 1611 if (!style()->isLeftToRightDirection())
1612 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1612 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1613 else 1613 else
1614 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1614 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1615 1615
1616 cell->setLogicalLocation(cellLocation); 1616 cell->setLogicalLocation(cellLocation);
1617 } 1617 }
1618 1618
1619 } // namespace blink 1619 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | Source/core/rendering/RenderText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698