diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-04 01:29:44 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-04 01:29:44 +0000 |
commit | 846f1651f053373e0c3de4f80c0c5aa0bc282720 (patch) | |
tree | 7d35cdc9f4ba4a23abe195d4e07eb022dbc0d8fb /src/select/properties.c | |
parent | 7c809b74610653dc55276bb6e99459e073d2112c (diff) | |
download | libcss-846f1651f053373e0c3de4f80c0c5aa0bc282720.tar.gz libcss-846f1651f053373e0c3de4f80c0c5aa0bc282720.tar.bz2 |
Compose cue-after, cue-before, cursor.
svn path=/trunk/libcss/; revision=6693
Diffstat (limited to 'src/select/properties.c')
-rw-r--r-- | src/select/properties.c | 62 |
1 files changed, 62 insertions, 0 deletions
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) { |