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/PaintInvalidator.h" | 5 #include "core/paint/PaintInvalidator.h" |
6 | 6 |
7 #include "core/editing/FrameSelection.h" | 7 #include "core/editing/FrameSelection.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
11 #include "core/layout/LayoutBlockFlow.h" | 11 #include "core/layout/LayoutBlockFlow.h" |
12 #include "core/layout/LayoutObject.h" | 12 #include "core/layout/LayoutObject.h" |
13 #include "core/layout/LayoutTable.h" | 13 #include "core/layout/LayoutTable.h" |
14 #include "core/layout/LayoutTableSection.h" | |
14 #include "core/layout/LayoutView.h" | 15 #include "core/layout/LayoutView.h" |
15 #include "core/layout/svg/SVGLayoutSupport.h" | 16 #include "core/layout/svg/SVGLayoutSupport.h" |
16 #include "core/paint/ObjectPaintProperties.h" | 17 #include "core/paint/ObjectPaintProperties.h" |
17 #include "core/paint/PaintLayer.h" | 18 #include "core/paint/PaintLayer.h" |
18 #include "core/paint/PaintLayerScrollableArea.h" | 19 #include "core/paint/PaintLayerScrollableArea.h" |
19 #include "core/paint/PaintPropertyTreeBuilder.h" | 20 #include "core/paint/PaintPropertyTreeBuilder.h" |
20 #include "wtf/Optional.h" | 21 #include "wtf/Optional.h" |
21 | 22 |
22 namespace blink { | 23 namespace blink { |
23 | 24 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 if (object.isTable()) { | 229 if (object.isTable()) { |
229 const LayoutTable& table = toLayoutTable(object); | 230 const LayoutTable& table = toLayoutTable(object); |
230 if (table.collapseBorders() && !table.collapsedBorders().isEmpty()) | 231 if (table.collapseBorders() && !table.collapsedBorders().isEmpty()) |
231 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | 232 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); |
232 } | 233 } |
233 | 234 |
234 // The following flags are for descendants of the layer object only. | 235 // The following flags are for descendants of the layer object only. |
235 if (object == context.paintingLayer->layoutObject()) | 236 if (object == context.paintingLayer->layoutObject()) |
236 return; | 237 return; |
237 | 238 |
239 if (object.isTableSection()) { | |
chrishtr
2017/03/31 22:59:06
This seems a weird place to invalidate paint phase
Xianzhu
2017/03/31 23:26:30
This is to update paint phase requirements of laye
chrishtr
2017/04/03 17:10:51
Yes, that makes more sense, thanks.
| |
240 const auto& section = toLayoutTableSection(object); | |
241 if (section.table()->hasColElements()) | |
wkorman
2017/03/31 22:15:41
If we change for prior comment would need to follo
| |
242 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | |
243 } | |
244 | |
238 if (object.styleRef().hasOutline()) | 245 if (object.styleRef().hasOutline()) |
239 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); | 246 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); |
240 | 247 |
241 if (object.hasBoxDecorationBackground() | 248 if (object.hasBoxDecorationBackground() |
242 // We also paint overflow controls in background phase. | 249 // We also paint overflow controls in background phase. |
243 || (object.hasOverflowClip() && | 250 || (object.hasOverflowClip() && |
244 toLayoutBox(object).getScrollableArea()->hasOverflowControls())) { | 251 toLayoutBox(object).getScrollableArea()->hasOverflowControls())) { |
245 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | 252 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); |
246 } | 253 } |
247 } | 254 } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 } | 503 } |
497 } | 504 } |
498 | 505 |
499 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 506 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
500 for (auto target : m_pendingDelayedPaintInvalidations) | 507 for (auto target : m_pendingDelayedPaintInvalidations) |
501 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 508 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
502 PaintInvalidationDelayedFull); | 509 PaintInvalidationDelayedFull); |
503 } | 510 } |
504 | 511 |
505 } // namespace blink | 512 } // namespace blink |
OLD | NEW |