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

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

Issue 2388723004: [SPInvalidation] Fix PrePaintTreeWalk for multicol spanner (Closed)
Patch Set: Positioned descendants of spanner; Unit test Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/PrePaintTreeWalk.h" 5 #include "core/paint/PrePaintTreeWalk.h"
6 6
7 #include "core/dom/DocumentLifecycle.h" 7 #include "core/dom/DocumentLifecycle.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/layout/LayoutMultiColumnSpannerPlaceholder.h" 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 frameView, localContext.paintInvalidatorContext); 49 frameView, localContext.paintInvalidatorContext);
50 50
51 if (LayoutView* layoutView = frameView.layoutView()) 51 if (LayoutView* layoutView = frameView.layoutView())
52 walk(*layoutView, localContext); 52 walk(*layoutView, localContext);
53 } 53 }
54 54
55 void PrePaintTreeWalk::walk(const LayoutObject& object, 55 void PrePaintTreeWalk::walk(const LayoutObject& object,
56 const PrePaintTreeWalkContext& context) { 56 const PrePaintTreeWalkContext& context) {
57 PrePaintTreeWalkContext localContext(context); 57 PrePaintTreeWalkContext localContext(context);
58 58
59 if (object.isLayoutMultiColumnSpannerPlaceholder()) {
60 // Multi-column spanner should be walked for normal flow descendants from
61 // the placeholder. Set the flag so that the tree builder can specially
62 // handle the out-of-flow positioned descendants.
63 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true;
mstensho (USE GERRIT) 2016/10/05 08:44:09 <div style="columns:3;"> <div id="rel" style="po
Xianzhu 2016/10/05 17:29:40 Yes. Updated comments here and PaintPropertyTreeBu
64 walk(*toLayoutMultiColumnSpannerPlaceholder(object)
65 .layoutObjectInFlowThread(),
66 localContext);
67 return;
68 }
69
59 m_propertyTreeBuilder.buildTreeNodesForSelf(object, 70 m_propertyTreeBuilder.buildTreeNodesForSelf(object,
60 localContext.treeBuilderContext); 71 localContext.treeBuilderContext);
61 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) 72 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
62 m_paintInvalidator.invalidatePaintIfNeeded( 73 m_paintInvalidator.invalidatePaintIfNeeded(
63 object, localContext.paintInvalidatorContext); 74 object, localContext.paintInvalidatorContext);
64 m_propertyTreeBuilder.buildTreeNodesForChildren( 75 m_propertyTreeBuilder.buildTreeNodesForChildren(
65 object, localContext.treeBuilderContext); 76 object, localContext.treeBuilderContext);
66 77
67 for (const LayoutObject* child = object.slowFirstChild(); child; 78 for (const LayoutObject* child = object.slowFirstChild(); child;
68 child = child->nextSibling()) { 79 child = child->nextSibling()) {
69 // Column spanners are walked through their placeholders. See below. 80 // Column spanners are walked through their placeholders. See above.
70 if (child->isColumnSpanAll()) 81 if (child->isColumnSpanAll())
71 continue; 82 continue;
72 walk(*child, localContext); 83 walk(*child, localContext);
73 } 84 }
74 85
75 if (object.isLayoutMultiColumnSpannerPlaceholder())
76 walk(*toLayoutMultiColumnSpannerPlaceholder(object)
77 .layoutObjectInFlowThread(),
78 localContext);
79
80 if (object.isLayoutPart()) { 86 if (object.isLayoutPart()) {
81 const LayoutPart& layoutPart = toLayoutPart(object); 87 const LayoutPart& layoutPart = toLayoutPart(object);
82 Widget* widget = layoutPart.widget(); 88 Widget* widget = layoutPart.widget();
83 if (widget && widget->isFrameView()) { 89 if (widget && widget->isFrameView()) {
84 localContext.treeBuilderContext.current.paintOffset += 90 localContext.treeBuilderContext.current.paintOffset +=
85 layoutPart.replacedContentRect().location() - 91 layoutPart.replacedContentRect().location() -
86 widget->frameRect().location(); 92 widget->frameRect().location();
87 localContext.treeBuilderContext.current.paintOffset = 93 localContext.treeBuilderContext.current.paintOffset =
88 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); 94 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset);
89 walk(*toFrameView(widget), localContext); 95 walk(*toFrameView(widget), localContext);
90 } 96 }
91 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). 97 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281).
92 } 98 }
93 } 99 }
94 100
95 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698