summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/select/select.c b/src/select/select.c
index c7748cf..687be85 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -624,13 +624,50 @@ css_error match_detail(css_select_ctx *ctx, void *node,
const css_selector_detail *detail, css_select_state *state,
bool *match)
{
+ css_error error = CSS_OK;
+
UNUSED(ctx);
- UNUSED(node);
- UNUSED(detail);
- UNUSED(state);
- UNUSED(match);
- return CSS_OK;
+ switch (detail->type) {
+ case CSS_SELECTOR_CLASS:
+ error = state->handler->node_has_class(state->pw, node,
+ detail->name->data, detail->name->len,
+ match);
+ break;
+ case CSS_SELECTOR_ID:
+ error = state->handler->node_has_id(state->pw, node,
+ detail->name->data, detail->name->len,
+ match);
+ break;
+ case CSS_SELECTOR_PSEUDO:
+ /** \todo pseudo classes/elements */
+ break;
+ case CSS_SELECTOR_ATTRIBUTE:
+ error = state->handler->node_has_attribute(state->pw, node,
+ detail->name->data, detail->name->len,
+ match);
+ break;
+ case CSS_SELECTOR_ATTRIBUTE_EQUAL:
+ error = state->handler->node_has_attribute_equal(state->pw,
+ node, detail->name->data, detail->name->len,
+ detail->value->data, detail->value->len,
+ match);
+ break;
+ case CSS_SELECTOR_ATTRIBUTE_DASHMATCH:
+ error = state->handler->node_has_attribute_dashmatch(state->pw,
+ node, detail->name->data, detail->name->len,
+ detail->value->data, detail->value->len,
+ match);
+ break;
+ case CSS_SELECTOR_ATTRIBUTE_INCLUDES:
+ error = state->handler->node_has_attribute_includes(state->pw,
+ node, detail->name->data, detail->name->len,
+ detail->value->data, detail->value->len,
+ match);
+ break;
+ }
+
+ return error;
}
css_error cascade_style(css_select_ctx *ctx, css_style *style,