Gitweb links:
...log
http://git.netsurf-browser.org/libcss.git/shortlog/71d28981207beb72b3ca68a9fa24948615a6a9bd
...commit
http://git.netsurf-browser.org/libcss.git/commit/71d28981207beb72b3ca68a9fa24948615a6a9bd
...tree
http://git.netsurf-browser.org/libcss.git/tree/71d28981207beb72b3ca68a9fa24948615a6a9bd
The branch, master has been updated
via 71d28981207beb72b3ca68a9fa24948615a6a9bd (commit)
from 18aea52cfc1086999ce2463ccd08c5813341d32f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libcss.git/commitdiff/71d28981207beb72b3ca68a9fa24948615a6a9bd
commit 71d28981207beb72b3ca68a9fa24948615a6a9bd
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Skip empty/broken rules early, before we match their selector chains.
diff --git a/src/select/select.c b/src/select/select.c
index 3543dd5..ba35262 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1379,13 +1379,19 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
selector = _selector_next(node_selectors, id_selectors,
class_selectors, n_classes, univ_selectors);
- /* Ignore any selectors contained in rules which are a child
- * of an @media block that doesn't match the current media
- * requirements. */
- if (_rule_applies_to_media(selector->rule, state->media)) {
- error = match_selector_chain(ctx, selector, state);
- if (error != CSS_OK)
- goto cleanup;
+ /* No bytecode if rule body is empty or wholly invalid --
+ * Only interested in rules with bytecode */
+ if (((css_rule_selector *) selector->rule)->style != NULL) {
+ /* Ignore any selectors contained in rules which are a
+ * child of an @media block that doesn't match the
+ * current media requirements. */
+ if (_rule_applies_to_media(selector->rule,
+ state->media)) {
+ error = match_selector_chain(ctx, selector,
+ state);
+ if (error != CSS_OK)
+ goto cleanup;
+ }
}
/* Advance to next selector in whichever chain we extracted
@@ -1531,10 +1537,6 @@ 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;
-
/* Ensure that the appropriate computed style exists */
if (state->results->styles[pseudo] == NULL) {
error = css_computed_style_create(ctx->alloc, ctx->pw,
-----------------------------------------------------------------------
Summary of changes:
src/select/select.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/select/select.c b/src/select/select.c
index 3543dd5..ba35262 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1379,13 +1379,19 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
selector = _selector_next(node_selectors, id_selectors,
class_selectors, n_classes, univ_selectors);
- /* Ignore any selectors contained in rules which are a child
- * of an @media block that doesn't match the current media
- * requirements. */
- if (_rule_applies_to_media(selector->rule, state->media)) {
- error = match_selector_chain(ctx, selector, state);
- if (error != CSS_OK)
- goto cleanup;
+ /* No bytecode if rule body is empty or wholly invalid --
+ * Only interested in rules with bytecode */
+ if (((css_rule_selector *) selector->rule)->style != NULL) {
+ /* Ignore any selectors contained in rules which are a
+ * child of an @media block that doesn't match the
+ * current media requirements. */
+ if (_rule_applies_to_media(selector->rule,
+ state->media)) {
+ error = match_selector_chain(ctx, selector,
+ state);
+ if (error != CSS_OK)
+ goto cleanup;
+ }
}
/* Advance to next selector in whichever chain we extracted
@@ -1531,10 +1537,6 @@ 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;
-
/* Ensure that the appropriate computed style exists */
if (state->results->styles[pseudo] == NULL) {
error = css_computed_style_create(ctx->alloc, ctx->pw,
--
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org