diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-10-26 23:58:06 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-10-26 23:58:06 +0000 |
commit | 3d37c5ab719bf7038e242f8b542dee6bb1908831 (patch) | |
tree | 25dfdfc8a98017b99b4de186389636dc7be0145f /src/parse/css21props.c | |
parent | 6289f4216fe8fada44cf57c0fb939029ca720ae9 (diff) | |
download | libcss-3d37c5ab719bf7038e242f8b542dee6bb1908831.tar.gz libcss-3d37c5ab719bf7038e242f8b542dee6bb1908831.tar.bz2 |
Function to extract an integer from a css_string.
Use this in font-weight parsing.
TODO: NUMBER tokens may contain [-+]? ([0-9]+ | [0-9]* '.' [0-9]+). The lexer currently doesn't cater for the [-+]? part. This is a bug (inherited from the grammar in the spec), and must be fixed.
TODO: integer_from_css_string probably wants to pass out the number of characters processed so that the client can determine if the input was valid for their context.
svn path=/trunk/libcss/; revision=5645
Diffstat (limited to 'src/parse/css21props.c')
-rw-r--r-- | src/parse/css21props.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parse/css21props.c b/src/parse/css21props.c index 8a315b5..cbf4040 100644 --- a/src/parse/css21props.c +++ b/src/parse/css21props.c @@ -1683,7 +1683,7 @@ css_error parse_font_weight(css_css21 *c, if (token->lower.ptr == c->strings[INHERIT]) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_NUMBER) { - int32_t num = 100; /** \todo strntol */ + int32_t num = integer_from_css_string(&token->lower); switch (num) { case 100: value = FONT_WEIGHT_100; break; case 200: value = FONT_WEIGHT_200; break; |