| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void rollbackLastProperties(int num); | 76 void rollbackLastProperties(int num); |
| 77 void setCurrentProperty(CSSPropertyID); | 77 void setCurrentProperty(CSSPropertyID); |
| 78 | 78 |
| 79 void parseSheet(StyleSheetContents*, const String&, const TextPosition& star
tPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = fals
e); | 79 void parseSheet(StyleSheetContents*, const String&, const TextPosition& star
tPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = fals
e); |
| 80 PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(StyleSheetContents*, const S
tring&); | 80 PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(StyleSheetContents*, const S
tring&); |
| 81 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(StyleSheetConten
ts*, const String&); | 81 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(StyleSheetConten
ts*, const String&); |
| 82 bool parseSupportsCondition(const String&); | 82 bool parseSupportsCondition(const String&); |
| 83 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); | 83 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); |
| 84 bool parseDeclaration(MutableStylePropertySet*, const String&, CSSParserObse
rver*, StyleSheetContents* contextStyleSheet); | 84 bool parseDeclaration(MutableStylePropertySet*, const String&, CSSParserObse
rver*, StyleSheetContents* contextStyleSheet); |
| 85 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); | 85 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); |
| 86 PassOwnPtr<Vector<double> > parseKeyframeKeyList(const String&); | 86 PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); |
| 87 bool parseAttributeMatchType(CSSSelector::AttributeMatchType&, const String&
); | 87 bool parseAttributeMatchType(CSSSelector::AttributeMatchType&, const String&
); |
| 88 | 88 |
| 89 bool parseValue(CSSPropertyID, bool important); | 89 bool parseValue(CSSPropertyID, bool important); |
| 90 void parseSelector(const String&, CSSSelectorList&); | 90 void parseSelector(const String&, CSSSelectorList&); |
| 91 | 91 |
| 92 CSSParserSelector* createFloatingSelector(); | 92 CSSParserSelector* createFloatingSelector(); |
| 93 CSSParserSelector* createFloatingSelectorWithTagName(const QualifiedName&); | 93 CSSParserSelector* createFloatingSelectorWithTagName(const QualifiedName&); |
| 94 PassOwnPtr<CSSParserSelector> sinkFloatingSelector(CSSParserSelector*); | 94 PassOwnPtr<CSSParserSelector> sinkFloatingSelector(CSSParserSelector*); |
| 95 | 95 |
| 96 Vector<OwnPtr<CSSParserSelector> >* createFloatingSelectorVector(); | 96 Vector<OwnPtr<CSSParserSelector>>* createFloatingSelectorVector(); |
| 97 PassOwnPtr<Vector<OwnPtr<CSSParserSelector> > > sinkFloatingSelectorVector(V
ector<OwnPtr<CSSParserSelector> >*); | 97 PassOwnPtr<Vector<OwnPtr<CSSParserSelector>>> sinkFloatingSelectorVector(Vec
tor<OwnPtr<CSSParserSelector>>*); |
| 98 | 98 |
| 99 CSSParserValueList* createFloatingValueList(); | 99 CSSParserValueList* createFloatingValueList(); |
| 100 PassOwnPtr<CSSParserValueList> sinkFloatingValueList(CSSParserValueList*); | 100 PassOwnPtr<CSSParserValueList> sinkFloatingValueList(CSSParserValueList*); |
| 101 | 101 |
| 102 CSSParserFunction* createFloatingFunction(const CSSParserString& name, PassO
wnPtr<CSSParserValueList> args); | 102 CSSParserFunction* createFloatingFunction(const CSSParserString& name, PassO
wnPtr<CSSParserValueList> args); |
| 103 | 103 |
| 104 CSSParserValue& sinkFloatingValue(CSSParserValue&); | 104 CSSParserValue& sinkFloatingValue(CSSParserValue&); |
| 105 | 105 |
| 106 MediaQuerySet* createMediaQuerySet(); | 106 MediaQuerySet* createMediaQuerySet(); |
| 107 StyleRuleBase* createImportRule(const CSSParserString&, MediaQuerySet*); | 107 StyleRuleBase* createImportRule(const CSSParserString&, MediaQuerySet*); |
| 108 StyleRuleKeyframe* createKeyframe(CSSParserValueList*); | 108 StyleRuleKeyframe* createKeyframe(CSSParserValueList*); |
| 109 StyleRuleKeyframes* createKeyframesRule(const String&, PassOwnPtrWillBeRawPt
r<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe> > >, bool isPrefixed); | 109 StyleRuleKeyframes* createKeyframesRule(const String&, PassOwnPtrWillBeRawPt
r<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>>, bool isPrefixed); |
| 110 | 110 |
| 111 typedef WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> > RuleList; | 111 typedef WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> RuleList; |
| 112 StyleRuleBase* createMediaRule(MediaQuerySet*, RuleList*); | 112 StyleRuleBase* createMediaRule(MediaQuerySet*, RuleList*); |
| 113 RuleList* createRuleList(); | 113 RuleList* createRuleList(); |
| 114 RuleList* appendRule(RuleList*, StyleRuleBase*); | 114 RuleList* appendRule(RuleList*, StyleRuleBase*); |
| 115 StyleRuleBase* createStyleRule(Vector<OwnPtr<CSSParserSelector> >* selectors
); | 115 StyleRuleBase* createStyleRule(Vector<OwnPtr<CSSParserSelector>>* selectors)
; |
| 116 StyleRuleBase* createFontFaceRule(); | 116 StyleRuleBase* createFontFaceRule(); |
| 117 StyleRuleBase* createPageRule(PassOwnPtr<CSSParserSelector> pageSelector); | 117 StyleRuleBase* createPageRule(PassOwnPtr<CSSParserSelector> pageSelector); |
| 118 StyleRuleBase* createMarginAtRule(CSSSelector::MarginBoxType); | 118 StyleRuleBase* createMarginAtRule(CSSSelector::MarginBoxType); |
| 119 StyleRuleBase* createSupportsRule(bool conditionIsSupported, RuleList*); | 119 StyleRuleBase* createSupportsRule(bool conditionIsSupported, RuleList*); |
| 120 void markSupportsRuleHeaderStart(); | 120 void markSupportsRuleHeaderStart(); |
| 121 void markSupportsRuleHeaderEnd(); | 121 void markSupportsRuleHeaderEnd(); |
| 122 PassRefPtrWillBeRawPtr<CSSRuleSourceData> popSupportsRuleData(); | 122 PassRefPtrWillBeRawPtr<CSSRuleSourceData> popSupportsRuleData(); |
| 123 StyleRuleBase* createHostRule(RuleList* rules); | 123 StyleRuleBase* createHostRule(RuleList* rules); |
| 124 | 124 |
| 125 void startDeclarationsForMarginBox(); | 125 void startDeclarationsForMarginBox(); |
| 126 void endDeclarationsForMarginBox(); | 126 void endDeclarationsForMarginBox(); |
| 127 | 127 |
| 128 void startMediaValue(); | 128 void startMediaValue(); |
| 129 void endMediaValue(); | 129 void endMediaValue(); |
| 130 void startMediaQuery(); | 130 void startMediaQuery(); |
| 131 MediaQueryExp* createFloatingMediaQueryExp(const AtomicString&, CSSParserVal
ueList*); | 131 MediaQueryExp* createFloatingMediaQueryExp(const AtomicString&, CSSParserVal
ueList*); |
| 132 PassOwnPtrWillBeRawPtr<MediaQueryExp> sinkFloatingMediaQueryExp(MediaQueryEx
p*); | 132 PassOwnPtrWillBeRawPtr<MediaQueryExp> sinkFloatingMediaQueryExp(MediaQueryEx
p*); |
| 133 WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> >* createFloatingMediaQue
ryExpList(); | 133 WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>* createFloatingMediaQuer
yExpList(); |
| 134 PassOwnPtrWillBeRawPtr<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> >
> sinkFloatingMediaQueryExpList(WillBeHeapVector<OwnPtrWillBeMember<MediaQueryEx
p> >*); | 134 PassOwnPtrWillBeRawPtr<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>>
sinkFloatingMediaQueryExpList(WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>
>*); |
| 135 MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const AtomicStr
ing&, PassOwnPtrWillBeRawPtr<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>
> >); | 135 MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const AtomicStr
ing&, PassOwnPtrWillBeRawPtr<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>
>); |
| 136 MediaQuery* createFloatingMediaQuery(PassOwnPtrWillBeRawPtr<WillBeHeapVector
<OwnPtrWillBeMember<MediaQueryExp> > >); | 136 MediaQuery* createFloatingMediaQuery(PassOwnPtrWillBeRawPtr<WillBeHeapVector
<OwnPtrWillBeMember<MediaQueryExp>>>); |
| 137 MediaQuery* createFloatingNotAllQuery(); | 137 MediaQuery* createFloatingNotAllQuery(); |
| 138 PassOwnPtrWillBeRawPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*); | 138 PassOwnPtrWillBeRawPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*); |
| 139 | 139 |
| 140 WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe> >* createFloatingKeyf
rameVector(); | 140 WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>* createFloatingKeyfr
ameVector(); |
| 141 PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe
> > > sinkFloatingKeyframeVector(WillBeHeapVector<RefPtrWillBeMember<StyleRuleKe
yframe> >*); | 141 PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe
>>> sinkFloatingKeyframeVector(WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyf
rame>>*); |
| 142 | 142 |
| 143 void addNamespace(const AtomicString& prefix, const AtomicString& uri); | 143 void addNamespace(const AtomicString& prefix, const AtomicString& uri); |
| 144 QualifiedName determineNameInNamespace(const AtomicString& prefix, const Ato
micString& localName); | 144 QualifiedName determineNameInNamespace(const AtomicString& prefix, const Ato
micString& localName); |
| 145 | 145 |
| 146 CSSParserSelector* rewriteSpecifiersWithElementName(const AtomicString& name
spacePrefix, const AtomicString& elementName, CSSParserSelector*, bool isNamespa
cePlaceholder = false); | 146 CSSParserSelector* rewriteSpecifiersWithElementName(const AtomicString& name
spacePrefix, const AtomicString& elementName, CSSParserSelector*, bool isNamespa
cePlaceholder = false); |
| 147 CSSParserSelector* rewriteSpecifiersWithElementNameForCustomPseudoElement(co
nst QualifiedName& tag, const AtomicString& elementName, CSSParserSelector* spec
ifiers, bool tagIsForNamespaceRule); | 147 CSSParserSelector* rewriteSpecifiersWithElementNameForCustomPseudoElement(co
nst QualifiedName& tag, const AtomicString& elementName, CSSParserSelector* spec
ifiers, bool tagIsForNamespaceRule); |
| 148 CSSParserSelector* rewriteSpecifiersWithElementNameForContentPseudoElement(c
onst QualifiedName& tag, const AtomicString& elementName, CSSParserSelector* spe
cifiers, bool tagIsForNamespaceRule); | 148 CSSParserSelector* rewriteSpecifiersWithElementNameForContentPseudoElement(c
onst QualifiedName& tag, const AtomicString& elementName, CSSParserSelector* spe
cifiers, bool tagIsForNamespaceRule); |
| 149 CSSParserSelector* rewriteSpecifiersWithNamespaceIfNeeded(CSSParserSelector*
); | 149 CSSParserSelector* rewriteSpecifiersWithNamespaceIfNeeded(CSSParserSelector*
); |
| 150 CSSParserSelector* rewriteSpecifiers(CSSParserSelector*, CSSParserSelector*)
; | 150 CSSParserSelector* rewriteSpecifiers(CSSParserSelector*, CSSParserSelector*)
; |
| 151 CSSParserSelector* rewriteSpecifiersForShadowDistributed(CSSParserSelector*
specifiers, CSSParserSelector* distributedPseudoElementSelector); | 151 CSSParserSelector* rewriteSpecifiersForShadowDistributed(CSSParserSelector*
specifiers, CSSParserSelector* distributedPseudoElementSelector); |
| 152 | 152 |
| 153 void invalidBlockHit(); | 153 void invalidBlockHit(); |
| 154 | 154 |
| 155 Vector<OwnPtr<CSSParserSelector> >* reusableSelectorVector() { return &m_reu
sableSelectorVector; } | 155 Vector<OwnPtr<CSSParserSelector>>* reusableSelectorVector() { return &m_reus
ableSelectorVector; } |
| 156 | 156 |
| 157 void clearProperties(); | 157 void clearProperties(); |
| 158 | 158 |
| 159 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> createStylePropertySet(); | 159 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> createStylePropertySet(); |
| 160 | 160 |
| 161 CSSParserContext m_context; | 161 CSSParserContext m_context; |
| 162 | 162 |
| 163 bool m_important; | 163 bool m_important; |
| 164 CSSPropertyID m_id; | 164 CSSPropertyID m_id; |
| 165 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; | 165 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void setupParser(const char* prefix, unsigned prefixLength, const String&, c
onst char* suffix, unsigned suffixLength); | 249 void setupParser(const char* prefix, unsigned prefixLength, const String&, c
onst char* suffix, unsigned suffixLength); |
| 250 | 250 |
| 251 bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool
important); | 251 bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool
important); |
| 252 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseDeclaration(const Str
ing&, StyleSheetContents* contextStyleSheet); | 252 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseDeclaration(const Str
ing&, StyleSheetContents* contextStyleSheet); |
| 253 | 253 |
| 254 const String* m_source; | 254 const String* m_source; |
| 255 TextPosition m_startPosition; | 255 TextPosition m_startPosition; |
| 256 StyleRule::Type m_ruleHeaderType; | 256 StyleRule::Type m_ruleHeaderType; |
| 257 unsigned m_ruleHeaderStartOffset; | 257 unsigned m_ruleHeaderStartOffset; |
| 258 int m_ruleHeaderStartLineNumber; | 258 int m_ruleHeaderStartLineNumber; |
| 259 OwnPtr<Vector<unsigned> > m_lineEndings; | 259 OwnPtr<Vector<unsigned>> m_lineEndings; |
| 260 | 260 |
| 261 bool m_ruleHasHeader; | 261 bool m_ruleHasHeader; |
| 262 | 262 |
| 263 bool m_allowImportRules; | 263 bool m_allowImportRules; |
| 264 bool m_allowNamespaceDeclarations; | 264 bool m_allowNamespaceDeclarations; |
| 265 | 265 |
| 266 bool m_inViewport; | 266 bool m_inViewport; |
| 267 | 267 |
| 268 CSSParserLocation m_locationLabel; | 268 CSSParserLocation m_locationLabel; |
| 269 | 269 |
| 270 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> > m_parsedRules; | 270 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_parsedRules; |
| 271 WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe> > m_parsedKeyframes; | 271 WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>> m_parsedKeyframes; |
| 272 WillBeHeapVector<RefPtrWillBeMember<MediaQuerySet> > m_parsedMediaQuerySets; | 272 WillBeHeapVector<RefPtrWillBeMember<MediaQuerySet>> m_parsedMediaQuerySets; |
| 273 WillBeHeapVector<OwnPtrWillBeMember<RuleList> > m_parsedRuleLists; | 273 WillBeHeapVector<OwnPtrWillBeMember<RuleList>> m_parsedRuleLists; |
| 274 Vector<CSSParserSelector*> m_floatingSelectors; | 274 Vector<CSSParserSelector*> m_floatingSelectors; |
| 275 Vector<Vector<OwnPtr<CSSParserSelector> >*> m_floatingSelectorVectors; | 275 Vector<Vector<OwnPtr<CSSParserSelector>>*> m_floatingSelectorVectors; |
| 276 Vector<CSSParserValueList*> m_floatingValueLists; | 276 Vector<CSSParserValueList*> m_floatingValueLists; |
| 277 Vector<CSSParserFunction*> m_floatingFunctions; | 277 Vector<CSSParserFunction*> m_floatingFunctions; |
| 278 | 278 |
| 279 unsigned m_mediaQueryValueStartOffset; | 279 unsigned m_mediaQueryValueStartOffset; |
| 280 unsigned m_mediaQueryValueEndOffset; | 280 unsigned m_mediaQueryValueEndOffset; |
| 281 OwnPtrWillBeMember<MediaQuery> m_floatingMediaQuery; | 281 OwnPtrWillBeMember<MediaQuery> m_floatingMediaQuery; |
| 282 OwnPtrWillBeMember<MediaQueryExp> m_floatingMediaQueryExp; | 282 OwnPtrWillBeMember<MediaQueryExp> m_floatingMediaQueryExp; |
| 283 OwnPtrWillBeMember<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> > > m_
floatingMediaQueryExpList; | 283 OwnPtrWillBeMember<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>> m_fl
oatingMediaQueryExpList; |
| 284 | 284 |
| 285 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe> >
> m_floatingKeyframeVector; | 285 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>>
m_floatingKeyframeVector; |
| 286 | 286 |
| 287 Vector<OwnPtr<CSSParserSelector> > m_reusableSelectorVector; | 287 Vector<OwnPtr<CSSParserSelector>> m_reusableSelectorVector; |
| 288 | 288 |
| 289 OwnPtrWillBeMember<RuleSourceDataList> m_supportsRuleDataStack; | 289 OwnPtrWillBeMember<RuleSourceDataList> m_supportsRuleDataStack; |
| 290 | 290 |
| 291 BisonCSSTokenizer m_tokenizer; | 291 BisonCSSTokenizer m_tokenizer; |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 inline int cssyylex(void* yylval, BisonCSSParser* parser) | 294 inline int cssyylex(void* yylval, BisonCSSParser* parser) |
| 295 { | 295 { |
| 296 return parser->m_tokenizer.lex(yylval); | 296 return parser->m_tokenizer.lex(yylval); |
| 297 } | 297 } |
| 298 | 298 |
| 299 bool isValidNthToken(const CSSParserString&); | 299 bool isValidNthToken(const CSSParserString&); |
| 300 | 300 |
| 301 } // namespace blink | 301 } // namespace blink |
| 302 | 302 |
| 303 #endif // BisonCSSParser_h | 303 #endif // BisonCSSParser_h |
| OLD | NEW |