changeset 1767:1bccd1243740

imported patch ignore-unknown-at-rules-0
author Jeremy Henty <onepoint@starurchin.org>
date Sun, 21 Nov 2010 21:11:37 +0000
parents 5b50b51efa06
children 81876ff46376
files src/cssparser.cc
diffstat 1 files changed, 23 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/cssparser.cc	Fri Nov 19 17:44:38 2010 +0000
+++ b/src/cssparser.cc	Sun Nov 21 21:11:37 2010 +0000
@@ -1416,32 +1416,26 @@
 {
    char *urlStr = NULL;
 
-   if (html != NULL &&
-      ttype == CSS_TK_SYMBOL &&
-      dStrcasecmp(tval, "import") == 0) {
+   if (ttype == CSS_TK_SYMBOL &&
+       dStrcasecmp(tval, "url") == 0)
+      urlStr = parseUrl();
+   else if (ttype == CSS_TK_STRING)
+      urlStr = dStrdup (tval);
+
+   /* Skip all tokens until the expected end. */
+   while (!(ttype == CSS_TK_END ||
+            (ttype == CSS_TK_CHAR && (tval[0] == ';'))))
       nextToken();
 
-      if (ttype == CSS_TK_SYMBOL &&
-         dStrcasecmp(tval, "url") == 0)
-         urlStr = parseUrl();
-      else if (ttype == CSS_TK_STRING)
-         urlStr = dStrdup (tval);
+   nextToken();
 
-      /* Skip all tokens until the expected end. */
-      while (!(ttype == CSS_TK_END ||
-            (ttype == CSS_TK_CHAR && (tval[0] == ';'))))
-         nextToken();
-
-      nextToken();
-
-      if (urlStr) {
-         MSG("CssParser::parseImport(): @import %s\n", urlStr);
-         DilloUrl *url = a_Html_url_new (html, urlStr, a_Url_str(baseUrl),
-                                         baseUrl ? 1 : 0);
-         a_Html_load_stylesheet(html, url);
-         a_Url_free(url);
-         dFree (urlStr);
-      }
+   if (urlStr) {
+      MSG("CssParser::parseImport(): @import %s\n", urlStr);
+      DilloUrl *url = a_Html_url_new (html, urlStr, a_Url_str(baseUrl),
+                                      baseUrl ? 1 : 0);
+      a_Html_load_stylesheet(html, url);
+      a_Url_free(url);
+      dFree (urlStr);
    }
 }
 
@@ -1458,7 +1452,12 @@
 
    while (parser.ttype == CSS_TK_CHAR && parser.tval[0] == '@') {
       parser.nextToken();
-      parser.parseImport(html, url);
+      if (html != NULL &&
+          parser.ttype == CSS_TK_SYMBOL &&
+          dStrcasecmp(parser.tval, "import") == 0) {
+         parser.nextToken();
+         parser.parseImport(html, url);
+      }
    }
 
    while (parser.ttype != CSS_TK_END)