summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-01 15:52:20 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-01 15:52:20 +0000
commit46dd17bc8c6dcc1cddf3c8c07644c319ef1f8b03 (patch)
tree3f63d9b31053d6049a9d87a8f7c2177295b26de0 /src/parse
parentd138c4ab32e2b4a3c527ad12b4c10a3527472289 (diff)
downloadlibcss-46dd17bc8c6dcc1cddf3c8c07644c319ef1f8b03.tar.gz
libcss-46dd17bc8c6dcc1cddf3c8c07644c319ef1f8b03.tar.bz2
Fixup parsing of empty inline styles -- previously, it would emit the START_STYLESHEET and START_RULESET events twice.
svn path=/trunk/libcss/; revision=8242
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/parse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/parse/parse.c b/src/parse/parse.c
index 1e419c9..361ba84 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -2385,7 +2385,7 @@ css_error parseMalformedAtRule(css_parser *parser)
css_error parseInlineStyle(css_parser *parser)
{
- enum { Initial = 0, AfterISBody0 = 1 };
+ enum { Initial = 0, WS = 1, AfterISBody0 = 2 };
parser_state *state = parserutils_stack_get_current(parser->states);
css_error error;
@@ -2393,10 +2393,6 @@ css_error parseInlineStyle(css_parser *parser)
switch (state->substate) {
case Initial:
- {
- parser_state to = { sISBody0, Initial };
- parser_state subsequent = { sInlineStyle, AfterISBody0 };
-
/* Emit fake events such that the language parser knows
* no different from a normal parse. */
@@ -2410,6 +2406,14 @@ css_error parseInlineStyle(css_parser *parser)
parser->event_pw);
}
+ /* Fall through */
+ case WS:
+ {
+ parser_state to = { sISBody0, Initial };
+ parser_state subsequent = { sInlineStyle, AfterISBody0 };
+
+ state->substate = WS;
+
/* Consume leading whitespace */
error = eatWS(parser);
if (error != CSS_OK)