| 6 | class DilloHtml; |
| 7 | |
| 8 | class CssParser { |
| 9 | private: |
| 10 | typedef enum { |
| 11 | CSS_TK_DECINT, CSS_TK_FLOAT, CSS_TK_COLOR, CSS_TK_SYMBOL, |
| 12 | CSS_TK_STRING, CSS_TK_CHAR, CSS_TK_END |
| 13 | } CssTokenType; |
| 14 | |
| 15 | static const int maxStrLen = 256; |
| 16 | CssContext *context; |
| 17 | CssOrigin origin; |
| 18 | const DilloUrl *baseUrl; |
| 19 | |
| 20 | const char *buf; |
| 21 | int buflen, bufptr; |
| 22 | |
| 23 | CssTokenType ttype; |
| 24 | char tval[maxStrLen]; |
| 25 | bool withinBlock; |
| 26 | bool spaceSeparated; /* used when parsing CSS selectors */ |
| 27 | |
| 28 | CssParser(CssContext *context, CssOrigin origin, const DilloUrl *baseUrl, |
| 29 | const char *buf, int buflen); |
| 30 | int getChar(); |
| 31 | void ungetChar(); |
| 32 | void nextToken(); |
| 33 | bool skipString(int c, const char *string); |
| 34 | bool tokenMatchesProperty(CssPropertyName prop, CssValueType * type); |
| 35 | bool parseValue(CssPropertyName prop, CssValueType type, |
| 36 | CssPropertyValue * val); |
| 37 | bool parseWeight(); |
| 38 | bool parseRgbColorComponent(int32_t *cc, int *percentage); |
| 39 | bool parseRgbColor(int32_t *c); |
| 40 | void parseDeclaration(CssPropertyList * props, |
| 41 | CssPropertyList * importantProps); |
| 42 | bool parseSimpleSelector(CssSimpleSelector *selector); |
| 43 | char *parseUrl(); |
| 44 | void parseImport(DilloHtml *html); |
| 45 | void parseMedia(); |
| 46 | CssSelector *parseSelector(); |
| 47 | void parseRuleset(); |
| 48 | void ignoreBlock(); |
| 49 | void ignoreStatement(); |
| 50 | |
| 51 | public: |
| 52 | static void parseDeclarationBlock(const DilloUrl *baseUrl, |
| 53 | const char *buf, int buflen, |
| 54 | CssPropertyList *props, |
| 55 | CssPropertyList *propsImortant); |
| 56 | static void parse(DilloHtml *html, const DilloUrl *baseUrl, CssContext *context, |
| 57 | const char *buf, int buflen, CssOrigin origin); |
| 58 | static const char *propertyNameString(CssPropertyName name); |
| 59 | }; |
| 60 | |
| 61 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected