summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 07:38:08 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 07:38:08 +0000
commit2addbadb04d9e3e5afc8b3e1f31bd8abe984f5e4 (patch)
treeaa105221f23230297e33fa4a501b4f0aff63f4e8 /src/select/select.c
parent7ecab92e9a8508c44a758a8ca58defe9a5965bb4 (diff)
downloadlibcss-2addbadb04d9e3e5afc8b3e1f31bd8abe984f5e4.tar.gz
libcss-2addbadb04d9e3e5afc8b3e1f31bd8abe984f5e4.tar.bz2
Fix matching of universal sibling selectors -- siblings must be adjacent.
svn path=/trunk/libcss/; revision=6471
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c8
1 files 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);