| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. | 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 class BisonCSSParser { | 79 class BisonCSSParser { |
| 80 STACK_ALLOCATED(); | 80 STACK_ALLOCATED(); |
| 81 friend inline int cssyylex(void*, BisonCSSParser*); | 81 friend inline int cssyylex(void*, BisonCSSParser*); |
| 82 public: | 82 public: |
| 83 explicit BisonCSSParser(const CSSParserContext&); | 83 explicit BisonCSSParser(const CSSParserContext&); |
| 84 ~BisonCSSParser(); | 84 ~BisonCSSParser(); |
| 85 | 85 |
| 86 void rollbackLastProperties(int num); | 86 void rollbackLastProperties(int num); |
| 87 void setCurrentProperty(CSSPropertyID); | 87 void setCurrentProperty(CSSPropertyID); |
| 88 | 88 |
| 89 void parseSheet(StyleSheetContents*, const String&, const TextPosition& star
tPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = fals
e); | 89 void parseSheet(StyleSheetContents*, const String&); |
| 90 PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&); | 90 PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&); |
| 91 PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const Strin
g&); | 91 PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const Strin
g&); |
| 92 bool parseSupportsCondition(const String&); | 92 bool parseSupportsCondition(const String&); |
| 93 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, CSSParserMode, StyleSheetContents*); | 93 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, CSSParserMode, StyleSheetContents*); |
| 94 static bool parseColor(RGBA32& color, const String&, bool strict = false); | 94 static bool parseColor(RGBA32& color, const String&, bool strict = false); |
| 95 static StyleColor colorFromRGBColorString(const String&); | 95 static StyleColor colorFromRGBColorString(const String&); |
| 96 static bool parseSystemColor(RGBA32& color, const String&); | 96 static bool parseSystemColor(RGBA32& color, const String&); |
| 97 static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&); | 97 static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&); |
| 98 static PassRefPtr<CSSValue> parseAnimationTimingFunctionValue(const String&)
; | 98 static PassRefPtr<CSSValue> parseAnimationTimingFunctionValue(const String&)
; |
| 99 bool parseDeclaration(MutableStylePropertySet*, const String&, CSSParserObse
rver*, StyleSheetContents* contextStyleSheet); | 99 bool parseDeclaration(MutableStylePropertySet*, const String&, CSSParserObse
rver*, StyleSheetContents* contextStyleSheet); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 RefPtr<MediaQuerySet> m_mediaList; | 177 RefPtr<MediaQuerySet> m_mediaList; |
| 178 OwnPtr<CSSParserValueList> m_valueList; | 178 OwnPtr<CSSParserValueList> m_valueList; |
| 179 bool m_supportsCondition; | 179 bool m_supportsCondition; |
| 180 | 180 |
| 181 Vector<CSSProperty, 256> m_parsedProperties; | 181 Vector<CSSProperty, 256> m_parsedProperties; |
| 182 CSSSelectorList* m_selectorListForParseSelector; | 182 CSSSelectorList* m_selectorListForParseSelector; |
| 183 | 183 |
| 184 unsigned m_numParsedPropertiesBeforeMarginBox; | 184 unsigned m_numParsedPropertiesBeforeMarginBox; |
| 185 | 185 |
| 186 bool m_hadSyntacticallyValidCSSRule; | 186 bool m_hadSyntacticallyValidCSSRule; |
| 187 bool m_logErrors; | |
| 188 bool m_ignoreErrors; | 187 bool m_ignoreErrors; |
| 189 | 188 |
| 190 AtomicString m_defaultNamespace; | 189 AtomicString m_defaultNamespace; |
| 191 | 190 |
| 192 // tokenizer methods and data | 191 // tokenizer methods and data |
| 193 CSSParserObserver* m_observer; | 192 CSSParserObserver* m_observer; |
| 194 | 193 |
| 195 // Local functions which just call into CSSParserObserver if non-null. | 194 // Local functions which just call into CSSParserObserver if non-null. |
| 196 void startRule(); | 195 void startRule(); |
| 197 void endRule(bool valid); | 196 void endRule(bool valid); |
| 198 void startRuleHeader(CSSRuleSourceData::Type); | 197 void startRuleHeader(CSSRuleSourceData::Type); |
| 199 void endRuleHeader(); | 198 void endRuleHeader(); |
| 200 void startSelector(); | 199 void startSelector(); |
| 201 void endSelector(); | 200 void endSelector(); |
| 202 void startRuleBody(); | 201 void startRuleBody(); |
| 203 void startProperty(); | 202 void startProperty(); |
| 204 void endProperty(bool isImportantFound, bool isPropertyParsed, CSSParserErro
r = NoCSSError); | 203 void endProperty(bool isImportantFound, bool isPropertyParsed, CSSParserErro
r = NoCSSError); |
| 205 void startEndUnknownRule(); | 204 void startEndUnknownRule(); |
| 206 | 205 |
| 207 void endInvalidRuleHeader(); | 206 void endInvalidRuleHeader(); |
| 208 void reportError(const CSSParserLocation&, CSSParserError = GeneralCSSError)
; | 207 void reportError(const CSSParserLocation&, CSSParserError = GeneralCSSError)
{ } |
| 209 void resumeErrorLogging() { m_ignoreErrors = false; } | |
| 210 void setLocationLabel(const CSSParserLocation& location) { m_locationLabel =
location; } | 208 void setLocationLabel(const CSSParserLocation& location) { m_locationLabel =
location; } |
| 211 const CSSParserLocation& lastLocationLabel() const { return m_locationLabel;
} | 209 const CSSParserLocation& lastLocationLabel() const { return m_locationLabel;
} |
| 212 | 210 |
| 213 void tokenToLowerCase(CSSParserString& token); | 211 void tokenToLowerCase(CSSParserString& token); |
| 214 | 212 |
| 215 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation();
} | 213 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation();
} |
| 216 | 214 |
| 217 private: | 215 private: |
| 218 inline void ensureLineEndings(); | 216 inline void ensureLineEndings(); |
| 219 | 217 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 OwnPtr<MediaQuery> m_floatingMediaQuery; | 261 OwnPtr<MediaQuery> m_floatingMediaQuery; |
| 264 OwnPtr<MediaQueryExp> m_floatingMediaQueryExp; | 262 OwnPtr<MediaQueryExp> m_floatingMediaQueryExp; |
| 265 OwnPtr<Vector<OwnPtr<MediaQueryExp> > > m_floatingMediaQueryExpList; | 263 OwnPtr<Vector<OwnPtr<MediaQueryExp> > > m_floatingMediaQueryExpList; |
| 266 | 264 |
| 267 OwnPtr<Vector<RefPtr<StyleKeyframe> > > m_floatingKeyframeVector; | 265 OwnPtr<Vector<RefPtr<StyleKeyframe> > > m_floatingKeyframeVector; |
| 268 | 266 |
| 269 Vector<OwnPtr<CSSParserSelector> > m_reusableSelectorVector; | 267 Vector<OwnPtr<CSSParserSelector> > m_reusableSelectorVector; |
| 270 | 268 |
| 271 OwnPtr<RuleSourceDataList> m_supportsRuleDataStack; | 269 OwnPtr<RuleSourceDataList> m_supportsRuleDataStack; |
| 272 | 270 |
| 273 bool isLoggingErrors(); | |
| 274 void logError(const String& message, const CSSParserLocation&); | |
| 275 | |
| 276 CSSTokenizer m_tokenizer; | 271 CSSTokenizer m_tokenizer; |
| 277 | 272 |
| 278 friend class TransformOperationInfo; | 273 friend class TransformOperationInfo; |
| 279 friend class FilterOperationInfo; | 274 friend class FilterOperationInfo; |
| 280 }; | 275 }; |
| 281 | 276 |
| 282 inline int cssyylex(void* yylval, BisonCSSParser* parser) | 277 inline int cssyylex(void* yylval, BisonCSSParser* parser) |
| 283 { | 278 { |
| 284 return parser->m_tokenizer.lex(yylval); | 279 return parser->m_tokenizer.lex(yylval); |
| 285 } | 280 } |
| 286 | 281 |
| 287 bool isValidNthToken(const CSSParserString&); | 282 bool isValidNthToken(const CSSParserString&); |
| 288 | 283 |
| 289 } // namespace blink | 284 } // namespace blink |
| 290 | 285 |
| 291 #endif // SKY_ENGINE_CORE_CSS_PARSER_BISONCSSPARSER_H_ | 286 #endif // SKY_ENGINE_CORE_CSS_PARSER_BISONCSSPARSER_H_ |
| OLD | NEW |