summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-01 16:02:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-01 16:02:37 +0000
commitd91748e925d41bdeb2ee2622b8d19be6f742882a (patch)
treecea7215378875373b035293d79b7e9ca3318db80
parent2606d65d5bd1e6aa137f002effcae32b0eed9ee6 (diff)
downloadlibcss-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.c5
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);
}