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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.h

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: plug leaks Created 4 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
Index: third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
index 0bcd5153417d9830ee91dc5970255cdc3d5f1f2f..2b9004eb0fdc6c5ce6f5249b6fcf568c2e9090f7 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
@@ -40,7 +40,7 @@ class CSSParserImpl {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(CSSParserImpl);
public:
- CSSParserImpl(const CSSParserContext&, StyleSheetContents* = nullptr);
+ CSSParserImpl(const CSSParserContext&, StyleSheetContents* = nullptr, bool deferPropertyParsing = false);
enum AllowedRulesType {
// As per css-syntax, css-cascade and css-namespaces, @charset rules
@@ -62,7 +62,7 @@ public:
static ImmutableStylePropertySet* parseInlineStyleDeclaration(const String&, Element*);
static bool parseDeclarationList(MutableStylePropertySet*, const String&, const CSSParserContext&);
static StyleRuleBase* parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType);
- static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents*);
+ static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents*, bool deferPropertyParsing = false);
static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetContents*);
static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange);
@@ -111,6 +111,10 @@ private:
static std::unique_ptr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange);
+ static std::unique_ptr<CSSParser::DeferredPropertiesClosure> createDeferredPropertiesClosure(CSSParserTokenRange, const CSSParserContext&, bool* forceStrict);
+
+ static StylePropertySet* parseDeclarationListForLazyStyle(std::unique_ptr <Vector<CSSParserToken>>, const CSSParserContext*);
+
// FIXME: Can we build StylePropertySets directly?
// FIXME: Investigate using a smaller inline buffer
HeapVector<CSSProperty, 256> m_parsedProperties;
@@ -120,6 +124,8 @@ private:
// For the inspector
CSSParserObserverWrapper* m_observerWrapper;
+
+ bool m_deferPropertyParsing = false;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698