diff options
-rw-r--r-- | css/css.c | 9 | ||||
-rw-r--r-- | css/ruleset.c | 7 |
2 files changed, 7 insertions, 9 deletions
@@ -1655,8 +1655,7 @@ void css_dump_style(const struct css_style * const style) if (style->background_attachment == CSS_BACKGROUND_ATTACHMENT_UNKNOWN) fprintf(stderr, " UNKNOWN"); - else if (style->background_repeat == - CSS_BACKGROUND_ATTACHMENT_NOT_SET) + else if (style->background_attachment == CSS_BACKGROUND_ATTACHMENT_NOT_SET) ; else fprintf(stderr, " %s", @@ -1959,10 +1958,10 @@ void css_dump_style(const struct css_style * const style) css_list_style_type_name[ style->list_style_type]); - if (style->list_style_type == + if (style->list_style_position == CSS_LIST_STYLE_POSITION_UNKNOWN) fprintf(stderr, " UNKNOWN"); - else if (style->list_style_type == + else if (style->list_style_position == CSS_LIST_STYLE_POSITION_NOT_SET) ; else @@ -2435,7 +2434,7 @@ void css_dump_style(const struct css_style * const style) void css_dump_length(const struct css_length * const length) { - if (length->value == 0) + if (fabs(length->value) < 0.0001) fprintf(stderr, "0"); else fprintf(stderr, "%g%s", length->value, diff --git a/css/ruleset.c b/css/ruleset.c index 8b87dbfde..ddf639eaa 100644 --- a/css/ruleset.c +++ b/css/ruleset.c @@ -653,7 +653,7 @@ int parse_length(struct css_length * const length, css_unit u; float value; int num_length; - if (v->type == CSS_NODE_NUMBER && atof(v->data) == 0) { + if (v->type == CSS_NODE_NUMBER && fabs(atof(v->data)) < 0.0001) { length->unit = CSS_UNIT_PX; length->value = 0; return 0; @@ -1688,9 +1688,8 @@ void parse_clip(struct css_style * const s, const struct css_node * v) for (i = 0; i != 4; i++) { switch (t->type) { case CSS_NODE_IDENT: - if (t->data_length == 4 && - strncasecmp(t->data, "auto", 4) == 0) { - rect[i].rect = CSS_CLIP_AUTO; + if (t->data_length == 4 && strncasecmp(t->data, "auto", 4) == 0) { + rect[i].rect = CSS_CLIP_RECT_AUTO; } else return; |