diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-08-15 19:20:36 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-08-15 19:20:36 +0000 |
commit | 8852cdd1099e27cf9bf05212a67b58d197b0ff4b (patch) | |
tree | 340352637c1f2eda11d69a75a37f67feb680a237 | |
parent | 844e6de6a9e28b1eae26e1d8017921462a76f068 (diff) | |
download | netsurf-8852cdd1099e27cf9bf05212a67b58d197b0ff4b.tar.gz netsurf-8852cdd1099e27cf9bf05212a67b58d197b0ff4b.tar.bz2 |
Treat unitless CSS values as pixels (fix 1527056)
svn path=/trunk/netsurf/; revision=2851
-rw-r--r-- | css/ruleset.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/css/ruleset.c b/css/ruleset.c index cac548514..0f649d137 100644 --- a/css/ruleset.c +++ b/css/ruleset.c @@ -622,12 +622,17 @@ int parse_length(struct css_length * const length, length->value = 0; return 0; } - if (v->type != CSS_NODE_DIMENSION) + if ((v->type != CSS_NODE_DIMENSION) && (v->type != CSS_NODE_NUMBER)) return 1; num_length = strspn(v->data, "0123456789+-."); - u = css_unit_parse(v->data + num_length, v->data_length - num_length); - if (u == CSS_UNIT_UNKNOWN) - return 1; + if (v->type == CSS_NODE_DIMENSION) + u = css_unit_parse(v->data + num_length, v->data_length - num_length); + if (u == CSS_UNIT_UNKNOWN) { + return 1; + } + } else { + u = CSS_UNIT_PX; + } value = atof(v->data); if (non_negative && value < 0) return 1; |