diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-01 16:02:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-01 16:02:37 +0000 |
commit | d91748e925d41bdeb2ee2622b8d19be6f742882a (patch) | |
tree | cea7215378875373b035293d79b7e9ca3318db80 | |
parent | 2606d65d5bd1e6aa137f002effcae32b0eed9ee6 (diff) | |
download | libcss-d91748e925d41bdeb2ee2622b8d19be6f742882a.tar.gz libcss-d91748e925d41bdeb2ee2622b8d19be6f742882a.tar.bz2 |
Similar fix for empty rules in normal stylesheets.
svn path=/trunk/libcss/; revision=8244
-rw-r--r-- | src/select/select.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/select/select.c b/src/select/select.c index 7f18aff..00396a1 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -312,6 +312,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node, goto cleanup; } + /* No bytecode if input was empty or wholly invalid */ if (sel->style != NULL) { error = cascade_style(sel->style, &state); if (error != CSS_OK) @@ -731,6 +732,10 @@ css_error match_selector_chain(css_select_ctx *ctx, /* If we got here, then the entire selector chain matched, so cascade */ state->current_specificity = selector->specificity; + /* No bytecode if rule body is empty or wholly invalid */ + if (((css_rule_selector *) selector->rule)->style == NULL) + return CSS_OK; + return cascade_style(((css_rule_selector *) selector->rule)->style, state); } |