summaryrefslogtreecommitdiff
path: root/css
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-07-20 13:13:09 +0000
committerJames Bursa <james@netsurf-browser.org>2003-07-20 13:13:09 +0000
commitc17ede41d153ed94aff7842c87bf967e1adcdd03 (patch)
treeefe71172599c3f5ea4b66d35ccc14b68a3163b7d /css
parent3d8c63e366cdfc5f1489baacbc73d974c964798c (diff)
downloadnetsurf-c17ede41d153ed94aff7842c87bf967e1adcdd03.tar.gz
netsurf-c17ede41d153ed94aff7842c87bf967e1adcdd03.tar.bz2
[project @ 2003-07-20 13:13:09 by bursa]
Improve line-height. svn path=/import/netsurf/; revision=239
Diffstat (limited to 'css')
-rw-r--r--css/css.c4
-rw-r--r--css/ruleset.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/css/css.c b/css/css.c
index c894f6678..da82cf9d1 100644
--- a/css/css.c
+++ b/css/css.c
@@ -578,6 +578,8 @@ void css_cascade(struct css_style * const style, const struct css_style * const
style->float_ = apply->float_;
if (apply->height.height != CSS_HEIGHT_INHERIT)
style->height = apply->height;
+ if (apply->line_height.size != CSS_LINE_HEIGHT_INHERIT)
+ style->line_height = apply->line_height;
if (apply->text_align != CSS_TEXT_ALIGN_INHERIT)
style->text_align = apply->text_align;
if (apply->width.width != CSS_WIDTH_INHERIT)
@@ -641,6 +643,8 @@ void css_merge(struct css_style * const style, const struct css_style * const ap
style->float_ = apply->float_;
if (apply->height.height != CSS_HEIGHT_INHERIT)
style->height = apply->height;
+ if (apply->line_height.size != CSS_LINE_HEIGHT_INHERIT)
+ style->line_height = apply->line_height;
if (apply->text_align != CSS_TEXT_ALIGN_INHERIT)
style->text_align = apply->text_align;
if (apply->width.width != CSS_WIDTH_INHERIT)
diff --git a/css/ruleset.c b/css/ruleset.c
index 908b8a2f7..d8eae5ce5 100644
--- a/css/ruleset.c
+++ b/css/ruleset.c
@@ -226,6 +226,8 @@ int compare_selectors(struct node *n0, struct node *n1)
* property parsers
*/
+/* TODO: consider NODE_NUMBER whenever a value may be '0' */
+
int parse_length(struct css_length * const length, const struct node * const v)
{
css_unit u;
@@ -405,6 +407,9 @@ void parse_line_height(struct css_style * const s, const struct node * const v)
} else if (v->type == NODE_DIMENSION &&
parse_length(&s->line_height.value.length, v) == 0) {
s->line_height.size = CSS_LINE_HEIGHT_LENGTH;
+ } else if (v->type == NODE_NUMBER && atof(v->data) == 0.0) {
+ s->line_height.size = CSS_LINE_HEIGHT_ABSOLUTE;
+ s->line_height.value.absolute = 0.0;
}
}