Index: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp |
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp |
index eedca8d87b2e4e5ed0df5364011f1a75c4de5a89..8f72299d5337f38a32fd209e0f2509e45b1f7d3e 100644 |
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp |
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp |
@@ -338,6 +338,16 @@ void ObjectPaintInvalidator::setBackingNeedsPaintInvalidationInRect( |
} |
} |
+static bool parentIsContainer(const LayoutObject& object) { |
+ if (object.isTextOrSVGChild() || |
wkorman
2017/02/22 21:52:22
Is there a relevant spec section or something we c
Xianzhu
2017/02/22 23:20:59
The conditions are the same conditions that Layout
|
+ (!object.isOutOfFlowPositioned() && !object.isColumnSpanAll() && |
+ !object.isFloating())) { |
+ DCHECK(object.parent() == object.container()); |
+ return true; |
+ } |
+ return false; |
+} |
+ |
void ObjectPaintInvalidator::invalidatePaintUsingContainer( |
const LayoutBoxModelObject& paintInvalidationContainer, |
const LayoutRect& dirtyRect, |
@@ -358,7 +368,15 @@ void ObjectPaintInvalidator::invalidatePaintUsingContainer( |
if (dirtyRect.isEmpty()) |
return; |
- CHECK(m_object.isRooted()); |
+ DCHECK(m_object.isRooted()); |
wkorman
2017/02/22 21:52:22
Just curious, why shift to DCHECK?
Xianzhu
2017/02/22 23:20:59
isRooted() is slow because it traverse the layout/
|
+ |
+ if (m_object != paintInvalidationContainer && m_object.parent() && |
wkorman
2017/02/22 21:52:22
Could be worth adding a comment to explain backgro
|
+ m_object.parent() != paintInvalidationContainer && |
+ isImmediateFullPaintInvalidationReason( |
+ m_object.parent()->fullPaintInvalidationReason()) && |
+ parentIsContainer(m_object) && |
+ m_object.parent()->visualRect().contains(dirtyRect)) |
+ return; |
// FIXME: Unify "devtools.timeline.invalidationTracking" and |
// "blink.invalidation". crbug.com/413527. |