OLD | NEW |
---|---|
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 bool invalidated = false; | 58 bool invalidated = false; |
59 // Table cells paint container's background on the container's backing | 59 // 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 | 60 // instead of its own (if any), so we must invalidate it by the |
61 // containers. | 61 // containers. |
62 if (section->backgroundChangedSinceLastPaintInvalidation()) { | 62 if (section->backgroundChangedSinceLastPaintInvalidation()) { |
63 cell->ensureIsReadyForPaintInvalidation(); | |
Xianzhu
2016/11/16 21:54:32
Nit: can this be put at the beginning of the 'for'
wkorman
2016/11/16 22:07:42
Done.
| |
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())) { |
78 cell->ensureIsReadyForPaintInvalidation(); | |
76 sectionInvalidator | 79 sectionInvalidator |
77 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 80 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
78 *cell, PaintInvalidationStyleChange); | 81 cell->backgroundDisplayItemClient(), |
82 PaintInvalidationStyleChange); | |
79 invalidated = true; | 83 invalidated = true; |
80 } | 84 } |
81 } | 85 } |
82 if ((!invalidated || row->hasSelfPaintingLayer()) && | 86 if ((!invalidated || row->hasSelfPaintingLayer()) && |
83 row->backgroundChangedSinceLastPaintInvalidation()) | 87 row->backgroundChangedSinceLastPaintInvalidation()) { |
88 cell->ensureIsReadyForPaintInvalidation(); | |
84 ObjectPaintInvalidator(*row) | 89 ObjectPaintInvalidator(*row) |
85 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 90 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
86 *cell, PaintInvalidationStyleChange); | 91 cell->backgroundDisplayItemClient(), |
92 PaintInvalidationStyleChange); | |
93 } | |
87 } | 94 } |
88 } | 95 } |
89 } | 96 } |
90 | 97 |
91 return reason; | 98 return reason; |
92 } | 99 } |
93 | 100 |
94 } // namespace blink | 101 } // namespace blink |
OLD | NEW |