| OLD | NEW |
| 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 Loading... |
| 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 // Walk multi-column spanner as if it replaces the placeholder. |
| 61 // Set the flag so that the tree builder can specially handle out-of-flow |
| 62 // positioned descendants if their containers are between the multi-column |
| 63 // container and the spanner. See PaintPropertyTreeBuilder for details. |
| 64 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true; |
| 65 walk(*toLayoutMultiColumnSpannerPlaceholder(object) |
| 66 .layoutObjectInFlowThread(), |
| 67 localContext); |
| 68 return; |
| 69 } |
| 70 |
| 59 m_propertyTreeBuilder.buildTreeNodesForSelf(object, | 71 m_propertyTreeBuilder.buildTreeNodesForSelf(object, |
| 60 localContext.treeBuilderContext); | 72 localContext.treeBuilderContext); |
| 61 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 73 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 62 m_paintInvalidator.invalidatePaintIfNeeded( | 74 m_paintInvalidator.invalidatePaintIfNeeded( |
| 63 object, localContext.paintInvalidatorContext); | 75 object, localContext.paintInvalidatorContext); |
| 64 m_propertyTreeBuilder.buildTreeNodesForChildren( | 76 m_propertyTreeBuilder.buildTreeNodesForChildren( |
| 65 object, localContext.treeBuilderContext); | 77 object, localContext.treeBuilderContext); |
| 66 | 78 |
| 67 for (const LayoutObject* child = object.slowFirstChild(); child; | 79 for (const LayoutObject* child = object.slowFirstChild(); child; |
| 68 child = child->nextSibling()) { | 80 child = child->nextSibling()) { |
| 69 // Column spanners are walked through their placeholders. See below. | 81 // Column spanners are walked through their placeholders. See above. |
| 70 if (child->isColumnSpanAll()) | 82 if (child->isColumnSpanAll()) |
| 71 continue; | 83 continue; |
| 72 walk(*child, localContext); | 84 walk(*child, localContext); |
| 73 } | 85 } |
| 74 | 86 |
| 75 if (object.isLayoutMultiColumnSpannerPlaceholder()) | |
| 76 walk(*toLayoutMultiColumnSpannerPlaceholder(object) | |
| 77 .layoutObjectInFlowThread(), | |
| 78 localContext); | |
| 79 | |
| 80 if (object.isLayoutPart()) { | 87 if (object.isLayoutPart()) { |
| 81 const LayoutPart& layoutPart = toLayoutPart(object); | 88 const LayoutPart& layoutPart = toLayoutPart(object); |
| 82 Widget* widget = layoutPart.widget(); | 89 Widget* widget = layoutPart.widget(); |
| 83 if (widget && widget->isFrameView()) { | 90 if (widget && widget->isFrameView()) { |
| 84 localContext.treeBuilderContext.current.paintOffset += | 91 localContext.treeBuilderContext.current.paintOffset += |
| 85 layoutPart.replacedContentRect().location() - | 92 layoutPart.replacedContentRect().location() - |
| 86 widget->frameRect().location(); | 93 widget->frameRect().location(); |
| 87 localContext.treeBuilderContext.current.paintOffset = | 94 localContext.treeBuilderContext.current.paintOffset = |
| 88 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); | 95 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); |
| 89 walk(*toFrameView(widget), localContext); | 96 walk(*toFrameView(widget), localContext); |
| 90 } | 97 } |
| 91 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 98 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 92 } | 99 } |
| 93 } | 100 } |
| 94 | 101 |
| 95 } // namespace blink | 102 } // namespace blink |
| OLD | NEW |