diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-23 14:24:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-23 14:24:37 +0000 |
commit | c7e62664467b2834b2a980b02effb7a9fc82fbeb (patch) | |
tree | 3f4e4dc4a99bc8a2f20e830592309c28a9b10c7b /include | |
parent | 371eb4e6184930f08788e8b200b33f6d29ef20ab (diff) | |
download | libcss-c7e62664467b2834b2a980b02effb7a9fc82fbeb.tar.gz libcss-c7e62664467b2834b2a980b02effb7a9fc82fbeb.tar.bz2 |
Implement set_*_from_hint
Plug memory leaks.
svn path=/trunk/libcss/; revision=6823
Diffstat (limited to 'include')
-rw-r--r-- | include/libcss/hint.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/include/libcss/hint.h b/include/libcss/hint.h index 8e960e9..1aecae6 100644 --- a/include/libcss/hint.h +++ b/include/libcss/hint.h @@ -10,6 +10,7 @@ #include <libwapcaplet/libwapcaplet.h> +#include <libcss/computed.h> #include <libcss/errors.h> #include <libcss/functypes.h> #include <libcss/types.h> @@ -26,15 +27,34 @@ typedef struct css_hint_length { * Presentational hints */ typedef struct css_hint { - uint8_t status; - - css_colour color; - int32_t integer; - css_hint_length length1; - css_hint_length length2; - lwc_string *string; + /* Objects pointed to by fields in this struct are copied for + * use in the computed style. Note that the copy occurs using + * memcpy, so if the object contains pointers itself, then the + * data pointed to by those pointers is *not* copied. + */ + + /* Computed styles are transient objects which provide a window onto + * the internal styling and do not reference the strings they point to. + * Thus, any strings passed in by the client through this struct will + * not be referenced either. Therefore, such strings must be guaranteed + * to persist for the life of the document. + */ + union { + css_computed_clip_rect *clip; + css_colour color; + css_computed_content_item *content; + css_computed_counter *counter; + int32_t integer; + css_hint_length length; + struct { + css_hint_length h; + css_hint_length v; + } position; + lwc_string *string; + lwc_string **strings; + } data; - /** \todo Support clip/content/counter-{increment,reset}? */ + uint8_t status; } css_hint; #endif |