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

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

Issue 1342503002: When style changes, set the LayoutObject as a client for all StyleImage loads. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 46551c480117b4ee2bf3c3128ff347d08f885d6e..8fd41bb6a41fbfe124c8241d65c7cc7e86e356fe 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/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 | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698