Remove CSSOM mutability in StyleRule. The StyleRule classes supported copy() operations and mutable property sets so that we could do copy-on-write and mutate them using the CSSOM. Sky doesn't have a CSSOM like this though, so we can remove all this code and make the StyleRule classes effectively immutable after construction (the parser does mutate some rules though). I also removed some other dead code in the StyleRule hierarchy, like some left over mutation methods that the CSSOM used to use. R=eseidel@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/758573005
diff --git a/sky/engine/core/css/StyleKeyframe.cpp b/sky/engine/core/css/StyleKeyframe.cpp index 78d2cfb..94ee838 100644 --- a/sky/engine/core/css/StyleKeyframe.cpp +++ b/sky/engine/core/css/StyleKeyframe.cpp
@@ -89,13 +89,6 @@ ASSERT(m_keyText.isNull()); } -MutableStylePropertySet& StyleKeyframe::mutableProperties() -{ - if (!m_properties->isMutable()) - m_properties = m_properties->mutableCopy(); - return *toMutableStylePropertySet(m_properties.get()); -} - void StyleKeyframe::setProperties(PassRefPtr<StylePropertySet> properties) { ASSERT(properties);
diff --git a/sky/engine/core/css/StyleKeyframe.h b/sky/engine/core/css/StyleKeyframe.h index 7d6dc01..d80b7d6 100644 --- a/sky/engine/core/css/StyleKeyframe.h +++ b/sky/engine/core/css/StyleKeyframe.h
@@ -58,7 +58,6 @@ void setKeys(PassOwnPtr<Vector<double> >); const StylePropertySet& properties() const { return *m_properties; } - MutableStylePropertySet& mutableProperties(); void setProperties(PassRefPtr<StylePropertySet>); String cssText() const;
diff --git a/sky/engine/core/css/StyleRule.cpp b/sky/engine/core/css/StyleRule.cpp index 74b3ca5..66777ea 100644 --- a/sky/engine/core/css/StyleRule.cpp +++ b/sky/engine/core/css/StyleRule.cpp
@@ -62,30 +62,6 @@ ASSERT_NOT_REACHED(); } -PassRefPtr<StyleRuleBase> StyleRuleBase::copy() const -{ - switch (type()) { - case Style: - return toStyleRule(this)->copy(); - case FontFace: - return toStyleRuleFontFace(this)->copy(); - case Media: - return toStyleRuleMedia(this)->copy(); - case Supports: - return toStyleRuleSupports(this)->copy(); - case Keyframes: - return toStyleRuleKeyframes(this)->copy(); - case Filter: - return toStyleRuleFilter(this)->copy(); - case Unknown: - case Keyframe: - ASSERT_NOT_REACHED(); - return nullptr; - } - ASSERT_NOT_REACHED(); - return nullptr; -} - unsigned StyleRule::averageSizeInBytes() { return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes(); @@ -96,24 +72,10 @@ { } -StyleRule::StyleRule(const StyleRule& o) - : StyleRuleBase(o) - , m_properties(o.m_properties->mutableCopy()) - , m_selectorList(o.m_selectorList) -{ -} - StyleRule::~StyleRule() { } -MutableStylePropertySet& StyleRule::mutableProperties() -{ - if (!m_properties->isMutable()) - m_properties = m_properties->mutableCopy(); - return *toMutableStylePropertySet(m_properties.get()); -} - void StyleRule::setProperties(PassRefPtr<StylePropertySet> properties) { m_properties = properties; @@ -124,23 +86,10 @@ { } -StyleRuleFontFace::StyleRuleFontFace(const StyleRuleFontFace& o) - : StyleRuleBase(o) - , m_properties(o.m_properties->mutableCopy()) -{ -} - StyleRuleFontFace::~StyleRuleFontFace() { } -MutableStylePropertySet& StyleRuleFontFace::mutableProperties() -{ - if (!m_properties->isMutable()) - m_properties = m_properties->mutableCopy(); - return *toMutableStylePropertySet(m_properties); -} - void StyleRuleFontFace::setProperties(PassRefPtr<StylePropertySet> properties) { m_properties = properties; @@ -152,37 +101,12 @@ m_childRules.swap(adoptRule); } -StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o) - : StyleRuleBase(o) - , m_childRules(o.m_childRules.size()) -{ - for (unsigned i = 0; i < m_childRules.size(); ++i) - m_childRules[i] = o.m_childRules[i]->copy(); -} - -void StyleRuleGroup::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule) -{ - m_childRules.insert(index, rule); -} - -void StyleRuleGroup::wrapperRemoveRule(unsigned index) -{ - m_childRules.remove(index); -} - StyleRuleMedia::StyleRuleMedia(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(Media, adoptRules) , m_mediaQueries(media) { } -StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o) - : StyleRuleGroup(o) -{ - if (o.m_mediaQueries) - m_mediaQueries = o.m_mediaQueries->copy(); -} - StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(Supports, adoptRules) , m_conditionText(conditionText) @@ -190,37 +114,16 @@ { } -StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) - : StyleRuleGroup(o) - , m_conditionText(o.m_conditionText) - , m_conditionIsSupported(o.m_conditionIsSupported) -{ -} - StyleRuleFilter::StyleRuleFilter(const String& filterName) : StyleRuleBase(Filter) , m_filterName(filterName) { } -StyleRuleFilter::StyleRuleFilter(const StyleRuleFilter& o) - : StyleRuleBase(o) - , m_filterName(o.m_filterName) - , m_properties(o.m_properties->mutableCopy()) -{ -} - StyleRuleFilter::~StyleRuleFilter() { } -MutableStylePropertySet& StyleRuleFilter::mutableProperties() -{ - if (!m_properties->isMutable()) - m_properties = m_properties->mutableCopy(); - return *toMutableStylePropertySet(m_properties); -} - void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties) { m_properties = properties;
diff --git a/sky/engine/core/css/StyleRule.h b/sky/engine/core/css/StyleRule.h index d5dc7b6..3c5e283 100644 --- a/sky/engine/core/css/StyleRule.h +++ b/sky/engine/core/css/StyleRule.h
@@ -24,12 +24,11 @@ #include "sky/engine/core/css/CSSSelectorList.h" #include "sky/engine/core/css/MediaList.h" +#include "sky/engine/wtf/Noncopyable.h" #include "sky/engine/wtf/RefPtr.h" namespace blink { -class CSSStyleSheet; -class MutableStylePropertySet; class StylePropertySet; class StyleRuleBase : public RefCounted<StyleRuleBase> { @@ -55,8 +54,6 @@ bool isSupportsRule() const { return type() == Supports; } bool isFilterRule() const { return type() == Filter; } - PassRefPtr<StyleRuleBase> copy() const; - void deref() { if (derefBase()) @@ -65,7 +62,6 @@ protected: StyleRuleBase(Type type) : m_type(type) { } - StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } ~StyleRuleBase() { } @@ -75,8 +71,9 @@ unsigned m_type : 5; }; -class StyleRule : public StyleRuleBase { +class StyleRule final : public StyleRuleBase { WTF_MAKE_FAST_ALLOCATED; + WTF_MAKE_NONCOPYABLE(StyleRule); public: static PassRefPtr<StyleRule> create() { return adoptRef(new StyleRule()); } @@ -84,40 +81,33 @@ const CSSSelectorList& selectorList() const { return m_selectorList; } const StylePropertySet& properties() const { return *m_properties; } - MutableStylePropertySet& mutableProperties(); void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors) { m_selectorList.adoptSelectorVector(selectors); } void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList.adopt(selectors); } void setProperties(PassRefPtr<StylePropertySet>); - PassRefPtr<StyleRule> copy() const { return adoptRef(new StyleRule(*this)); } - static unsigned averageSizeInBytes(); private: StyleRule(); - StyleRule(const StyleRule&); RefPtr<StylePropertySet> m_properties; // Cannot be null. CSSSelectorList m_selectorList; }; -class StyleRuleFontFace : public StyleRuleBase { +class StyleRuleFontFace final : public StyleRuleBase { + WTF_MAKE_NONCOPYABLE(StyleRuleFontFace); public: static PassRefPtr<StyleRuleFontFace> create() { return adoptRef(new StyleRuleFontFace); } ~StyleRuleFontFace(); const StylePropertySet& properties() const { return *m_properties; } - MutableStylePropertySet& mutableProperties(); void setProperties(PassRefPtr<StylePropertySet>); - PassRefPtr<StyleRuleFontFace> copy() const { return adoptRef(new StyleRuleFontFace(*this)); } - private: StyleRuleFontFace(); - StyleRuleFontFace(const StyleRuleFontFace&); RefPtr<StylePropertySet> m_properties; // Cannot be null. }; @@ -126,18 +116,15 @@ public: const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; } - void wrapperInsertRule(unsigned, PassRefPtr<StyleRuleBase>); - void wrapperRemoveRule(unsigned); - protected: StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule); - StyleRuleGroup(const StyleRuleGroup&); private: Vector<RefPtr<StyleRuleBase> > m_childRules; }; -class StyleRuleMedia : public StyleRuleGroup { +class StyleRuleMedia final : public StyleRuleGroup { + WTF_MAKE_NONCOPYABLE(StyleRuleMedia); public: static PassRefPtr<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules) { @@ -146,16 +133,14 @@ MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } - PassRefPtr<StyleRuleMedia> copy() const { return adoptRef(new StyleRuleMedia(*this)); } - private: StyleRuleMedia(PassRefPtr<MediaQuerySet>, Vector<RefPtr<StyleRuleBase> >& adoptRules); - StyleRuleMedia(const StyleRuleMedia&); RefPtr<MediaQuerySet> m_mediaQueries; }; -class StyleRuleSupports : public StyleRuleGroup { +class StyleRuleSupports final : public StyleRuleGroup { + WTF_MAKE_NONCOPYABLE(StyleRuleSupports); public: static PassRefPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) { @@ -164,17 +149,16 @@ String conditionText() const { return m_conditionText; } bool conditionIsSupported() const { return m_conditionIsSupported; } - PassRefPtr<StyleRuleSupports> copy() const { return adoptRef(new StyleRuleSupports(*this)); } private: StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules); - StyleRuleSupports(const StyleRuleSupports&); String m_conditionText; bool m_conditionIsSupported; }; -class StyleRuleFilter : public StyleRuleBase { +class StyleRuleFilter final : public StyleRuleBase { + WTF_MAKE_NONCOPYABLE(StyleRuleFilter); public: static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return adoptRef(new StyleRuleFilter(filterName)); } @@ -183,15 +167,11 @@ const String& filterName() const { return m_filterName; } const StylePropertySet& properties() const { return *m_properties; } - MutableStylePropertySet& mutableProperties(); void setProperties(PassRefPtr<StylePropertySet>); - PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilter(*this)); } - private: StyleRuleFilter(const String&); - StyleRuleFilter(const StyleRuleFilter&); String m_filterName; RefPtr<StylePropertySet> m_properties;
diff --git a/sky/engine/core/css/StyleRuleKeyframes.cpp b/sky/engine/core/css/StyleRuleKeyframes.cpp index 9c432fc..be7ce46 100644 --- a/sky/engine/core/css/StyleRuleKeyframes.cpp +++ b/sky/engine/core/css/StyleRuleKeyframes.cpp
@@ -35,14 +35,6 @@ { } -StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) - : StyleRuleBase(o) - , m_keyframes(o.m_keyframes) - , m_name(o.m_name) - , m_isPrefixed(o.m_isPrefixed) -{ -} - StyleRuleKeyframes::~StyleRuleKeyframes() { } @@ -54,31 +46,4 @@ m_keyframes.append(keyframe); } -void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtr<StyleKeyframe> keyframe) -{ - m_keyframes.append(keyframe); -} - -void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) -{ - m_keyframes.remove(index); -} - -int StyleRuleKeyframes::findKeyframeIndex(const String& key) const -{ - String percentageString; - if (equalIgnoringCase(key, "from")) - percentageString = "0%"; - else if (equalIgnoringCase(key, "to")) - percentageString = "100%"; - else - percentageString = key; - - for (unsigned i = 0; i < m_keyframes.size(); ++i) { - if (m_keyframes[i]->keyText() == percentageString) - return i; - } - return -1; -} - } // namespace blink
diff --git a/sky/engine/core/css/StyleRuleKeyframes.h b/sky/engine/core/css/StyleRuleKeyframes.h index a7c7655..67911a0 100644 --- a/sky/engine/core/css/StyleRuleKeyframes.h +++ b/sky/engine/core/css/StyleRuleKeyframes.h
@@ -28,6 +28,7 @@ #include "sky/engine/core/css/StyleRule.h" #include "sky/engine/wtf/Forward.h" +#include "sky/engine/wtf/Noncopyable.h" #include "sky/engine/wtf/text/AtomicString.h" namespace blink { @@ -35,6 +36,7 @@ class StyleKeyframe; class StyleRuleKeyframes final : public StyleRuleBase { + WTF_MAKE_NONCOPYABLE(StyleRuleKeyframes); public: static PassRefPtr<StyleRuleKeyframes> create() { return adoptRef(new StyleRuleKeyframes()); } @@ -43,8 +45,6 @@ const Vector<RefPtr<StyleKeyframe> >& keyframes() const { return m_keyframes; } void parserAppendKeyframe(PassRefPtr<StyleKeyframe>); - void wrapperAppendKeyframe(PassRefPtr<StyleKeyframe>); - void wrapperRemoveKeyframe(unsigned); String name() const { return m_name; } void setName(const String& name) { m_name = AtomicString(name); } @@ -52,13 +52,8 @@ bool isVendorPrefixed() const { return m_isPrefixed; } void setVendorPrefixed(bool isPrefixed) { m_isPrefixed = isPrefixed; } - int findKeyframeIndex(const String& key) const; - - PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleKeyframes(*this)); } - private: StyleRuleKeyframes(); - explicit StyleRuleKeyframes(const StyleRuleKeyframes&); Vector<RefPtr<StyleKeyframe> > m_keyframes; AtomicString m_name;
diff --git a/sky/engine/core/css/StyleSheetContents.cpp b/sky/engine/core/css/StyleSheetContents.cpp index 871a747..0391de8 100644 --- a/sky/engine/core/css/StyleSheetContents.cpp +++ b/sky/engine/core/css/StyleSheetContents.cpp
@@ -35,53 +35,16 @@ namespace blink { -// Rough size estimate for the memory cache. -unsigned StyleSheetContents::estimatedSizeInBytes() const -{ - // Note that this does not take into account size of the strings hanging from various objects. - // The assumption is that nearly all of of them are atomic and would exist anyway. - unsigned size = sizeof(*this); - - // FIXME: This ignores the children of media rules. - // Most rules are StyleRules. - size += ruleCount() * StyleRule::averageSizeInBytes(); - return size; -} - StyleSheetContents::StyleSheetContents(const String& originalURL, const CSSParserContext& context) - : m_originalURL(originalURL) - , m_hasSyntacticallyValidCSSHeader(true) - , m_didLoadErrorOccur(false) + : m_hasSyntacticallyValidCSSHeader(true) , m_usesRemUnits(false) - , m_isMutable(false) - , m_isInMemoryCache(false) - , m_hasFontFaceRule(false) , m_hasMediaQueries(false) , m_hasSingleOwnerDocument(true) + , m_originalURL(originalURL) , m_parserContext(context) { } -StyleSheetContents::StyleSheetContents(const StyleSheetContents& o) - : m_originalURL(o.m_originalURL) - , m_childRules(o.m_childRules.size()) - , m_namespaces(o.m_namespaces) - , m_hasSyntacticallyValidCSSHeader(o.m_hasSyntacticallyValidCSSHeader) - , m_didLoadErrorOccur(false) - , m_usesRemUnits(o.m_usesRemUnits) - , m_isMutable(false) - , m_isInMemoryCache(false) - , m_hasFontFaceRule(o.m_hasFontFaceRule) - , m_hasMediaQueries(o.m_hasMediaQueries) - , m_hasSingleOwnerDocument(true) - , m_parserContext(o.m_parserContext) -{ - ASSERT(o.isCacheable()); - - for (unsigned i = 0; i < m_childRules.size(); ++i) - m_childRules[i] = o.m_childRules[i]->copy(); -} - StyleSheetContents::~StyleSheetContents() { #if !ENABLE(OILPAN) @@ -107,11 +70,6 @@ // agnostic, we can restore sharing of StyleSheetContents with medea queries. if (m_hasMediaQueries) return false; - if (m_didLoadErrorOccur) - return false; - // It is not the original sheet anymore. - if (m_isMutable) - return false; // If the header is valid we are not going to need to check the SecurityOrigin. // FIXME: Valid mime type avoids the check too. if (!m_hasSyntacticallyValidCSSHeader) @@ -151,30 +109,6 @@ m_childRules.clear(); } -bool StyleSheetContents::wrapperInsertRule(PassRefPtr<StyleRuleBase> rule, unsigned index) -{ - ASSERT(m_isMutable); - ASSERT_WITH_SECURITY_IMPLICATION(index <= ruleCount()); - - if (rule->isMediaRule()) - setHasMediaQueries(); - - if (rule->isFontFaceRule()) - setHasFontFaceRule(true); - m_childRules.insert(index, rule); - return true; -} - -void StyleSheetContents::wrapperDeleteRule(unsigned index) -{ - ASSERT(m_isMutable); - ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount()); - - if (m_childRules[index]->isFontFaceRule()) - notifyRemoveFontFaceRule(toStyleRuleFontFace(m_childRules[index].get())); - m_childRules.remove(index); -} - bool StyleSheetContents::parseString(const String& sheetText) { return parseStringAtPosition(sheetText, TextPosition::minimumPosition(), false); @@ -292,20 +226,6 @@ document->styleEngine()->removeSheet(this); } -void StyleSheetContents::addedToMemoryCache() -{ - ASSERT(!m_isInMemoryCache); - ASSERT(isCacheable()); - m_isInMemoryCache = true; -} - -void StyleSheetContents::removedFromMemoryCache() -{ - ASSERT(m_isInMemoryCache); - ASSERT(isCacheable()); - m_isInMemoryCache = false; -} - void StyleSheetContents::shrinkToFit() { m_childRules.shrinkToFit(); @@ -357,25 +277,4 @@ removeFontFaceRules(m_completedClients, fontFaceRule); } -static void findFontFaceRulesFromRules(const Vector<RefPtr<StyleRuleBase> >& rules, Vector<RawPtr<const StyleRuleFontFace> >& fontFaceRules) -{ - for (unsigned i = 0; i < rules.size(); ++i) { - StyleRuleBase* rule = rules[i].get(); - - if (rule->isFontFaceRule()) { - fontFaceRules.append(toStyleRuleFontFace(rule)); - } else if (rule->isMediaRule()) { - StyleRuleMedia* mediaRule = toStyleRuleMedia(rule); - // We cannot know whether the media rule matches or not, but - // for safety, remove @font-face in the media rule (if exists). - findFontFaceRulesFromRules(mediaRule->childRules(), fontFaceRules); - } - } -} - -void StyleSheetContents::findFontFaceRules(Vector<RawPtr<const StyleRuleFontFace> >& fontFaceRules) -{ - findFontFaceRulesFromRules(childRules(), fontFaceRules); -} - }
diff --git a/sky/engine/core/css/StyleSheetContents.h b/sky/engine/core/css/StyleSheetContents.h index 7fecc80..375fd73 100644 --- a/sky/engine/core/css/StyleSheetContents.h +++ b/sky/engine/core/css/StyleSheetContents.h
@@ -72,10 +72,6 @@ void setHasSyntacticallyValidCSSHeader(bool isValidCss); bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValidCSSHeader; } - void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } - bool hasFontFaceRule() const { return m_hasFontFaceRule; } - void findFontFaceRules(Vector<RawPtr<const StyleRuleFontFace> >& fontFaceRules); - void parserAppendRule(PassRefPtr<StyleRuleBase>); void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } @@ -95,35 +91,16 @@ bool usesRemUnits() const { return m_usesRemUnits; } - unsigned estimatedSizeInBytes() const; - - bool wrapperInsertRule(PassRefPtr<StyleRuleBase>, unsigned index); - void wrapperDeleteRule(unsigned index); - - PassRefPtr<StyleSheetContents> copy() const - { - return adoptRef(new StyleSheetContents(*this)); - } - void registerClient(CSSStyleSheet*); void unregisterClient(CSSStyleSheet*); size_t clientSize() const { return m_loadingClients.size() + m_completedClients.size(); } bool hasOneClient() const { return clientSize() == 1; } - bool isMutable() const { return m_isMutable; } - void setMutable() { m_isMutable = true; } - void removeSheetFromCache(Document*); - bool isInMemoryCache() const { return m_isInMemoryCache; } - void addedToMemoryCache(); - void removedFromMemoryCache(); - void setHasMediaQueries(); bool hasMediaQueries() const { return m_hasMediaQueries; } - bool didLoadErrorOccur() const { return m_didLoadErrorOccur; } - void shrinkToFit(); RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } RuleSet& ensureRuleSet(const MediaQueryEvaluator&, AddRuleFlags); @@ -131,33 +108,24 @@ private: StyleSheetContents(const String& originalURL, const CSSParserContext&); - StyleSheetContents(const StyleSheetContents&); + void notifyRemoveFontFaceRule(const StyleRuleFontFace*); Document* clientSingleOwnerDocument() const; - String m_originalURL; - - Vector<RefPtr<StyleRuleBase> > m_childRules; - typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; - PrefixNamespaceURIMap m_namespaces; - bool m_hasSyntacticallyValidCSSHeader : 1; - bool m_didLoadErrorOccur : 1; bool m_usesRemUnits : 1; - bool m_isMutable : 1; - bool m_isInMemoryCache : 1; - bool m_hasFontFaceRule : 1; bool m_hasMediaQueries : 1; bool m_hasSingleOwnerDocument : 1; + String m_originalURL; + OwnPtr<RuleSet> m_ruleSet; + Vector<RefPtr<StyleRuleBase> > m_childRules; CSSParserContext m_parserContext; HashSet<RawPtr<CSSStyleSheet> > m_loadingClients; HashSet<RawPtr<CSSStyleSheet> > m_completedClients; typedef HashSet<RawPtr<CSSStyleSheet> >::iterator ClientsIterator; - - OwnPtr<RuleSet> m_ruleSet; }; } // namespace
diff --git a/sky/engine/core/css/parser/BisonCSSParser-in.cpp b/sky/engine/core/css/parser/BisonCSSParser-in.cpp index 6b0914f..5dbf821 100644 --- a/sky/engine/core/css/parser/BisonCSSParser-in.cpp +++ b/sky/engine/core/css/parser/BisonCSSParser-in.cpp
@@ -1680,8 +1680,6 @@ clearProperties(); StyleRuleFontFace* result = rule.get(); m_parsedRules.append(rule.release()); - if (m_styleSheet) - m_styleSheet->setHasFontFaceRule(true); return result; }
diff --git a/sky/engine/core/dom/StyleEngine.cpp b/sky/engine/core/dom/StyleEngine.cpp index 8a3c8b8..2cc2d80 100644 --- a/sky/engine/core/dom/StyleEngine.cpp +++ b/sky/engine/core/dom/StyleEngine.cpp
@@ -378,11 +378,6 @@ static bool isCacheableForStyleElement(const StyleSheetContents& contents) { - // Until import rules are supported in cached sheets it's not possible for loading to fail. - ASSERT(!contents.didLoadErrorOccur()); - // It is not the original sheet anymore. - if (contents.isMutable()) - return false; if (!contents.hasSyntacticallyValidCSSHeader()) return false; return true;