summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-11-04 21:52:24 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2011-11-04 21:52:24 (GMT)
commitdb12dd2c03e303eda101b3307bca272af017b646 (patch)
tree02d3287d9c749603484242511557ba0307111aa7
parent38655376dbf2e3b6d91e70bb67f9ea1db00a533e (diff)
downloadlibcss-db12dd2c03e303eda101b3307bca272af017b646.tar.gz
libcss-db12dd2c03e303eda101b3307bca272af017b646.tar.bz2
Don't need to match CSS_SELECTOR_ELEMENT detail since it will always match.
svn path=/trunk/libcss/; revision=13119
-rw-r--r--src/select/select.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/select/select.c b/src/select/select.c
index dce813e..1851f47 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1438,13 +1438,19 @@ css_error match_details(css_select_ctx *ctx, void *node,
* can be avoided unless absolutely necessary)? */
do {
- error = match_detail(ctx, node, detail, state, match, &pseudo);
- if (error != CSS_OK)
- return error;
+ /* Named elements are handled by match_named_combinator, so
+ * the element selector detail always matches here. */
+ if (detail->type != CSS_SELECTOR_ELEMENT) {
+
+ error = match_detail(ctx, node, detail, state,
+ match, &pseudo);
+ if (error != CSS_OK)
+ return error;
- /* Detail doesn't match, so reject selector chain */
- if (*match == false)
- return CSS_OK;
+ /* Detail doesn't match, so reject selector chain */
+ if (*match == false)
+ return CSS_OK;
+ }
if (detail->next)
detail++;
@@ -1485,8 +1491,7 @@ css_error match_detail(css_select_ctx *ctx, void *node,
switch (detail->type) {
case CSS_SELECTOR_ELEMENT:
- error = state->handler->node_has_name(state->pw, node,
- &detail->qname, match);
+ /* Never any need to match this detail type. */
break;
case CSS_SELECTOR_CLASS:
error = state->handler->node_has_class(state->pw, node,