Author: jmb
Date: Fri Jan 23 17:58:26 2009
New Revision: 6209

URL: http://source.netsurf-browser.org?rev=6209&view=rev
Log:
Require comma separator in font-family and voice-family.
There's a potential quirk required here to match Mozilla, at the very least.

Modified:
    trunk/libcss/src/parse/properties.c

Modified: trunk/libcss/src/parse/properties.c
URL: 
http://source.netsurf-browser.org/trunk/libcss/src/parse/properties.c?rev=6209&r1=6208&r2=6209&view=diff
==============================================================================
--- trunk/libcss/src/parse/properties.c (original)
+++ trunk/libcss/src/parse/properties.c Fri Jan 23 17:58:26 2009
@@ -2624,10 +2624,13 @@
        int temp_ctx = *ctx;
        uint8_t *ptr;
 
-       /* [ IDENT+ | STRING ] [ ','? [ IDENT+ | STRING ] ]* | IDENT(inherit)
+       /* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit)
         * 
         * In the case of IDENT+, any whitespace between tokens is collapsed to
         * a single space
+        *
+        * \todo Mozilla makes the comma optional. 
+        * Perhaps this is a quirk we should inherit?
         */
 
        /* Pass 1: validate input and calculate space */
@@ -2722,6 +2725,11 @@
                        consumeWhitespace(vector, &temp_ctx);
 
                        token = parserutils_vector_peek(vector, temp_ctx);
+                       if (token != NULL && tokenIsChar(token, ',') == false &&
+                                       tokenIsChar(token, '!') == false) {
+                               return CSS_INVALID;
+                       }
+
                        if (token != NULL && tokenIsChar(token, ',')) {
                                parserutils_vector_iterate(vector, &temp_ctx);
 
@@ -2907,6 +2915,13 @@
                        consumeWhitespace(vector, ctx);
 
                        token = parserutils_vector_peek(vector, *ctx);
+                       if (token != NULL && tokenIsChar(token, ',') == false &&
+                                       tokenIsChar(token, '!') == false) {
+                               css_stylesheet_style_destroy(c->sheet, *result);
+                               *result = NULL;
+                               return CSS_INVALID;
+                       }
+
                        if (token != NULL && tokenIsChar(token, ',')) {
                                parserutils_vector_iterate(vector, ctx);
 
@@ -5766,7 +5781,7 @@
        int temp_ctx = *ctx;
        uint8_t *ptr;
 
-       /* [ IDENT+ | STRING ] [ ','? [ IDENT+ | STRING ] ]* | IDENT(inherit)
+       /* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit)
         * 
         * In the case of IDENT+, any whitespace between tokens is collapsed to
         * a single space
@@ -5851,6 +5866,11 @@
                        consumeWhitespace(vector, &temp_ctx);
 
                        token = parserutils_vector_peek(vector, temp_ctx);
+                       if (token != NULL && tokenIsChar(token, ',') == false &&
+                                       tokenIsChar(token, '!') == false) {
+                               return CSS_INVALID;
+                       }
+
                        if (token != NULL && tokenIsChar(token, ',')) {
                                parserutils_vector_iterate(vector, &temp_ctx);
 
@@ -6029,6 +6049,13 @@
                        consumeWhitespace(vector, ctx);
 
                        token = parserutils_vector_peek(vector, *ctx);
+                       if (token != NULL && tokenIsChar(token, ',') == false &&
+                                       tokenIsChar(token, '!') == false) {
+                               css_stylesheet_style_destroy(c->sheet, *result);
+                               *result = NULL;
+                               return CSS_INVALID;
+                       }
+
                        if (token != NULL && tokenIsChar(token, ',')) {
                                parserutils_vector_iterate(vector, ctx);
 


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

Reply via email to