[libcroco-list] @import parse error



There appears to be a problem with CRParser dealing with @import rules,
in that the SEMICOLON_TK token isn't consumed, leading to

@import "file1.css";
@import "file2.css";

not taking notice of the file2.css one.  A following rule is also
ignored and will not be parsed, so

@import "file1.css";

h1 {
	color: red;
}

wouldn't set h1 color to red.

The attached patch fixes this.  I did take a brief look at handling this
in cr_parser_parse_import() but wasn't sure how to deal with it.



David
Index: src/cr-parser.c
===================================================================
RCS file: /cvs/gnome/libcroco/src/cr-parser.c,v
retrieving revision 1.18
diff -u -r1.18 cr-parser.c
--- src/cr-parser.c	13 Feb 2004 23:08:08 -0000	1.18
+++ src/cr-parser.c	23 Feb 2004 09:25:39 -0000
@@ -2975,7 +2975,13 @@
                 if (status == CR_END_OF_INPUT_ERROR)  goto done ;
                 CHECK_PARSING_STATUS (status, TRUE) ;
 
-                if (token && token->type == IMPORT_SYM_TK)
+		if (token && token->type == SEMICOLON_TK)
+		{
+			token = NULL;	
+			cr_parser_try_to_skip_spaces_and_comments 
+                        	        (a_this) ;
+		}
+		else if (token && token->type == IMPORT_SYM_TK)
                 {
                         GList *media_list = NULL ;
                         GString *import_string = NULL ;

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]