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

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

Issue 2507893002: Fix painting background for composited table cells in a non-composited row. (Closed)
Patch Set: Add rebaselines to TestExpectations due to http://crbug.com/665765 preventing rebaseline-cl happine… Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/paint/TableCellPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/TablePaintInvalidator.h" 5 #include "core/paint/TablePaintInvalidator.h"
6 6
7 #include "core/layout/LayoutTable.h" 7 #include "core/layout/LayoutTable.h"
8 #include "core/layout/LayoutTableCell.h" 8 #include "core/layout/LayoutTableCell.h"
9 #include "core/layout/LayoutTableCol.h" 9 #include "core/layout/LayoutTableCol.h"
10 #include "core/layout/LayoutTableRow.h" 10 #include "core/layout/LayoutTableRow.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState ()) 48 ->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState ())
49 continue; 49 continue;
50 for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) { 50 for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) {
51 row->ensureIsReadyForPaintInvalidation(); 51 row->ensureIsReadyForPaintInvalidation();
52 if (!hasColChangedBackground && 52 if (!hasColChangedBackground &&
53 !section->backgroundChangedSinceLastPaintInvalidation() && 53 !section->backgroundChangedSinceLastPaintInvalidation() &&
54 !row->backgroundChangedSinceLastPaintInvalidation()) 54 !row->backgroundChangedSinceLastPaintInvalidation())
55 continue; 55 continue;
56 for (LayoutTableCell* cell = row->firstCell(); cell; 56 for (LayoutTableCell* cell = row->firstCell(); cell;
57 cell = cell->nextCell()) { 57 cell = cell->nextCell()) {
58 cell->ensureIsReadyForPaintInvalidation();
58 bool invalidated = false; 59 bool invalidated = false;
59 // Table cells paint container's background on the container's backing 60 // Table cells paint container's background on the container's backing
60 // instead of its own (if any), so we must invalidate it by the 61 // instead of its own (if any), so we must invalidate it by the
61 // containers. 62 // containers.
62 if (section->backgroundChangedSinceLastPaintInvalidation()) { 63 if (section->backgroundChangedSinceLastPaintInvalidation()) {
63 sectionInvalidator 64 sectionInvalidator
64 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( 65 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
65 *cell, PaintInvalidationStyleChange); 66 cell->backgroundDisplayItemClient(),
67 PaintInvalidationStyleChange);
66 invalidated = true; 68 invalidated = true;
67 } else if (hasColChangedBackground) { 69 } else if (hasColChangedBackground) {
68 LayoutTable::ColAndColGroup colAndColGroup = 70 LayoutTable::ColAndColGroup colAndColGroup =
69 m_table.colElementAtAbsoluteColumn(cell->absoluteColumnIndex()); 71 m_table.colElementAtAbsoluteColumn(cell->absoluteColumnIndex());
70 LayoutTableCol* column = colAndColGroup.col; 72 LayoutTableCol* column = colAndColGroup.col;
71 LayoutTableCol* columnGroup = colAndColGroup.colgroup; 73 LayoutTableCol* columnGroup = colAndColGroup.colgroup;
72 if ((columnGroup && 74 if ((columnGroup &&
73 columnGroup->backgroundChangedSinceLastPaintInvalidation()) || 75 columnGroup->backgroundChangedSinceLastPaintInvalidation()) ||
74 (column && 76 (column &&
75 column->backgroundChangedSinceLastPaintInvalidation())) { 77 column->backgroundChangedSinceLastPaintInvalidation())) {
76 sectionInvalidator 78 sectionInvalidator
77 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( 79 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
78 *cell, PaintInvalidationStyleChange); 80 cell->backgroundDisplayItemClient(),
81 PaintInvalidationStyleChange);
79 invalidated = true; 82 invalidated = true;
80 } 83 }
81 } 84 }
82 if ((!invalidated || row->hasSelfPaintingLayer()) && 85 if ((!invalidated || row->hasSelfPaintingLayer()) &&
83 row->backgroundChangedSinceLastPaintInvalidation()) 86 row->backgroundChangedSinceLastPaintInvalidation()) {
84 ObjectPaintInvalidator(*row) 87 ObjectPaintInvalidator(*row)
85 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( 88 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
86 *cell, PaintInvalidationStyleChange); 89 cell->backgroundDisplayItemClient(),
90 PaintInvalidationStyleChange);
91 }
87 } 92 }
88 } 93 }
89 } 94 }
90 95
91 return reason; 96 return reason;
92 } 97 }
93 98
94 } // namespace blink 99 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableCellPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698