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" |
11 #include "core/css/parser/CSSParserMode.h" | 11 #include "core/css/parser/CSSParserMode.h" |
12 #include "core/css/parser/CSSParserToken.h" | 12 #include "core/css/parser/CSSParserToken.h" |
| 13 #include "platform/heap/Handle.h" |
13 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
14 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 class MutableStylePropertySet; | 19 class MutableStylePropertySet; |
19 | 20 |
20 class CSSParserImpl { | 21 class CSSParserImpl { |
| 22 STACK_ALLOCATED(); |
21 public: | 23 public: |
22 CSSParserImpl(const CSSParserContext&, const String&); | 24 CSSParserImpl(const CSSParserContext&, const String&); |
23 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); | 25 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); |
24 | 26 |
25 private: | 27 private: |
26 void consumeDeclarationValue(CSSParserTokenIterator start, CSSParserTokenIte
rator end, CSSPropertyID, bool important, CSSRuleSourceData::Type); | 28 void consumeDeclarationValue(CSSParserTokenIterator start, CSSParserTokenIte
rator end, CSSPropertyID, bool important, CSSRuleSourceData::Type); |
27 | 29 |
28 // FIXME: Can we build StylePropertySets directly? | 30 // FIXME: Can we build StylePropertySets directly? |
29 // FIXME: Investigate using a smaller inline buffer | 31 // FIXME: Investigate using a smaller inline buffer |
30 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; | 32 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; |
31 Vector<CSSParserToken> m_tokens; | 33 Vector<CSSParserToken> m_tokens; |
32 CSSParserContext m_context; | 34 CSSParserContext m_context; |
33 }; | 35 }; |
34 | 36 |
35 } // namespace blink | 37 } // namespace blink |
36 | 38 |
37 #endif // CSSParserImpl_h | 39 #endif // CSSParserImpl_h |
OLD | NEW |