mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 09:44:24 +03:00
[project @ 2002-05-18 08:23:39 by bursa]
Added css_blank_style. svn path=/import/netsurf/; revision=16
This commit is contained in:
parent
600f3ad557
commit
1ff128beaf
16
render/css.c
16
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,6 +320,10 @@ void css_get_style(struct css_stylesheet * stylesheet, struct css_selector * sel
|
||||
}
|
||||
}
|
||||
|
||||
if (decls == 0) {
|
||||
css_cascade(style, &css_blank_style);
|
||||
|
||||
} else {
|
||||
qsort(decl, decls, sizeof(struct decl), (int (*) (const void *, const void *)) cmpdecl);
|
||||
|
||||
for (d = 0; d < decls; d++) {
|
||||
@ -318,6 +331,7 @@ void css_get_style(struct css_stylesheet * stylesheet, struct css_selector * sel
|
||||
/* css_dump_rule(decl[d].rule); */
|
||||
css_cascade(style, decl[d].rule->style);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void update_style(struct css_stylesheet * stylesheet, struct css_selector * selector,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: layout.c,v 1.2 2002/05/11 15:22:24 bursa Exp $
|
||||
* $Id: layout.c,v 1.3 2002/05/18 08:23:39 bursa Exp $
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -98,6 +98,9 @@ unsigned long layout_block_children(struct box * box, unsigned long width)
|
||||
y += c->height;
|
||||
break;
|
||||
default:
|
||||
printf("%s -> %s\n",
|
||||
box->node ? box->node->name : "()",
|
||||
c->node ? c->node->name : "()");
|
||||
die("block child not block, table, or inline container");
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: render.c,v 1.9 2002/05/11 15:22:24 bursa Exp $
|
||||
* $Id: render.c,v 1.10 2002/05/18 08:23:39 bursa Exp $
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
||||
doc_box->node = c;
|
||||
xml_to_box(c, style, stylesheet, &selector, 0, doc_box, 0);
|
||||
html_box = doc_box->children;
|
||||
/* box_dump(html_box, 0);*/
|
||||
/*box_dump(html_box, 0);*/
|
||||
|
||||
layout_block(html_box, 600);
|
||||
/* box_dump(html_box, 0);*/
|
||||
|
Loading…
Reference in New Issue
Block a user