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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.cpp

Issue 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index a60abf0d658c3524fd18737bcf3cf481e0eadc19..1c6297ce3429a051ecf04359246583528ec256e6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -1673,6 +1673,59 @@ const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(
void LayoutTable::ensureIsReadyForPaintInvalidation() {
LayoutBlock::ensureIsReadyForPaintInvalidation();
recalcCollapsedBordersIfNeeded();
+
+ bool hasColBackground = false;
+ for (LayoutTableCol* col = firstColumn(); col; col = col->nextColumn()) {
+ if (col->styleRef().hasBackground()) {
+ hasColBackground = true;
+ break;
+ }
+ }
+
+ for (LayoutObject* child = firstChild(); child;
+ child = child->nextSibling()) {
+ if (!child->isTableSection())
+ continue;
+ LayoutTableSection* section = toLayoutTableSection(child);
+ if (section->isPaintInvalidationContainer()) {
+ section->m_rareStat.addReason(ReasonLTSComposited);
+ if (hasColBackground) {
+ section->m_rareStat.addReason(
+ ReasonLTSCompositedWithContainerBackground);
+ }
+ } else {
+ section->m_rareStat.addReason(ReasonLTSNonComposited);
+ }
+ bool hasSectionBackground = section->styleRef().hasBackground();
+ for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) {
+ if (row->isPaintInvalidationContainer()) {
+ row->m_rareStat.addReason(ReasonLTRComposited);
+ if (hasSectionBackground || hasColBackground)
+ row->m_rareStat.addReason(ReasonLTRCompositedWithContainerBackground);
+ } else {
+ row->m_rareStat.addReason(ReasonLTRNonComposited);
+ }
+ bool hasRowBackground = row->styleRef().hasBackground();
+ for (LayoutTableCell* cell = row->firstCell(); cell;
+ cell = cell->nextCell()) {
+ if (cell->isPaintInvalidationContainer()) {
+ cell->m_rareStat.addReason(ReasonLTCComposited);
+ ColAndColGroup colAndColGroup =
+ colElementAtAbsoluteColumn(cell->absoluteColumnIndex());
+ LayoutTableCol* column = colAndColGroup.col;
+ LayoutTableCol* columnGroup = colAndColGroup.colgroup;
+ if ((column && column->styleRef().hasBackground()) ||
+ (columnGroup && columnGroup->styleRef().hasBackground()) ||
+ hasSectionBackground || hasRowBackground) {
+ cell->m_rareStat.addReason(
+ ReasonLTCCompositedWithContainerBackground);
+ }
+ } else {
+ cell->m_rareStat.addReason(ReasonLTCNonComposited);
+ }
+ }
+ }
+ }
}
PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded(
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698