summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-10-15 15:28:13 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2016-10-15 15:28:13 +0100
commit3b4fdeafdbed6b779b3b826eda9c9b703dd8c0a1 (patch)
tree75e68b07fd0cd0230ded7173913a6cb9a89e2473 /src/select/select.c
parent846a5fccea928453de47b4ff4bdf120071a1ba79 (diff)
downloadlibcss-3b4fdeafdbed6b779b3b826eda9c9b703dd8c0a1.tar.gz
libcss-3b4fdeafdbed6b779b3b826eda9c9b703dd8c0a1.tar.bz2
Access lwc caseless hash through supported API.
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/src/select/select.c b/src/select/select.c
index a575a2f..ce56def 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -440,6 +440,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
css_hint *hints = NULL;
css_bloom *bloom = NULL;
css_bloom *parent_bloom = NULL;
+ lwc_hash hash;
if (ctx == NULL || node == NULL || result == NULL || handler == NULL ||
handler->handler_version != CSS_SELECT_HANDLER_VERSION_1)
@@ -659,43 +660,34 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
}
/* Add node name to bloom */
- if (state.element.name->insensitive == NULL) {
- if (lwc__intern_caseless_string(
- state.element.name) != lwc_error_ok) {
- error = CSS_NOMEM;
- goto cleanup;
- }
+
+ if (lwc_string_caseless_hash_value(state.element.name,
+ &hash) != lwc_error_ok) {
+ error = CSS_NOMEM;
+ goto cleanup;
}
- css_bloom_add_hash(bloom, lwc_string_hash_value(
- state.element.name->insensitive));
+ css_bloom_add_hash(bloom, hash);
/* Add id name to bloom */
if (state.id != NULL) {
- if (state.id->insensitive == NULL) {
- if (lwc__intern_caseless_string(state.id) !=
- lwc_error_ok) {
- error = CSS_NOMEM;
- goto cleanup;
- }
+ if (lwc_string_caseless_hash_value(state.id,
+ &hash) != lwc_error_ok) {
+ error = CSS_NOMEM;
+ goto cleanup;
}
- css_bloom_add_hash(bloom, lwc_string_hash_value(
- state.id->insensitive));
+ css_bloom_add_hash(bloom, hash);
}
/* Add class names to bloom */
if (state.classes != NULL) {
- lwc_string *s;
for (i = 0; i < state.n_classes; i++) {
- s = state.classes[i];
- if (s->insensitive == NULL) {
- if (lwc__intern_caseless_string(s) !=
- lwc_error_ok) {
- error = CSS_NOMEM;
- goto cleanup;
- }
+ lwc_string *s = state.classes[i];
+ if (lwc_string_caseless_hash_value(s,
+ &hash) != lwc_error_ok) {
+ error = CSS_NOMEM;
+ goto cleanup;
}
- css_bloom_add_hash(bloom, lwc_string_hash_value(
- s->insensitive));
+ css_bloom_add_hash(bloom, hash);
}
}