mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 21:16:50 +03:00
[project @ 2003-07-20 13:13:09 by bursa]
Improve line-height. svn path=/import/netsurf/; revision=239
This commit is contained in:
parent
3d8c63e366
commit
c17ede41d1
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user