| 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/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/css/CSSValue.h" | 10 #include "core/css/CSSValue.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetCont
ents*, const String&); | 35 static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetCont
ents*, const String&); |
| 36 static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheet
Contents*, const String&); | 36 static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheet
Contents*, const String&); |
| 37 static bool parseDeclarationList(const CSSParserContext&, MutableStyleProper
tySet*, const String&); | 37 static bool parseDeclarationList(const CSSParserContext&, MutableStyleProper
tySet*, const String&); |
| 38 // Returns whether anything was changed. | 38 // Returns whether anything was changed. |
| 39 static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
perty, const String&, bool important, StyleSheetContents*); | 39 static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
perty, const String&, bool important, StyleSheetContents*); |
| 40 | 40 |
| 41 static bool parseValueForCustomProperty(MutableStylePropertySet*, const Atom
icString& propertyName, const String& value, bool important, StyleSheetContents*
); | 41 static bool parseValueForCustomProperty(MutableStylePropertySet*, const Atom
icString& propertyName, const String& value, bool important, StyleSheetContents*
); |
| 42 static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange
); | 42 static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange
); |
| 43 | 43 |
| 44 // This is for non-shorthands only | 44 // This is for non-shorthands only |
| 45 static CSSValue* parseSingleValue(CSSPropertyID, const String&, const CSSPar
serContext& = strictCSSParserContext()); | 45 static const CSSValue* parseSingleValue(CSSPropertyID, const String&, const
CSSParserContext& = strictCSSParserContext()); |
| 46 | 46 |
| 47 static const CSSValue* parseFontFaceDescriptor(CSSPropertyID, const String&,
const CSSParserContext&); | 47 static const CSSValue* parseFontFaceDescriptor(CSSPropertyID, const String&,
const CSSParserContext&); |
| 48 | 48 |
| 49 static ImmutableStylePropertySet* parseInlineStyleDeclaration(const String&,
Element*); | 49 static ImmutableStylePropertySet* parseInlineStyleDeclaration(const String&,
Element*); |
| 50 | 50 |
| 51 static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&); | 51 static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&); |
| 52 static StyleRuleKeyframe* parseKeyframeRule(const CSSParserContext&, const S
tring&); | 52 static StyleRuleKeyframe* parseKeyframeRule(const CSSParserContext&, const S
tring&); |
| 53 | 53 |
| 54 static bool parseSupportsCondition(const String&); | 54 static bool parseSupportsCondition(const String&); |
| 55 | 55 |
| 56 // The color will only be changed when string contains a valid CSS color, so
callers | 56 // The color will only be changed when string contains a valid CSS color, so
callers |
| 57 // can set it to a default color and ignore the boolean result. | 57 // can set it to a default color and ignore the boolean result. |
| 58 static bool parseColor(Color&, const String&, bool strict = false); | 58 static bool parseColor(Color&, const String&, bool strict = false); |
| 59 static bool parseSystemColor(Color&, const String&); | 59 static bool parseSystemColor(Color&, const String&); |
| 60 | 60 |
| 61 static void parseSheetForInspector(const CSSParserContext&, StyleSheetConten
ts*, const String&, CSSParserObserver&); | 61 static void parseSheetForInspector(const CSSParserContext&, StyleSheetConten
ts*, const String&, CSSParserObserver&); |
| 62 static void parseDeclarationListForInspector(const CSSParserContext&, const
String&, CSSParserObserver&); | 62 static void parseDeclarationListForInspector(const CSSParserContext&, const
String&, CSSParserObserver&); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
perty, const String&, bool important, const CSSParserContext&); | 65 static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
perty, const String&, bool important, const CSSParserContext&); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| 69 | 69 |
| 70 #endif // CSSParser_h | 70 #endif // CSSParser_h |
| OLD | NEW |