| 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 11 matching lines...) Expand all  Loading... | 
| 22 class StyleColor; | 22 class StyleColor; | 
| 23 class StyleRuleBase; | 23 class StyleRuleBase; | 
| 24 class StyleRuleKeyframe; | 24 class StyleRuleKeyframe; | 
| 25 class StyleSheetContents; | 25 class StyleSheetContents; | 
| 26 | 26 | 
| 27 // This class serves as the public API for the css/parser subsystem | 27 // This class serves as the public API for the css/parser subsystem | 
| 28 class CORE_EXPORT CSSParser { | 28 class CORE_EXPORT CSSParser { | 
| 29     STATIC_ONLY(CSSParser); | 29     STATIC_ONLY(CSSParser); | 
| 30 public: | 30 public: | 
| 31     // As well as regular rules, allows @import and @namespace but not @charset | 31     // As well as regular rules, allows @import and @namespace but not @charset | 
| 32     static RawPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetCo
    ntents*, const String&); | 32     static StyleRuleBase* parseRule(const CSSParserContext&, StyleSheetContents*
    , const String&); | 
| 33     static void parseSheet(const CSSParserContext&, StyleSheetContents*, const S
    tring&); | 33     static void parseSheet(const CSSParserContext&, StyleSheetContents*, const S
    tring&); | 
| 34     static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetCont
    ents*, const String&); | 34     static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetCont
    ents*, const String&); | 
| 35     static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheet
    Contents*, const String&); | 35     static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheet
    Contents*, const String&); | 
| 36     static bool parseDeclarationList(const CSSParserContext&, MutableStyleProper
    tySet*, const String&); | 36     static bool parseDeclarationList(const CSSParserContext&, MutableStyleProper
    tySet*, const String&); | 
| 37     // Returns whether anything was changed. | 37     // Returns whether anything was changed. | 
| 38     static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
    perty, const String&, bool important, StyleSheetContents*); | 38     static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
    perty, const String&, bool important, StyleSheetContents*); | 
| 39 | 39 | 
| 40     static bool parseValueForCustomProperty(MutableStylePropertySet*, const Atom
    icString& propertyName, const String& value, bool important, StyleSheetContents*
    ); | 40     static bool parseValueForCustomProperty(MutableStylePropertySet*, const Atom
    icString& propertyName, const String& value, bool important, StyleSheetContents*
    ); | 
| 41     static RawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTok
    enRange); | 41     static ImmutableStylePropertySet* parseCustomPropertySet(CSSParserTokenRange
    ); | 
| 42 | 42 | 
| 43     // This is for non-shorthands only | 43     // This is for non-shorthands only | 
| 44     static RawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const
     CSSParserContext& = strictCSSParserContext()); | 44     static CSSValue* parseSingleValue(CSSPropertyID, const String&, const CSSPar
    serContext& = strictCSSParserContext()); | 
| 45 | 45 | 
| 46     static RawPtr<CSSValue> parseFontFaceDescriptor(CSSPropertyID, const String&
    , const CSSParserContext&); | 46     static CSSValue* parseFontFaceDescriptor(CSSPropertyID, const String&, const
     CSSParserContext&); | 
| 47 | 47 | 
| 48     static RawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const S
    tring&, Element*); | 48     static ImmutableStylePropertySet* parseInlineStyleDeclaration(const String&,
     Element*); | 
| 49 | 49 | 
| 50     static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); | 50     static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); | 
| 51     static RawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSSParserContext&, 
    const String&); | 51     static StyleRuleKeyframe* parseKeyframeRule(const CSSParserContext&, const S
    tring&); | 
| 52 | 52 | 
| 53     static bool parseSupportsCondition(const String&); | 53     static bool parseSupportsCondition(const String&); | 
| 54 | 54 | 
| 55     // The color will only be changed when string contains a valid CSS color, so
     callers | 55     // The color will only be changed when string contains a valid CSS color, so
     callers | 
| 56     // can set it to a default color and ignore the boolean result. | 56     // can set it to a default color and ignore the boolean result. | 
| 57     static bool parseColor(Color&, const String&, bool strict = false); | 57     static bool parseColor(Color&, const String&, bool strict = false); | 
| 58     static bool parseSystemColor(Color&, const String&); | 58     static bool parseSystemColor(Color&, const String&); | 
| 59 | 59 | 
| 60     static void parseSheetForInspector(const CSSParserContext&, StyleSheetConten
    ts*, const String&, CSSParserObserver&); | 60     static void parseSheetForInspector(const CSSParserContext&, StyleSheetConten
    ts*, const String&, CSSParserObserver&); | 
| 61     static void parseDeclarationListForInspector(const CSSParserContext&, const 
    String&, CSSParserObserver&); | 61     static void parseDeclarationListForInspector(const CSSParserContext&, const 
    String&, CSSParserObserver&); | 
| 62 | 62 | 
| 63 private: | 63 private: | 
| 64     static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
    perty, const String&, bool important, const CSSParserContext&); | 64     static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedPro
    perty, const String&, bool important, const CSSParserContext&); | 
| 65 }; | 65 }; | 
| 66 | 66 | 
| 67 } // namespace blink | 67 } // namespace blink | 
| 68 | 68 | 
| 69 #endif // CSSParser_h | 69 #endif // CSSParser_h | 
| OLD | NEW | 
|---|