From d91748e925d41bdeb2ee2622b8d19be6f742882a Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 1 Jul 2009 16:02:37 +0000 Subject: Similar fix for empty rules in normal stylesheets. svn path=/trunk/libcss/; revision=8244 --- src/select/select.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/select/select.c') 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); } -- cgit v1.2.3