ELinks 0.18.0
|
Data Structures | |
struct | css_selector_set |
A set of struct css_selector. More... | |
struct | css_selector |
The struct css_selector is used for mapping elements (or nodes) in the document structure to properties. More... | |
struct | css_stylesheet |
The struct css_stylesheet describes all the useful data that was extracted from the CSS source. More... |
Macros | |
#define | INIT_CSS_SELECTOR_SET(set) |
#define | INIT_CSS_STYLESHEET(css, import) |
#define | get_css_base_selector(stylesheet, type, rel, name, namelen) |
#define | find_css_base_selector(stylesheet, type, rel, name, namelen) |
#define | css_selector_set_empty(set) |
#define | css_selector_set_front(set) |
#define | css_selector_is_in_set(selector) |
#define | foreach_css_selector(selector, set) |
Typedefs | |
typedef unsigned char | css_selector_type_T |
typedef void(* | css_stylesheet_importer_T) (struct css_stylesheet *, struct uri *, const char *url, int urllen) |
Enumerations | |
enum | css_selector_relation { CSR_ROOT , CSR_SPECIFITY , CSR_ANCESTOR , CSR_PARENT } |
enum | css_selector_type { CST_ELEMENT , CST_ID , CST_CLASS , CST_PSEUDO , CST_INVALID } |
Functions | |
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 *) |
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
#define css_selector_is_in_set | ( | selector | ) |
#define css_selector_set_empty | ( | set | ) |
#define css_selector_set_front | ( | set | ) |
#define find_css_base_selector | ( | stylesheet, | |
type, | |||
rel, | |||
name, | |||
namelen ) |
#define foreach_css_selector | ( | selector, | |
set ) |
#define get_css_base_selector | ( | stylesheet, | |
type, | |||
rel, | |||
name, | |||
namelen ) |
#define INIT_CSS_SELECTOR_SET | ( | set | ) |
#define INIT_CSS_STYLESHEET | ( | css, | |
import ) |
typedef unsigned char css_selector_type_T |
typedef void(* css_stylesheet_importer_T) (struct css_stylesheet *, struct uri *, const char *url, int urllen) |
enum css_selector_type |
void add_css_selector_to_set | ( | struct css_selector * | selector, |
struct css_selector_set * | set ) |
void add_selector_properties | ( | struct css_selector * | selector, |
struct css_property list * | properties ) |
Add all properties from the list to the given selector.
void del_css_selector_from_set | ( | struct css_selector * | selector | ) |
void done_css_selector | ( | struct css_selector * | selector | ) |
Destroy a selector.
done_css_stylesheet() normally does that for you.
void done_css_selector_set | ( | struct css_selector_set * | set | ) |
void done_css_stylesheet | ( | struct css_stylesheet * | css | ) |
Releases all the content of the stylesheet (but not the stylesheet itself).
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 * 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 * 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.
This is a rather low-level function from your POV.
void init_css_selector_set | ( | struct css_selector_set * | set | ) |
struct css_stylesheet * init_css_stylesheet | ( | css_stylesheet_importer_T | importer, |
void * | import_data ) |
Dynamically allocates a stylesheet.
void merge_css_selectors | ( | struct css_selector * | sel1, |
struct css_selector * | sel2 ) |
Join sel2 to sel1, sel1 taking precedence in all conflicts.
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 set_css_selector_relation | ( | struct css_selector * | selector, |
enum | css_selector_relation ) |
Use this function instead of modifying css_selector.relation directly.