Author: rjw
Date: Tue Aug 15 20:20:36 2006
New Revision: 2851
URL:
http://svn.semichrome.net?rev=2851&view=rev
Log:
Treat unitless CSS values as pixels (fix 1527056)
Modified:
trunk/netsurf/css/ruleset.c
Modified: trunk/netsurf/css/ruleset.c
URL:
http://svn.semichrome.net/trunk/netsurf/css/ruleset.c?rev=2851&r1=285...
==============================================================================
--- trunk/netsurf/css/ruleset.c (original)
+++ trunk/netsurf/css/ruleset.c Tue Aug 15 20:20:36 2006
@@ -622,12 +622,17 @@
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;