Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3584 | sourcerer | 1 | /* |
2 | * This file is part of LibCSS |
||
3 | * Licensed under the MIT License, |
||
4 | * http://www.opensource.org/licenses/mit-license.php |
||
5 | * Copyright 2009 John-Mark Bell |
||
6 | */ |
||
7 | |||
8 | #include "bytecode/bytecode.h" |
||
9 | #include "bytecode/opcodes.h" |
||
10 | #include "select/propset.h" |
||
11 | #include "select/propget.h" |
||
12 | #include "utils/utils.h" |
||
13 | |||
14 | #include "select/properties/properties.h" |
||
15 | #include "select/properties/helpers.h" |
||
16 | |||
17 | css_error css__cascade_list_style_image(uint32_t opv, css_style *style, |
||
18 | css_select_state *state) |
||
19 | { |
||
20 | return css__cascade_uri_none(opv, style, state, set_list_style_image); |
||
21 | } |
||
22 | |||
23 | css_error css__set_list_style_image_from_hint(const css_hint *hint, |
||
24 | css_computed_style *style) |
||
25 | { |
||
26 | css_error error; |
||
27 | |||
28 | error = set_list_style_image(style, hint->status, hint->data.string); |
||
29 | |||
30 | if (hint->data.string != NULL) |
||
31 | lwc_string_unref(hint->data.string); |
||
32 | |||
33 | return error; |
||
34 | } |
||
35 | |||
36 | css_error css__initial_list_style_image(css_select_state *state) |
||
37 | { |
||
38 | return set_list_style_image(state->computed, |
||
39 | CSS_LIST_STYLE_IMAGE_NONE, NULL); |
||
40 | } |
||
41 | |||
42 | css_error css__compose_list_style_image(const css_computed_style *parent, |
||
43 | const css_computed_style *child, |
||
44 | css_computed_style *result) |
||
45 | { |
||
46 | lwc_string *url; |
||
47 | uint8_t type = get_list_style_image(child, &url); |
||
48 | |||
49 | if (type == CSS_LIST_STYLE_IMAGE_INHERIT) { |
||
50 | type = get_list_style_image(parent, &url); |
||
51 | } |
||
52 | |||
53 | return set_list_style_image(result, type, url); |
||
54 | } |
||
55 |