summaryrefslogtreecommitdiff
path: root/render/css.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/css.c')
-rw-r--r--render/css.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/render/css.c b/render/css.c
index 256dc4168..beb3afa1a 100644
--- a/render/css.c
+++ b/render/css.c
@@ -1,5 +1,5 @@
/**
- * $Id: css.c,v 1.2 2002/05/04 21:17:06 bursa Exp $
+ * $Id: css.c,v 1.3 2002/05/18 08:23:39 bursa Exp $
*/
#include <string.h>
@@ -66,6 +66,15 @@ const struct css_style css_empty_style = {
{ CSS_WIDTH_AUTO }
};
+const struct css_style css_blank_style = {
+ CSS_DISPLAY_BLOCK,
+ CSS_FLOAT_NONE,
+ { CSS_FONT_SIZE_INHERIT },
+ { CSS_HEIGHT_AUTO },
+ { CSS_WIDTH_AUTO }
+};
+
+
/**
* property parsers
@@ -311,12 +320,17 @@ void css_get_style(struct css_stylesheet * stylesheet, struct css_selector * sel
}
}
- qsort(decl, decls, sizeof(struct decl), (int (*) (const void *, const void *)) cmpdecl);
+ if (decls == 0) {
+ css_cascade(style, &css_blank_style);
- for (d = 0; d < decls; d++) {
-/* printf("%i: 0x%lx\n", d, decl[d].score); */
-/* css_dump_rule(decl[d].rule); */
- css_cascade(style, decl[d].rule->style);
+ } else {
+ qsort(decl, decls, sizeof(struct decl), (int (*) (const void *, const void *)) cmpdecl);
+
+ for (d = 0; d < decls; d++) {
+/* printf("%i: 0x%lx\n", d, decl[d].score); */
+/* css_dump_rule(decl[d].rule); */
+ css_cascade(style, decl[d].rule->style);
+ }
}
}