From 89c0440321f6f2a91dee1a2047f6bffc3eec382c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 31 Jan 2011 22:30:02 +0000 Subject: Place negated class and id selectors in the universal hash chain svn path=/trunk/libcss/; revision=11568 --- src/select/hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/select/hash.c b/src/select/hash.c index d68ad82..43a696f 100644 --- a/src/select/hash.c +++ b/src/select/hash.c @@ -536,7 +536,8 @@ lwc_string *_class_name(const css_selector *selector) lwc_string *name = NULL; do { - if (detail->type == CSS_SELECTOR_CLASS) { + /* Ignore :not(.class) */ + if (detail->type == CSS_SELECTOR_CLASS && detail->negate == 0) { name = detail->name; break; } @@ -562,7 +563,8 @@ lwc_string *_id_name(const css_selector *selector) lwc_string *name = NULL; do { - if (detail->type == CSS_SELECTOR_ID) { + /* Ignore :not(#id) */ + if (detail->type == CSS_SELECTOR_ID && detail->negate == 0) { name = detail->name; break; } -- cgit v1.2.3