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 CSSParser_h | 5 #ifndef CSSParser_h |
6 #define CSSParser_h | 6 #define CSSParser_h |
7 | 7 |
8 #include "core/css/parser/BisonCSSParser.h" | 8 #include "core/css/parser/BisonCSSParser.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 12 matching lines...) Expand all Loading... |
23 // As well as regular rules, allows @import and @namespace but not @charset | 23 // As well as regular rules, allows @import and @namespace but not @charset |
24 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const CSSParserContex
t&, StyleSheetContents*, const String&); | 24 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const CSSParserContex
t&, StyleSheetContents*, const String&); |
25 static void parseSheet(const CSSParserContext&, StyleSheetContents*, const S
tring&, const TextPosition& startPosition, CSSParserObserver*, bool logErrors =
false); | 25 static void parseSheet(const CSSParserContext&, StyleSheetContents*, const S
tring&, const TextPosition& startPosition, CSSParserObserver*, bool logErrors =
false); |
26 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, CSSParserMode, StyleSheetContents*); | 26 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, CSSParserMode, StyleSheetContents*); |
27 | 27 |
28 // This is for non-shorthands only | 28 // This is for non-shorthands only |
29 static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, cons
t String&, const CSSParserContext& = strictCSSParserContext()); | 29 static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, cons
t String&, const CSSParserContext& = strictCSSParserContext()); |
30 | 30 |
31 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); | 31 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); |
32 | 32 |
33 static PassOwnPtr<Vector<double> > parseKeyframeKeyList(const String&); | 33 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); |
34 static PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSS
ParserContext&, StyleSheetContents*, const String&); | 34 static PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSS
ParserContext&, StyleSheetContents*, const String&); |
35 | 35 |
36 static bool parseSupportsCondition(const String&); | 36 static bool parseSupportsCondition(const String&); |
37 | 37 |
38 // The color will only be changed when string contains a valid CSS color, so
callers | 38 // The color will only be changed when string contains a valid CSS color, so
callers |
39 // can set it to a default color and ignore the boolean result. | 39 // can set it to a default color and ignore the boolean result. |
40 static bool parseColor(RGBA32& color, const String&, bool strict = false); | 40 static bool parseColor(RGBA32& color, const String&, bool strict = false); |
41 static bool parseSystemColor(RGBA32& color, const String&); | 41 static bool parseSystemColor(RGBA32& color, const String&); |
42 static StyleColor colorFromRGBColorString(const String&); | 42 static StyleColor colorFromRGBColorString(const String&); |
43 | 43 |
44 private: | 44 private: |
45 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); | 45 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); |
46 static bool parseFastPath(MutableStylePropertySet*, CSSPropertyID, const Str
ing&, bool important, CSSParserMode); | 46 static bool parseFastPath(MutableStylePropertySet*, CSSPropertyID, const Str
ing&, bool important, CSSParserMode); |
47 | 47 |
48 // FIXME: We should store an OwnPtr<BisonCSSParser> and CSSParserContext her
e | 48 // FIXME: We should store an OwnPtr<BisonCSSParser> and CSSParserContext her
e |
49 // to avoid initializing the BisonCSSParser when using the new CSS parser. | 49 // to avoid initializing the BisonCSSParser when using the new CSS parser. |
50 BisonCSSParser m_bisonParser; | 50 BisonCSSParser m_bisonParser; |
51 }; | 51 }; |
52 | 52 |
53 CSSPropertyID cssPropertyID(const String&); | 53 CSSPropertyID cssPropertyID(const String&); |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
56 | 56 |
57 #endif // CSSParser_h | 57 #endif // CSSParser_h |
OLD | NEW |