diff options
Diffstat (limited to 'include/libcss/hint.h')
-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 |