Author: tlsa
Date: Thu Jan 22 04:53:14 2009
New Revision: 6173

URL: http://source.netsurf-browser.org?rev=6173&view=rev
Log:
Handle no units in CSS as px. This is a temporary measure until the new CSS 
parser is used, which will handle this properly.

Modified:
    trunk/netsurf/css/ruleset.c

Modified: trunk/netsurf/css/ruleset.c
URL: 
http://source.netsurf-browser.org/trunk/netsurf/css/ruleset.c?rev=6173&r1=6172&r2=6173&view=diff
==============================================================================
--- trunk/netsurf/css/ruleset.c (original)
+++ trunk/netsurf/css/ruleset.c Thu Jan 22 04:53:14 2009
@@ -658,15 +658,19 @@
                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)


_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to