From 78594f3f60a2ce28f1d6ee95676bfa10492320fe Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 9 Jun 2004 19:55:06 +0000 Subject: [project @ 2004-06-09 19:55:06 by jmb] Implement background-image, background-repeat, background-position and background-attachment CSS properties. background-attachment and background-position need more work. Some redraw issues remain. svn path=/import/netsurf/; revision=938 --- css/css.h | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'css/css.h') diff --git a/css/css.h b/css/css.h index 14c53a065..d80df9333 100644 --- a/css/css.h +++ b/css/css.h @@ -53,10 +53,44 @@ typedef enum { CSS_TEXT_DECORATION_UNKNOWN = 0x1000 } css_text_decoration; +typedef enum { + CSS_BACKGROUND_POSITION_LENGTH, + CSS_BACKGROUND_POSITION_PERCENT, + CSS_BACKGROUND_POSITION_INHERIT +} css_background_position; + /** Representation of a complete CSS 2 style. */ struct css_style { colour background_color; + css_background_attachment background_attachment; + + struct { + enum { CSS_BACKGROUND_IMAGE_NONE, + CSS_BACKGROUND_IMAGE_INHERIT, + CSS_BACKGROUND_IMAGE_URI } type; + char *uri; + } background_image; + + struct { + struct { + css_background_position pos; + union { + float percent; + struct css_length length; + } value; + } horz; + struct { + css_background_position pos; + union { + float percent; + struct css_length length; + } value; + } vert; + } background_position; + + css_background_repeat background_repeat; + struct { colour color; struct { @@ -246,6 +280,7 @@ struct css_node { css_combinator comb; struct css_style *style; unsigned long specificity; + struct content *stylesheet; }; @@ -282,7 +317,8 @@ void css_destroy(struct content *c); #ifdef CSS_INTERNALS -struct css_node * css_new_node(css_node_type type, +struct css_node * css_new_node(struct content *stylesheet, + css_node_type type, const char *data, unsigned int data_length); void css_free_node(struct css_node *node); struct css_selector * css_new_selector(css_selector_type type, -- cgit v1.2.3