|
#define | INIT_CSS_SELECTOR_SET(set) { 0, { D_LIST_HEAD_EL(set.list) } } |
|
#define | INIT_CSS_STYLESHEET(css, import) { import, NULL, INIT_CSS_SELECTOR_SET(css.selectors) } |
|
#define | get_css_base_selector(stylesheet, type, rel, name, namelen) |
|
#define | find_css_base_selector(stylesheet, type, rel, name, namelen) find_css_selector(&stylesheet->selectors, rel, type, name, namelen) |
|
#define | css_selector_set_empty(set) list_empty((set)->list) |
|
#define | css_selector_set_front(set) ((struct css_selector *) ((set)->list.next)) |
|
#define | css_selector_is_in_set(selector) ((selector)->next != NULL) |
|
#define | foreach_css_selector(selector, set) foreach (selector, (set)->list) |
|
|
struct css_stylesheet * | init_css_stylesheet (css_stylesheet_importer_T importer, void *import_data) |
| Dynamically allocates a stylesheet.
|
|
void | mirror_css_stylesheet (struct css_stylesheet *css1, struct css_stylesheet *css2) |
| Mirror given CSS stylesheet css1 to an identical copy of itself (including all the selectors), css2.
|
|
void | done_css_stylesheet (struct css_stylesheet *css) |
| Releases all the content of the stylesheet (but not the stylesheet itself).
|
|
struct css_selector * | get_css_selector (struct css_selector_set *set, css_selector_type_T type, enum css_selector_relation rel, const char *name, int namelen) |
| Returns a new freshly made selector adding it to the given selector set, or NULL.
|
|
struct css_selector * | find_css_selector (struct css_selector_set *set, css_selector_type_T type, enum css_selector_relation rel, const char *name, int namelen) |
| Looks up the selector of the name name and length namelen in the given set of selectors.
|
|
struct css_selector * | init_css_selector (struct css_selector_set *set, css_selector_type_T type, enum css_selector_relation relation, const char *name, int namelen) |
| Initialize the selector structure.
|
|
void | add_selector_properties (struct css_selector *selector, struct css_property list *properties) |
| Add all properties from the list to the given selector.
|
|
void | merge_css_selectors (struct css_selector *sel1, struct css_selector *sel2) |
| Join sel2 to sel1, sel1 taking precedence in all conflicts.
|
|
void | set_css_selector_relation (struct css_selector *, enum css_selector_relation) |
| Use this function instead of modifying css_selector.relation directly.
|
|
void | done_css_selector (struct css_selector *selector) |
| Destroy a selector.
|
|
void | init_css_selector_set (struct css_selector_set *set) |
|
void | done_css_selector_set (struct css_selector_set *set) |
|
void | add_css_selector_to_set (struct css_selector *, struct css_selector_set *) |
|
void | del_css_selector_from_set (struct css_selector *) |
|
- Todo
- TODO: We need a memory efficient and fast way to define how properties cascade. What we are interested in is making it fast and easy to find all properties we need.
struct css_cascade {
struct css_cascade *parent;
- Can later be turned into a
table to not waste memory:
};
The struct css_property describes one CSS declaration in a rule, therefore being basically a parsed i...
Definition property.h:93
And the selector should then only map a document element into this data structure.
All the CSS applier has to do is require the css_cascade of the current element and it should nicely inherit any style from parent cascades. Question is in what direction to apply. It should be possible for the user to overwrite any document provided stylesheet using "!important" so we need to keep track in some table what properties was already applied so we only overwrite when we have to. –jonas
XXX: This is one of the TODOs where I have no clue what is it talking about in particular. Is it obsolete now when we grok 'td.foo p::x>a:hover' without hesitation? –pasky