summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2007-10-28 17:01:53 +0000
committerJames Bursa <james@netsurf-browser.org>2007-10-28 17:01:53 +0000
commitaa24cdff0d5f1030902b9ce549cd71cb5b14b09b (patch)
tree1dd42a47d57003ad26c45b37b292a2b51f16ab55
parentaff93727ab348c2347fe089b50c610e150ac59af (diff)
downloadnetsurf-aa24cdff0d5f1030902b9ce549cd71cb5b14b09b.tar.gz
netsurf-aa24cdff0d5f1030902b9ce549cd71cb5b14b09b.tar.bz2
Bug fixes in parse_length, parse_clip, css_dump_style, css_dump_length by Franz Korntner.
svn path=/trunk/netsurf/; revision=3635
-rw-r--r--css/css.c9
-rw-r--r--css/ruleset.c7
2 files changed, 7 insertions, 9 deletions
diff --git a/css/css.c b/css/css.c
index e3b696cc0..8527a3b39 100644
--- a/css/css.c
+++ b/css/css.c
@@ -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;