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 21674ddb9d57c40e1c00c5885e795195c1cc6518..9cbb93e695e8d9b21878940053f22bced531d22a 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -3234,6 +3234,12 @@ bool LayoutObject::isInert() const |
void LayoutObject::imageChanged(ImageResource* image, const IntRect* rect) |
{ |
ASSERT(m_node); |
+ |
+ // Image change notifications should not be received during paint because |
+ // the resulting invalidations will be cleared following paint. This can also |
+ // lead to modifying the tree out from under paint(), see: crbug.com/616700. |
+ DCHECK(document().lifecycle().state() != DocumentLifecycle::LifecycleState::InPaint); |
+ |
imageChanged(static_cast<WrappedImagePtr>(image), rect); |
} |