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

Unified Diff: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp

Issue 2679623002: Clear MatchedPropertiesCache on StyleRule changes. (Closed)
Patch Set: Created 3 years, 10 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/dom/StyleEngineTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
index 4420191583105b1419b10ff90c9ec831b8daf517..c7ddcfa2f93aa39ffb5f0ac3a01d505b64fc4d62 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
@@ -160,7 +160,14 @@ void CSSStyleSheet::didMutateRules() {
DCHECK(m_contents->isMutable());
DCHECK_LE(m_contents->clientSize(), 1u);
- didMutate();
+ Document* owner = ownerDocument();
+ if (!owner)
+ return;
+ if (ownerNode() && ownerNode()->isConnected()) {
+ owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope());
+ if (StyleResolver* resolver = owner->styleEngine().resolver())
+ resolver->invalidateMatchedPropertiesCache();
+ }
}
void CSSStyleSheet::didMutate() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698