| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSParserImpl_h | 5 #ifndef CSSParserImpl_h |
| 6 #define CSSParserImpl_h | 6 #define CSSParserImpl_h |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/css/CSSProperty.h" | 9 #include "core/css/CSSProperty.h" |
| 10 #include "core/css/CSSPropertySourceData.h" | 10 #include "core/css/CSSPropertySourceData.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); | 65 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); |
| 66 static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetCont
ents*); | 66 static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetCont
ents*); |
| 67 | 67 |
| 68 static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange
); | 68 static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange
); |
| 69 | 69 |
| 70 static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&); | 70 static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&); |
| 71 | 71 |
| 72 bool supportsDeclaration(CSSParserTokenRange&); | 72 bool supportsDeclaration(CSSParserTokenRange&); |
| 73 | 73 |
| 74 static void parseDeclarationListForInspector(const String&, const CSSParserC
ontext&, CSSParserObserver&); | 74 static void parseDeclarationListForInspector(const String&, const CSSParserC
ontext&, CSSParserObserver&); |
| 75 static ImmutableStylePropertySet* parseDeclarationListForLazyStyle(CSSParser
TokenRange, const CSSParserContext&); |
| 75 static void parseStyleSheetForInspector(const String&, const CSSParserContex
t&, StyleSheetContents*, CSSParserObserver&); | 76 static void parseStyleSheetForInspector(const String&, const CSSParserContex
t&, StyleSheetContents*, CSSParserObserver&); |
| 76 | 77 |
| 78 void enableLazyParsing() { m_shouldUseLazyParsing = true; } |
| 79 |
| 77 private: | 80 private: |
| 78 enum RuleListType { | 81 enum RuleListType { |
| 79 TopLevelRuleList, | 82 TopLevelRuleList, |
| 80 RegularRuleList, | 83 RegularRuleList, |
| 81 KeyframesRuleList | 84 KeyframesRuleList |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 // Returns whether the first encountered rule was valid | 87 // Returns whether the first encountered rule was valid |
| 85 template<typename T> | 88 template<typename T> |
| 86 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); | 89 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 113 | 116 |
| 114 // FIXME: Can we build StylePropertySets directly? | 117 // FIXME: Can we build StylePropertySets directly? |
| 115 // FIXME: Investigate using a smaller inline buffer | 118 // FIXME: Investigate using a smaller inline buffer |
| 116 HeapVector<CSSProperty, 256> m_parsedProperties; | 119 HeapVector<CSSProperty, 256> m_parsedProperties; |
| 117 const CSSParserContext& m_context; | 120 const CSSParserContext& m_context; |
| 118 | 121 |
| 119 Member<StyleSheetContents> m_styleSheet; | 122 Member<StyleSheetContents> m_styleSheet; |
| 120 | 123 |
| 121 // For the inspector | 124 // For the inspector |
| 122 CSSParserObserverWrapper* m_observerWrapper; | 125 CSSParserObserverWrapper* m_observerWrapper; |
| 126 |
| 127 // Right now, just enable lazy parsing when we parse a whole sheet. |
| 128 bool m_shouldUseLazyParsing = false; |
| 123 }; | 129 }; |
| 124 | 130 |
| 125 } // namespace blink | 131 } // namespace blink |
| 126 | 132 |
| 127 #endif // CSSParserImpl_h | 133 #endif // CSSParserImpl_h |
| OLD | NEW |