summaryrefslogtreecommitdiff
path: root/css
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-01-22 10:53:14 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-01-22 10:53:14 +0000
commit61489da9405ea5f3a2ea7fc8fe828f5296c1e0ea (patch)
tree796033dd069c56505dd0dc6adc9739623931f6f2 /css
parent4c40bbc0962d8ac5800a374ed19fbb261dd329c6 (diff)
downloadnetsurf-61489da9405ea5f3a2ea7fc8fe828f5296c1e0ea.tar.gz
netsurf-61489da9405ea5f3a2ea7fc8fe828f5296c1e0ea.tar.bz2
Handle no units in CSS as px. This is a temporary measure until the new CSS parser is used, which will handle this properly.
svn path=/trunk/netsurf/; revision=6173
Diffstat (limited to 'css')
-rw-r--r--css/ruleset.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/css/ruleset.c b/css/ruleset.c
index d04f62359..30d8c8ffd 100644
--- a/css/ruleset.c
+++ b/css/ruleset.c
@@ -658,15 +658,19 @@ int parse_length(struct css_length * const length,
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)