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

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

Issue 1362693004: When style changes, set the LayoutObject as a client for all StyleImage loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 d0c0e001d1fd64cf6d40c402f37b7d80c5e0a784..229266eb40193c219cf6d2a03a033a5963824695 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1823,6 +1823,16 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style)
updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderImage().image());
updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBoxImage().image());
+ StyleImage* newContentImage = m_style->contentData() && m_style->contentData()->isImage() ?
+ toImageContentData(m_style->contentData())->image() : nullptr;
+ StyleImage* oldContentImage = oldStyle && oldStyle->contentData() && oldStyle->contentData()->isImage() ?
+ toImageContentData(oldStyle->contentData())->image() : nullptr;
+ updateImage(oldContentImage, newContentImage);
+
+ StyleImage* newBoxReflectMaskImage = m_style->boxReflect() ? m_style->boxReflect()->mask().image() : nullptr;
+ StyleImage* oldBoxReflectMaskImage = oldStyle && oldStyle->boxReflect() ? oldStyle->boxReflect()->mask().image() : nullptr;
+ updateImage(oldBoxReflectMaskImage, newBoxReflectMaskImage);
+
updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOutside());
bool doesNotNeedLayoutOrPaintInvalidation = !m_parent;
@@ -2459,6 +2469,12 @@ void LayoutObject::willBeDestroyed()
if (StyleImage* maskBoxImage = m_style->maskBoxImage().image())
maskBoxImage->removeClient(this);
+ if (m_style->contentData() && m_style->contentData()->isImage())
+ toImageContentData(m_style->contentData())->image()->removeClient(this);
+
+ if (m_style->boxReflect() && m_style->boxReflect()->mask().image())
+ m_style->boxReflect()->mask().image()->removeClient(this);
+
removeShapeImageClient(m_style->shapeOutside());
}
ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeLayoutObject(this);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutListItem.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698