Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
cssparser.hh
Go to the documentation of this file.
1#ifndef __CSSPARSER_HH__
2#define __CSSPARSER_HH__
3
4#include "css.hh"
5
6class DilloHtml;
7
8class CssParser {
9 private:
14
15 static const int maxStrLen = 256;
19
20 const char *buf;
22
26 bool spaceSeparated; /* used when parsing CSS selectors */
27
29 const char *buf, int buflen);
30 int getChar();
31 void ungetChar();
32 void nextToken();
33 bool skipString(int c, const char *string);
36 CssPropertyValue * val);
37 bool parseWeight();
38 bool parseRgbColorComponent(int32_t *cc, int *percentage);
39 bool parseRgbColor(int32_t *c);
41 CssPropertyList * importantProps);
43 char *parseUrl();
44 void parseImport(DilloHtml *html);
45 void parseMedia();
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
A set of CssStyleSheets.
Definition css.hh:518
void parseMedia()
CssContext * context
Definition cssparser.hh:16
void nextToken()
Definition cssparser.cc:522
bool parseValue(CssPropertyName prop, CssValueType type, CssPropertyValue *val)
Definition cssparser.cc:890
bool skipString(int c, const char *string)
Skip string str if it is found in the input buffer.
Definition cssparser.cc:506
bool tokenMatchesProperty(CssPropertyName prop, CssValueType *type)
Definition cssparser.cc:703
bool parseSimpleSelector(CssSimpleSelector *selector)
bool parseRgbColorComponent(int32_t *cc, int *percentage)
Definition cssparser.cc:813
void parseDeclaration(CssPropertyList *props, CssPropertyList *importantProps)
static void parseDeclarationBlock(const DilloUrl *baseUrl, const char *buf, int buflen, CssPropertyList *props, CssPropertyList *propsImortant)
char * parseUrl()
void parseImport(DilloHtml *html)
void ignoreBlock()
@ CSS_TK_DECINT
Definition cssparser.hh:11
@ CSS_TK_SYMBOL
Definition cssparser.hh:11
@ CSS_TK_STRING
Definition cssparser.hh:12
bool withinBlock
Definition cssparser.hh:25
bool parseRgbColor(int32_t *c)
Definition cssparser.cc:846
static const int maxStrLen
Definition cssparser.hh:15
void ungetChar()
Undoes the last getChar().
Definition cssparser.cc:495
bool spaceSeparated
Definition cssparser.hh:26
static void parse(DilloHtml *html, const DilloUrl *baseUrl, CssContext *context, const char *buf, int buflen, CssOrigin origin)
int getChar()
Gets the next character from the buffer, or EOF.
Definition cssparser.cc:477
CssOrigin origin
Definition cssparser.hh:17
static const char * propertyNameString(CssPropertyName name)
bool parseWeight()
char tval[maxStrLen]
Definition cssparser.hh:24
void parseRuleset()
CssTokenType ttype
Definition cssparser.hh:23
const char * buf
Definition cssparser.hh:20
const DilloUrl * baseUrl
Definition cssparser.hh:18
CssSelector * parseSelector()
void ignoreStatement()
A list of CssProperty objects.
Definition css.hh:331
CSS selector class.
Definition css.hh:397
CssPropertyName
Definition css.hh:163
CssValueType
Definition css.hh:36
CssOrigin
Definition css.hh:30
Definition url.h:88