Mercurial > dillo_port1.3
view src/cssparser.hh @ 1958:7860a3051241
Fix for endless loop with META refresh and same URL or no URL at all
author | Jorge Arellano Cid <jcid@dillo.org> |
---|---|
date | Fri, 15 Apr 2011 14:08:53 -0300 |
parents | d3eb50e48d9d |
children | 5b8e5855ab8e |
line wrap: on
line source
#ifndef __CSSPARSER_HH__ #define __CSSPARSER_HH__ #include "css.hh" #include "html_common.hh" class CssParser { private: typedef enum { CSS_TK_DECINT, CSS_TK_FLOAT, CSS_TK_COLOR, CSS_TK_SYMBOL, CSS_TK_STRING, CSS_TK_CHAR, CSS_TK_END } CssTokenType; static const int maxStrLen = 256; CssContext *context; CssOrigin origin; const char *buf; int buflen, bufptr; CssTokenType ttype; char tval[maxStrLen]; bool withinBlock; bool spaceSeparated; /* used when parsing CSS selectors */ CssParser(CssContext *context, CssOrigin origin, const char *buf, int buflen); int getChar(); void ungetChar(); void nextToken(); bool skipString(int c, const char *string); bool tokenMatchesProperty(CssPropertyName prop, CssValueType * type); bool parseValue(CssPropertyName prop, CssValueType type, CssPropertyValue * val); bool parseWeight(); bool parseRgbColorComponent(int32_t *cc, int *percentage); bool parseRgbColor(int32_t *c); void parseDeclaration(CssPropertyList * props, CssPropertyList * importantProps); bool parseSimpleSelector(CssSimpleSelector *selector); char *parseUrl(); void parseImport(DilloHtml *html, DilloUrl *url); void parseMedia(); CssSelector *parseSelector(); void parseRuleset(); void ignoreBlock(); void ignoreStatement(); public: static CssPropertyList *parseDeclarationBlock(const char *buf, int buflen); static void parse(DilloHtml *html, DilloUrl *url, CssContext *context, const char *buf, int buflen, CssOrigin origin); static const char *propertyNameString(CssPropertyName name); }; #endif