summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2002-05-04 21:17:06 +0000
committerJames Bursa <james@netsurf-browser.org>2002-05-04 21:17:06 +0000
commit91300f840ff90b108658a63bb8fdfe21a8f45c4b (patch)
tree707f05618433ed3aaf8cf87dc45779da644aefb8 /render/box.c
parent50d95fdf6f598dc679c7065cd5ced044d5abcd8e (diff)
downloadnetsurf-91300f840ff90b108658a63bb8fdfe21a8f45c4b.tar.gz
netsurf-91300f840ff90b108658a63bb8fdfe21a8f45c4b.tar.bz2
[project @ 2002-05-04 21:17:06 by bursa]
Added code to use style attribute of elements. svn path=/import/netsurf/; revision=14
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/render/box.c b/render/box.c
index dd3796e3d..2966e70af 100644
--- a/render/box.c
+++ b/render/box.c
@@ -1,5 +1,5 @@
/**
- * $Id: box.c,v 1.1 2002/05/04 19:57:18 bursa Exp $
+ * $Id: box.c,v 1.2 2002/05/04 21:17:06 bursa Exp $
*/
#include <assert.h>
@@ -60,6 +60,7 @@ struct box * xml_to_box(xmlNode * n, struct css_style * parent_style, struct css
struct box * inline_container_c;
struct css_style * style;
xmlNode * c;
+ xmlChar * s;
if (n->type == XML_ELEMENT_NODE) {
/* work out the style for this element */
@@ -71,6 +72,15 @@ struct box * xml_to_box(xmlNode * n, struct css_style * parent_style, struct css
memcpy(style, parent_style, sizeof(struct css_style));
css_get_style(stylesheet, *selector, depth + 1, style);
+ if (s = xmlGetProp(n, "style")) {
+ struct css_style * astyle = xcalloc(1, sizeof(struct css_style));
+ memcpy(astyle, &css_empty_style, sizeof(struct css_style));
+ css_parse_property_list(astyle, s);
+ css_cascade(style, astyle);
+ free(astyle);
+ free(s);
+ }
+
switch (style->display) {
case CSS_DISPLAY_BLOCK: /* blocks get a node in the box tree */
box = xcalloc(1, sizeof(struct box));