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

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

Issue 2038243002: Prevent synchronous image change notifications during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Great Expectations Created 4 years, 6 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698