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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 class AnimationParseContext; | 46 class AnimationParseContext; |
47 class CSSBorderImageSliceValue; | 47 class CSSBorderImageSliceValue; |
48 class CSSPrimitiveValue; | 48 class CSSPrimitiveValue; |
49 class CSSSelectorList; | 49 class CSSSelectorList; |
50 class CSSValue; | 50 class CSSValue; |
51 class CSSValueList; | 51 class CSSValueList; |
52 class CSSBasicShape; | 52 class CSSBasicShape; |
53 class Document; | 53 class Document; |
54 class Element; | 54 class Element; |
| 55 class ImmutableStylePropertySet; |
55 class MediaQueryExp; | 56 class MediaQueryExp; |
56 class MediaQuerySet; | 57 class MediaQuerySet; |
57 class StyleKeyframe; | 58 class StyleKeyframe; |
58 class StylePropertySet; | 59 class StylePropertySet; |
59 class StylePropertyShorthand; | 60 class StylePropertyShorthand; |
60 class StyleRuleBase; | 61 class StyleRuleBase; |
61 class StyleRuleKeyframes; | 62 class StyleRuleKeyframes; |
62 class StyleKeyframe; | 63 class StyleKeyframe; |
63 class StyleSheetContents; | 64 class StyleSheetContents; |
64 class StyledElement; | 65 class StyledElement; |
(...skipping 26 matching lines...) Expand all Loading... |
91 void parseSheet(StyleSheetContents*, const String&, int startLineNumber = 0,
SourceDataHandler* = 0, bool = false); | 92 void parseSheet(StyleSheetContents*, const String&, int startLineNumber = 0,
SourceDataHandler* = 0, bool = false); |
92 PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&); | 93 PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&); |
93 PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const Strin
g&); | 94 PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const Strin
g&); |
94 bool parseSupportsCondition(const String&); | 95 bool parseSupportsCondition(const String&); |
95 static bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool
important, CSSParserMode, StyleSheetContents*); | 96 static bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool
important, CSSParserMode, StyleSheetContents*); |
96 static bool parseColor(RGBA32& color, const String&, bool strict = false); | 97 static bool parseColor(RGBA32& color, const String&, bool strict = false); |
97 static bool parseSystemColor(RGBA32& color, const String&, Document*); | 98 static bool parseSystemColor(RGBA32& color, const String&, Document*); |
98 static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&); | 99 static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&); |
99 PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*
); | 100 PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*
); |
100 bool parseDeclaration(StylePropertySet*, const String&, SourceDataHandler*,
StyleSheetContents* contextStyleSheet); | 101 bool parseDeclaration(StylePropertySet*, const String&, SourceDataHandler*,
StyleSheetContents* contextStyleSheet); |
101 static PassRefPtr<StylePropertySet> parseInlineStyleDeclaration(const String
&, Element*); | 102 static PassRefPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(con
st String&, Element*); |
102 PassOwnPtr<MediaQuery> parseMediaQuery(const String&); | 103 PassOwnPtr<MediaQuery> parseMediaQuery(const String&); |
103 | 104 |
104 void addPropertyWithPrefixingVariant(CSSPropertyID, PassRefPtr<CSSValue>, bo
ol important, bool implicit = false); | 105 void addPropertyWithPrefixingVariant(CSSPropertyID, PassRefPtr<CSSValue>, bo
ol important, bool implicit = false); |
105 void addProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool i
mplicit = false); | 106 void addProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool i
mplicit = false); |
106 void rollbackLastProperties(int num); | 107 void rollbackLastProperties(int num); |
107 bool hasProperties() const { return !m_parsedProperties.isEmpty(); } | 108 bool hasProperties() const { return !m_parsedProperties.isEmpty(); } |
108 void addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtr<CSSValue>,
bool); | 109 void addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtr<CSSValue>,
bool); |
109 void setCurrentProperty(CSSPropertyID); | 110 void setCurrentProperty(CSSPropertyID); |
110 | 111 |
111 bool parseValue(CSSPropertyID, bool important); | 112 bool parseValue(CSSPropertyID, bool important); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 Vector<OwnPtr<CSSParserSelector> >* reusableSelectorVector() { return &m_reu
sableSelectorVector; } | 338 Vector<OwnPtr<CSSParserSelector> >* reusableSelectorVector() { return &m_reu
sableSelectorVector; } |
338 | 339 |
339 void setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector> >* sel
ectors); | 340 void setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector> >* sel
ectors); |
340 Vector<OwnPtr<CSSParserSelector> >* reusableRegionSelectorVector() { return
&m_reusableRegionSelectorVector; } | 341 Vector<OwnPtr<CSSParserSelector> >* reusableRegionSelectorVector() { return
&m_reusableRegionSelectorVector; } |
341 | 342 |
342 void updateLastSelectorLineAndPosition(); | 343 void updateLastSelectorLineAndPosition(); |
343 void updateLastMediaLine(MediaQuerySet*); | 344 void updateLastMediaLine(MediaQuerySet*); |
344 | 345 |
345 void clearProperties(); | 346 void clearProperties(); |
346 | 347 |
347 PassRefPtr<StylePropertySet> createStylePropertySet(); | 348 PassRefPtr<ImmutableStylePropertySet> createStylePropertySet(); |
348 | 349 |
349 CSSParserContext m_context; | 350 CSSParserContext m_context; |
350 | 351 |
351 bool m_important; | 352 bool m_important; |
352 CSSPropertyID m_id; | 353 CSSPropertyID m_id; |
353 StyleSheetContents* m_styleSheet; | 354 StyleSheetContents* m_styleSheet; |
354 RefPtr<StyleRuleBase> m_rule; | 355 RefPtr<StyleRuleBase> m_rule; |
355 RefPtr<StyleKeyframe> m_keyframe; | 356 RefPtr<StyleKeyframe> m_keyframe; |
356 OwnPtr<MediaQuery> m_mediaQuery; | 357 OwnPtr<MediaQuery> m_mediaQuery; |
357 OwnPtr<CSSParserValueList> m_valueList; | 358 OwnPtr<CSSParserValueList> m_valueList; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 bool inShorthand() const { return m_inParseShorthand; } | 525 bool inShorthand() const { return m_inParseShorthand; } |
525 | 526 |
526 bool validWidthOrHeight(CSSParserValue*); | 527 bool validWidthOrHeight(CSSParserValue*); |
527 | 528 |
528 void deleteFontFaceOnlyValues(); | 529 void deleteFontFaceOnlyValues(); |
529 | 530 |
530 bool isGeneratedImageValue(CSSParserValue*) const; | 531 bool isGeneratedImageValue(CSSParserValue*) const; |
531 bool parseGeneratedImage(CSSParserValueList*, RefPtr<CSSValue>&); | 532 bool parseGeneratedImage(CSSParserValueList*, RefPtr<CSSValue>&); |
532 | 533 |
533 bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool import
ant, StyleSheetContents* contextStyleSheet); | 534 bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool import
ant, StyleSheetContents* contextStyleSheet); |
534 PassRefPtr<StylePropertySet> parseDeclaration(const String&, StyleSheetConte
nts* contextStyleSheet); | 535 PassRefPtr<ImmutableStylePropertySet> parseDeclaration(const String&, StyleS
heetContents* contextStyleSheet); |
535 | 536 |
536 enum SizeParameterType { | 537 enum SizeParameterType { |
537 None, | 538 None, |
538 Auto, | 539 Auto, |
539 Length, | 540 Length, |
540 PageSize, | 541 PageSize, |
541 Orientation, | 542 Orientation, |
542 }; | 543 }; |
543 | 544 |
544 bool parsePage(CSSPropertyID propId, bool important); | 545 bool parsePage(CSSPropertyID propId, bool important); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 } | 737 } |
737 | 738 |
738 inline int cssyylex(void* yylval, CSSParser* parser) | 739 inline int cssyylex(void* yylval, CSSParser* parser) |
739 { | 740 { |
740 return parser->lex(yylval); | 741 return parser->lex(yylval); |
741 } | 742 } |
742 | 743 |
743 } // namespace WebCore | 744 } // namespace WebCore |
744 | 745 |
745 #endif // CSSParser_h | 746 #endif // CSSParser_h |
OLD | NEW |