From 846f1651f053373e0c3de4f80c0c5aa0bc282720 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 4 Mar 2009 01:29:44 +0000 Subject: Compose cue-after, cue-before, cursor. svn path=/trunk/libcss/; revision=6693 --- src/select/properties.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'src') diff --git a/src/select/properties.c b/src/select/properties.c index daf3411..5956ad4 100644 --- a/src/select/properties.c +++ b/src/select/properties.c @@ -1316,6 +1316,17 @@ css_error initial_cue_after(css_computed_style *style) return CSS_OK; } +css_error compose_cue_after(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + UNUSED(parent); + UNUSED(child); + UNUSED(result); + + return CSS_OK; +} + css_error cascade_cue_before(uint32_t opv, css_style *style, css_select_state *state) { @@ -1330,6 +1341,17 @@ css_error initial_cue_before(css_computed_style *style) return CSS_OK; } +css_error compose_cue_before(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + UNUSED(parent); + UNUSED(child); + UNUSED(result); + + return CSS_OK; +} + css_error cascade_cursor(uint32_t opv, css_style *style, css_select_state *state) { @@ -1455,6 +1477,46 @@ css_error initial_cursor(css_computed_style *style) return set_cursor(style, CSS_CURSOR_AUTO, NULL); } +css_error compose_cursor(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + css_error error; + lwc_string **urls = NULL; + + if ((child->uncommon == NULL && parent->uncommon != NULL) || + css_computed_cursor(child, &urls) == + CSS_CURSOR_INHERIT) { + uint8_t p = css_computed_cursor(parent, &urls); + size_t n_urls = 0; + lwc_string **copy = NULL; + + if (urls != NULL) { + lwc_string **i; + + for (i = urls; (*i) != NULL; i++) + n_urls++; + + copy = result->alloc(NULL, (n_urls + 1) * + sizeof(lwc_string *), + result->pw); + if (copy == NULL) + return CSS_NOMEM; + + memcpy(copy, urls, (n_urls + 1) * + sizeof(lwc_string *)); + } + + error = set_cursor(result, p, copy); + if (error != CSS_OK && copy != NULL) + result->alloc(copy, 0, result->pw); + + return error; + } + + return CSS_OK; +} + css_error cascade_direction(uint32_t opv, css_style *style, css_select_state *state) { -- cgit v1.2.3