OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/TableCellPaintInvalidator.h" | 5 #include "core/paint/TableCellPaintInvalidator.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 18 matching lines...) Expand all Loading... |
29 else | 29 else |
30 ObjectPaintInvalidator(row).SlowSetPaintingLayerNeedsRepaint(); | 30 ObjectPaintInvalidator(row).SlowSetPaintingLayerNeedsRepaint(); |
31 row.InvalidateDisplayItemClients(PaintInvalidationReason::kGeometry); | 31 row.InvalidateDisplayItemClients(PaintInvalidationReason::kGeometry); |
32 } | 32 } |
33 | 33 |
34 const auto& section = *row.Section(); | 34 const auto& section = *row.Section(); |
35 if (section.GetPaintInvalidationReason() == | 35 if (section.GetPaintInvalidationReason() == |
36 PaintInvalidationReason::kNone) { | 36 PaintInvalidationReason::kNone) { |
37 bool section_paints_background = section.StyleRef().HasBackground(); | 37 bool section_paints_background = section.StyleRef().HasBackground(); |
38 if (!section_paints_background) { | 38 if (!section_paints_background) { |
39 auto col_and_colgroup = section.Table()->ColElementAtAbsoluteColumn( | 39 auto col_and_colgroup = cell_.GetColAndColGroup(); |
40 cell_.AbsoluteColumnIndex()); | |
41 if ((col_and_colgroup.col && | 40 if ((col_and_colgroup.col && |
42 col_and_colgroup.col->StyleRef().HasBackground()) || | 41 col_and_colgroup.col->StyleRef().HasBackground()) || |
43 (col_and_colgroup.colgroup && | 42 (col_and_colgroup.colgroup && |
44 col_and_colgroup.colgroup->StyleRef().HasBackground())) | 43 col_and_colgroup.colgroup->StyleRef().HasBackground())) |
45 section_paints_background = true; | 44 section_paints_background = true; |
46 } | 45 } |
47 if (section_paints_background) { | 46 if (section_paints_background) { |
48 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 47 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
49 context_.parent_context->parent_context->painting_layer | 48 context_.parent_context->parent_context->painting_layer |
50 ->SetNeedsRepaint(); | 49 ->SetNeedsRepaint(); |
51 } else { | 50 } else { |
52 ObjectPaintInvalidator(section).SlowSetPaintingLayerNeedsRepaint(); | 51 ObjectPaintInvalidator(section).SlowSetPaintingLayerNeedsRepaint(); |
53 } | 52 } |
54 section.InvalidateDisplayItemClients( | 53 section.InvalidateDisplayItemClients( |
55 PaintInvalidationReason::kGeometry); | 54 PaintInvalidationReason::kGeometry); |
56 } | 55 } |
57 } | 56 } |
58 } | 57 } |
59 | 58 |
60 return BlockPaintInvalidator(cell_).InvalidatePaint(context_); | 59 return BlockPaintInvalidator(cell_).InvalidatePaint(context_); |
61 } | 60 } |
62 | 61 |
63 } // namespace blink | 62 } // namespace blink |
OLD | NEW |