mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 00:40:15 +03:00
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
This commit is contained in:
parent
4c40bbc096
commit
61489da940
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user