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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutListItem.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutListItem.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
index 27cf22d899c4d652d62b3bf66d2dbb22e4dc9075..a0f1437b4c5a976bc5817b543f289d4ad2661ed0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -63,6 +63,14 @@ void LayoutListItem::styleDidChange(StyleDifference diff, const ComputedStyle* o
m_marker->destroy();
m_marker = nullptr;
}
+
+ StyleImage* oldImage = oldStyle ? oldStyle->listStyleImage() : nullptr;
+ if (oldImage != style()->listStyleImage()) {
+ if (oldImage)
+ oldImage->removeClient(this);
+ if (style()->listStyleImage())
+ style()->listStyleImage()->addClient(this);
+ }
}
void LayoutListItem::willBeDestroyed()
@@ -71,7 +79,11 @@ void LayoutListItem::willBeDestroyed()
m_marker->destroy();
m_marker = nullptr;
}
+
LayoutBlockFlow::willBeDestroyed();
+
+ if (style() && style()->listStyleImage())
+ style()->listStyleImage()->removeClient(this);
}
void LayoutListItem::insertedIntoTree()
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698