From 2addbadb04d9e3e5afc8b3e1f31bd8abe984f5e4 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 14 Feb 2009 07:38:08 +0000 Subject: Fix matching of universal sibling selectors -- siblings must be adjacent. svn path=/trunk/libcss/; revision=6471 --- src/select/select.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/select/select.c b/src/select/select.c index 5fafcd1..59a95a4 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -856,9 +856,11 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type, if (match == true) break; - /* Wanted the parent, but it didn't match, - * so stop looking */ - if (type == CSS_COMBINATOR_PARENT) + /* For parent and sibling selectors, only adjacent + * nodes are valid. Thus, if we failed to match, + * give up. */ + if (type == CSS_COMBINATOR_PARENT || + type == CSS_COMBINATOR_SIBLING) n = NULL; } } while (n != NULL); -- cgit v1.2.3