From c17ede41d153ed94aff7842c87bf967e1adcdd03 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 20 Jul 2003 13:13:09 +0000 Subject: [project @ 2003-07-20 13:13:09 by bursa] Improve line-height. svn path=/import/netsurf/; revision=239 --- css/css.c | 4 ++++ css/ruleset.c | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'css') 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; } } -- cgit v1.2.3