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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2615203002: Remove multicol special-cases from invalidation and the pre-paint tree walk (Closed)
Patch Set: Cleanup comment Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index d2a508f42f5dfed164799736883fbe6cfdc30402..ee0f4999ab6fef310397daa278bbde494710465f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -619,8 +619,13 @@ PaintLayer* LayoutObject::paintingLayer() const {
current = current->isFloating() ? current->containingBlock()
: current->paintInvalidationParent()) {
if (current->hasLayer() &&
- toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer())
+ toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) {
return toLayoutBoxModelObject(current)->layer();
+ } else if (current->isColumnSpanAll()) {
+ // Column spanners paint through their multicolumn containers which can
+ // be accessed through the associated out-of-flow placeholder's parent.
+ current = current->spannerPlaceholder();
+ }
}
// TODO(crbug.com/365897): we should get rid of detached layout subtrees, at
// which point this code should not be reached.
@@ -1190,14 +1195,8 @@ void LayoutObject::invalidatePaintOfSubtreesIfNeeded(
const PaintInvalidationState& childPaintInvalidationState) {
DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- for (LayoutObject* child = slowFirstChild(); child;
- child = child->nextSibling()) {
- // Column spanners are invalidated through their placeholders. See
- // LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfNeeded().
- if (child->isColumnSpanAll())
- continue;
+ for (auto* child = slowFirstChild(); child; child = child->nextSibling())
child->invalidateTreeIfNeeded(childPaintInvalidationState);
- }
}
LayoutRect LayoutObject::selectionRectInViewCoordinates() const {
@@ -2554,8 +2553,6 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor,
inline LayoutObject* LayoutObject::paintInvalidationParent() const {
if (isLayoutView())
return LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem());
- if (isColumnSpanAll())
- return spannerPlaceholder();
return parent();
}

Powered by Google App Engine
This is Rietveld 408576698