Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/StyleRule.h |
| diff --git a/third_party/WebKit/Source/core/css/StyleRule.h b/third_party/WebKit/Source/core/css/StyleRule.h |
| index f7098ecadac418056cfe9af359b134ddbb27045a..43b546d66933e32d62d67235b908aca7d2f8ba5c 100644 |
| --- a/third_party/WebKit/Source/core/css/StyleRule.h |
| +++ b/third_party/WebKit/Source/core/css/StyleRule.h |
| @@ -26,6 +26,7 @@ |
| #include "core/css/CSSSelectorList.h" |
| #include "core/css/MediaList.h" |
| #include "core/css/StylePropertySet.h" |
| +#include "core/css/parser/CSSParser.h" |
|
Timothy Loh
2016/09/26 05:18:00
I don't really like this dependency, maybe the typ
Charlie Harrison
2016/09/26 22:14:45
Sure. Done.
|
| #include "platform/heap/Handle.h" |
| #include "wtf/RefPtr.h" |
| @@ -97,11 +98,15 @@ public: |
| { |
| return new StyleRule(std::move(selectorList), properties); |
| } |
| + static StyleRule* createLazy(CSSSelectorList selectorList, std::unique_ptr<CSSParser::DeferredPropertiesClosure> deferredProperties) |
| + { |
| + return new StyleRule(std::move(selectorList), std::move(deferredProperties)); |
| + } |
| ~StyleRule(); |
| const CSSSelectorList& selectorList() const { return m_selectorList; } |
| - const StylePropertySet& properties() const { return *m_properties; } |
| + const StylePropertySet& properties() const; |
| MutableStylePropertySet& mutableProperties(); |
| void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList = std::move(selectors); } |
| @@ -110,14 +115,20 @@ public: |
| static unsigned averageSizeInBytes(); |
| + // Helper methods to avoid parsing lazy properties when not needed. |
| + bool propertiesHaveFailedOrCanceledSubresources() const; |
| + bool hasEmptyProperties() const; |
| + |
| DECLARE_TRACE_AFTER_DISPATCH(); |
| private: |
| StyleRule(CSSSelectorList, StylePropertySet*); |
| + StyleRule(CSSSelectorList, std::unique_ptr<CSSParser::DeferredPropertiesClosure>); |
| StyleRule(const StyleRule&); |
| - Member<StylePropertySet> m_properties; // Cannot be null. |
| CSSSelectorList m_selectorList; |
| + mutable Member<StylePropertySet> m_properties; |
| + mutable std::unique_ptr<CSSParser::DeferredPropertiesClosure> m_deferred; |
| }; |
| class StyleRuleFontFace : public StyleRuleBase { |