aboutsummaryrefslogtreecommitdiff
path: root/src/cssparser.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-26 21:09:36 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-26 21:09:36 +0100
commit8c0da2c328d3918c4519c89110bc2329aff3e943 (patch)
treee030fa3b39065a8d9a8ae67a4c36ccc7fd02c5ed /src/cssparser.cc
parent0ba638443b5b8b51712ebddc0ea5b7188eb77670 (diff)
don't accept classes or id's starting with integer
Diffstat (limited to 'src/cssparser.cc')
-rw-r--r--src/cssparser.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc
index 1e770306..a95722c4 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -1019,7 +1019,7 @@ static void Css_parse_declaration(CssParser * parser,
static bool Css_parse_simple_selector(CssParser * parser,
CssSimpleSelector *selector) {
- char *p, **pp;
+ char **pp;
if (parser->ttype == CSS_TK_SYMBOL) {
selector->element = a_Html_tag_index(parser->tval);
@@ -1068,21 +1068,12 @@ static bool Css_parse_simple_selector(CssParser * parser,
if (parser->space_separated)
return true;
- if (parser->ttype == CSS_TK_SYMBOL ||
- parser->ttype == CSS_TK_DECINT) {
+ if (parser->ttype == CSS_TK_SYMBOL) {
if (*pp == NULL)
*pp = dStrdup(parser->tval);
Css_next_token(parser);
- } else if (parser->ttype == CSS_TK_FLOAT) {
- /* In this case, we are actually interested in three tokens:
- * number, '.', number. Instead, we have a decimal fraction,
- * which we split up again. */
- p = strchr(parser->tval, '.');
- if (*pp == NULL)
- *pp = dStrndup(parser->tval, p - parser->tval);
- if (selector->klass == NULL)
- selector->klass = dStrdup(p + 1);
- Css_next_token(parser);
+ } else {
+ return false; // don't accept classes or id's starting with integer
}
if (parser->space_separated)
return true;