summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/CSSParser.h')
-rw-r--r--Source/WebCore/css/CSSParser.h69
1 files changed, 50 insertions, 19 deletions
diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h
index adc19025a..b7384eee9 100644
--- a/Source/WebCore/css/CSSParser.h
+++ b/Source/WebCore/css/CSSParser.h
@@ -23,6 +23,7 @@
#ifndef CSSParser_h
#define CSSParser_h
+#include "CSSCalculationValue.h"
#include "CSSGradientValue.h"
#include "CSSParserValues.h"
#include "CSSPropertySourceData.h"
@@ -173,7 +174,7 @@ public:
// CSS3 Parsing Routines (for properties specific to CSS3)
PassRefPtr<CSSValueList> parseShadow(CSSParserValueList*, int propId);
- bool parseBorderImage(int propId, RefPtr<CSSValue>&);
+ bool parseBorderImage(int propId, RefPtr<CSSValue>&, bool important = false);
bool parseBorderImageRepeat(RefPtr<CSSValue>&);
bool parseBorderImageSlice(int propId, RefPtr<CSSBorderImageSliceValue>&);
bool parseBorderImageWidth(RefPtr<CSSPrimitiveValue>&);
@@ -211,6 +212,7 @@ public:
bool parseTextEmphasisStyle(bool important);
bool parseLineBoxContain(bool important);
+ bool parseCalculation(CSSParserValue*);
bool parseFontFeatureTag(CSSValueList*);
bool parseFontFeatureSettings(bool important);
@@ -218,6 +220,8 @@ public:
bool parseFlowThread(int propId, bool important);
bool parseRegionThread(int propId, bool important);
+ bool parseFontVariantLigatures(bool important);
+
int yyparse();
CSSParserSelector* createFloatingSelector();
@@ -315,12 +319,29 @@ public:
void resetRuleBodyMarks() { m_ruleBodyRange.start = m_ruleBodyRange.end = 0; }
void resetPropertyMarks() { m_propertyRange.start = m_propertyRange.end = UINT_MAX; }
int lex(void* yylval);
- int token() { return yyTok; }
- UChar* text(int* length);
- void countLines();
- int lex();
+ int token() { return m_token; }
+ PassRefPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*);
+ PassRefPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSParserValue*);
+
private:
+ inline bool isIdentifierStart();
+
+ static inline UChar* checkAndSkipString(UChar*, UChar);
+
+ void parseEscape(UChar*&);
+ inline void parseIdentifier(UChar*&, bool&);
+ inline void parseString(UChar*&, UChar);
+ inline void parseURI(UChar*&, UChar*&);
+ inline bool parseUnicodeRange();
+ bool parseNthChild();
+ bool parseNthChildExtra();
+ inline void detectFunctionTypeToken(int);
+ inline void detectMediaQueryToken(int);
+ inline void detectNumberToken(UChar*, int);
+ inline void detectDashToken(int);
+ inline void detectAtToken(int, bool);
+
void setStyleSheet(CSSStyleSheet*);
void ensureCSSValuePool();
@@ -356,15 +377,17 @@ private:
bool parseColor(const String&);
- OwnArrayPtr<UChar> m_data;
- UChar* yytext;
- UChar* yy_c_buf_p;
- UChar yy_hold_char;
- int yy_last_accepting_state;
- UChar* yy_last_accepting_cpos;
- int yyleng;
- int yyTok;
- int yy_start;
+ enum ParsingMode {
+ NormalMode,
+ MediaQueryMode,
+ NthChildMode
+ };
+
+ ParsingMode m_parsingMode;
+ OwnArrayPtr<UChar> m_dataStart;
+ UChar* m_currentCharacter;
+ UChar* m_tokenStart;
+ int m_token;
int m_lineNumber;
int m_lastSelectorLineNumber;
@@ -386,6 +409,8 @@ private:
Vector<OwnPtr<CSSParserSelector> > m_reusableSelectorVector;
Vector<OwnPtr<CSSParserSelector> > m_reusableRegionSelectorVector;
+ RefPtr<CSSCalcValue> m_parsedCalculation;
+
// defines units allowed for a certain property, used in parseUnit
enum Units {
FUnknown = 0x0000,
@@ -405,13 +430,19 @@ private:
return static_cast<Units>(static_cast<unsigned>(a) | static_cast<unsigned>(b));
}
- static bool validUnit(CSSParserValue*, Units, bool strict);
+ bool validCalculationUnit(CSSParserValue*, Units);
+ bool validUnit(CSSParserValue*, Units, bool strict);
bool parseBorderImageQuad(Units, RefPtr<CSSPrimitiveValue>&);
-
- PassRefPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*);
- PassRefPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSParserValue*);
-
+ int colorIntFromValue(CSSParserValue*);
+
+ enum ReleaseParsedCalcValueCondition {
+ ReleaseParsedCalcValue,
+ DoNotReleaseParsedCalcValue
+ };
+ double parsedDouble(CSSParserValue*, ReleaseParsedCalcValueCondition releaseCalc = DoNotReleaseParsedCalcValue);
+ bool isCalculation(CSSParserValue*);
+
friend class TransformOperationInfo;
#if ENABLE(CSS_FILTERS)
friend class FilterOperationInfo;