Index: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp |
index 731252ae344cbe14f5a9a6329b3abc8fd2771a73..358875b80b8b611ca7ad6958f6d9bcc743459e8a 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp |
@@ -46,6 +46,24 @@ |
namespace blink { |
+#if ENABLE(OILPAN) |
+void ScopedStyleResolver::dispose() |
+{ |
+ m_keyframesRuleMap.clear(); |
+ |
+ if (m_treeBoundaryCrossingRuleSet) { |
+ for (size_t i = 0; i < m_treeBoundaryCrossingRuleSet->size(); ++i) { |
+ if (RuleSet* ruleSet = m_treeBoundaryCrossingRuleSet->at(i)->m_ruleSet.get()) |
+ ruleSet->dispose(); |
+ } |
+ |
+ m_treeBoundaryCrossingRuleSet->clear(); |
+ m_treeBoundaryCrossingRuleSet.clear(); |
+ } |
+ |
+} |
+#endif |
+ |
ScopedStyleResolver* ScopedStyleResolver::parent() const |
{ |
for (TreeScope* scope = treeScope().parentTreeScope(); scope; scope = scope->parentTreeScope()) { |
@@ -71,12 +89,13 @@ void ScopedStyleResolver::addFontFaceRules(const RuleSet& ruleSet) |
Document& document = treeScope().document(); |
CSSFontSelector* cssFontSelector = document.styleEngine().fontSelector(); |
const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace>> fontFaceRules = ruleSet.fontFaceRules(); |
+ if (!fontFaceRules.size()) |
+ return; |
for (auto& fontFaceRule : fontFaceRules) { |
if (RefPtrWillBeRawPtr<FontFace> fontFace = FontFace::create(&document, fontFaceRule)) |
cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, fontFace); |
} |
- if (fontFaceRules.size()) |
- document.styleResolver()->invalidateMatchedPropertiesCache(); |
+ document.styleResolver()->invalidateMatchedPropertiesCache(); |
} |
void ScopedStyleResolver::appendCSSStyleSheet(CSSStyleSheet& cssSheet, const MediaQueryEvaluator& medium) |