diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-04 12:59:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-04 12:59:37 +0000 |
commit | 2f5753d607a93c8ae18aab3dd675b111af7d879d (patch) | |
tree | f9c2f35073806f433a1520ec2d64cbbcb2d9fc1d /test/select-auto.c | |
parent | 39a51ce203672ead9e526592f4d35bdef5e5c728 (diff) | |
download | libcss-2f5753d607a93c8ae18aab3dd675b111af7d879d.tar.gz libcss-2f5753d607a93c8ae18aab3dd675b111af7d879d.tar.bz2 |
Query client for initial values of color, font-family, quotes, and voice-family properties.
svn path=/trunk/libcss/; revision=8306
Diffstat (limited to 'test/select-auto.c')
-rw-r--r-- | test/select-auto.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/test/select-auto.c b/test/select-auto.c index e884a18..fed6204 100644 --- a/test/select-auto.c +++ b/test/select-auto.c @@ -114,6 +114,8 @@ static css_error node_is_lang(void *pw, void *node, lwc_string *lang, bool *match); static css_error node_presentational_hint(void *pw, void *node, uint32_t property, css_hint *hint); +static css_error ua_default_for_property(void *pw, uint32_t property, + css_hint *hint); static css_select_handler select_handler = { node_name, @@ -135,7 +137,8 @@ static css_select_handler select_handler = { node_is_active, node_is_focus, node_is_lang, - node_presentational_hint + node_presentational_hint, + ua_default_for_property }; static void *myrealloc(void *data, size_t len, void *pw) @@ -1082,3 +1085,28 @@ css_error node_presentational_hint(void *pw, void *node, return CSS_PROPERTY_NOT_SET; } +css_error ua_default_for_property(void *pw, uint32_t property, css_hint *hint) +{ + UNUSED(pw); + + if (property == CSS_PROP_COLOR) { + hint->data.color = 0x00000000; + hint->status = CSS_COLOR_COLOR; + } else if (property == CSS_PROP_FONT_FAMILY) { + hint->data.strings = NULL; + hint->status = CSS_FONT_FAMILY_SANS_SERIF; + } else if (property == CSS_PROP_QUOTES) { + /* Not exactly useful :) */ + hint->data.strings = NULL; + hint->status = CSS_QUOTES_NONE; + } else if (property == CSS_PROP_VOICE_FAMILY) { + /** \todo Fix this when we have voice-family done */ + hint->data.strings = NULL; + hint->status = 0; + } else { + return CSS_INVALID; + } + + return CSS_OK; +} + |