diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-12-02 17:03:21 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-12-02 17:03:21 +0000 |
commit | aad2ae03d349f7cee11efaf4643e6f7e4afa86a9 (patch) | |
tree | bec98eb7cbbae98b25185de901d778a946934408 | |
parent | 8819e781762e81d5c1664dc65636845db91982b5 (diff) | |
download | libcss-aad2ae03d349f7cee11efaf4643e6f7e4afa86a9.tar.gz libcss-aad2ae03d349f7cee11efaf4643e6f7e4afa86a9.tar.bz2 |
We know element/id/class names are available through the insensitive ptr now.
-rw-r--r-- | src/select/hash.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/select/hash.c b/src/select/hash.c index 5420d6d..32034e0 100644 --- a/src/select/hash.c +++ b/src/select/hash.c @@ -720,7 +720,7 @@ static inline void _chain_bloom_add_detail( const css_selector_detail *d, css_bloom bloom[CSS_BLOOM_SIZE]) { - lwc_string *add = NULL; /* String to add to bloom */ + lwc_string *add; /* String to add to bloom */ switch (d->type) { case CSS_SELECTOR_ELEMENT: @@ -729,33 +729,20 @@ static inline void _chain_bloom_add_detail( lwc_string_data(d->qname.name)[0] == '*') { return; } - - /* TODO: Remain case sensitive for XML */ - if (d->qname.name->insensitive == NULL) { - lwc__intern_caseless_string(d->qname.name); - } - add = d->qname.name->insensitive; - break; - + /* Fall through */ case CSS_SELECTOR_CLASS: case CSS_SELECTOR_ID: - /* TODO: Remain case sensitive in standards mode */ - if (d->qname.name->insensitive == NULL) { - lwc__intern_caseless_string(d->qname.name); - } + /* Element, Id and Class names always have the insensitive + * string set at css_selector_detail creation time. */ add = d->qname.name->insensitive; + + if (add != NULL) { + css_bloom_add_hash(bloom, lwc_string_hash_value(add)); + } break; default: - return; - } - - /* Don't really care if intern for caseless string failed, if we're - * out of memory, something else will panic. Everything still works - * if the string isn't added the the rule bloom. Just less optimally. - */ - if (add != NULL) { - css_bloom_add_hash(bloom, lwc_string_hash_value(add)); + break; } return; |