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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 class UseCounter; | 71 class UseCounter; |
72 | 72 |
73 // FIXME: This class is shared with CSSTokenizer so should we rename it to CSSSo urceLocation? | 73 // FIXME: This class is shared with CSSTokenizer so should we rename it to CSSSo urceLocation? |
74 struct CSSParserLocation { | 74 struct CSSParserLocation { |
75 unsigned offset; | 75 unsigned offset; |
76 unsigned lineNumber; | 76 unsigned lineNumber; |
77 CSSParserString token; | 77 CSSParserString token; |
78 }; | 78 }; |
79 | 79 |
80 class BisonCSSParser { | 80 class BisonCSSParser { |
81 STACK_ALLOCATED(); | |
81 friend inline int cssyylex(void*, BisonCSSParser*); | 82 friend inline int cssyylex(void*, BisonCSSParser*); |
82 | |
83 public: | 83 public: |
84 BisonCSSParser(const CSSParserContext&); | 84 BisonCSSParser(const CSSParserContext&); |
haraken
2014/03/28 11:50:53
Add explicit.
wibling-chromium
2014/03/28 12:05:37
Done.
| |
85 BisonCSSParser(Document*); | |
haraken
2014/03/28 11:50:53
Add explicit.
wibling-chromium
2014/03/28 12:05:37
Done.
| |
85 ~BisonCSSParser(); | 86 ~BisonCSSParser(); |
86 | 87 |
87 void rollbackLastProperties(int num); | 88 void rollbackLastProperties(int num); |
88 void setCurrentProperty(CSSPropertyID); | 89 void setCurrentProperty(CSSPropertyID); |
89 | 90 |
90 void parseSheet(StyleSheetContents*, const String&, const TextPosition& star tPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = fals e); | 91 void parseSheet(StyleSheetContents*, const String&, const TextPosition& star tPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = fals e); |
91 PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(StyleSheetContents*, const S tring&); | 92 PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(StyleSheetContents*, const S tring&); |
92 PassRefPtrWillBeRawPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const String&); | 93 PassRefPtrWillBeRawPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const String&); |
93 bool parseSupportsCondition(const String&); | 94 bool parseSupportsCondition(const String&); |
94 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String &, bool important, CSSParserMode, StyleSheetContents*); | 95 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String &, bool important, CSSParserMode, StyleSheetContents*); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 | 220 |
220 void tokenToLowerCase(const CSSParserString& token); | 221 void tokenToLowerCase(const CSSParserString& token); |
221 | 222 |
222 void markViewportRuleBodyStart() { m_inViewport = true; } | 223 void markViewportRuleBodyStart() { m_inViewport = true; } |
223 void markViewportRuleBodyEnd() { m_inViewport = false; } | 224 void markViewportRuleBodyEnd() { m_inViewport = false; } |
224 StyleRuleBase* createViewportRule(); | 225 StyleRuleBase* createViewportRule(); |
225 | 226 |
226 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation(); } | 227 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation(); } |
227 | 228 |
228 private: | 229 private: |
230 void init(); | |
231 | |
229 class StyleDeclarationScope { | 232 class StyleDeclarationScope { |
230 WTF_MAKE_NONCOPYABLE(StyleDeclarationScope); | 233 WTF_MAKE_NONCOPYABLE(StyleDeclarationScope); |
231 public: | 234 public: |
232 StyleDeclarationScope(BisonCSSParser* parser, const StylePropertySet* de claration) | 235 StyleDeclarationScope(BisonCSSParser* parser, const StylePropertySet* de claration) |
233 : m_parser(parser) | 236 : m_parser(parser) |
234 , m_mode(declaration->cssParserMode()) | 237 , m_mode(declaration->cssParserMode()) |
235 { | 238 { |
236 if (isCSSViewportParsingEnabledForMode(m_mode)) { | 239 if (isCSSViewportParsingEnabledForMode(m_mode)) { |
237 ASSERT(!m_parser->inViewport()); | 240 ASSERT(!m_parser->inViewport()); |
238 m_parser->markViewportRuleBodyStart(); | 241 m_parser->markViewportRuleBodyStart(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 inline int cssyylex(void* yylval, BisonCSSParser* parser) | 322 inline int cssyylex(void* yylval, BisonCSSParser* parser) |
320 { | 323 { |
321 return parser->m_tokenizer.lex(yylval); | 324 return parser->m_tokenizer.lex(yylval); |
322 } | 325 } |
323 | 326 |
324 bool isValidNthToken(const CSSParserString&); | 327 bool isValidNthToken(const CSSParserString&); |
325 | 328 |
326 } // namespace WebCore | 329 } // namespace WebCore |
327 | 330 |
328 #endif // BisonCSSParser_h | 331 #endif // BisonCSSParser_h |
OLD | NEW |