aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Henty <onepoint@starurchin.org>2010-11-21 21:11:37 +0000
committerJeremy Henty <onepoint@starurchin.org>2010-11-21 21:11:37 +0000
commit80e2bcf67331dc18a2776f98e7103bbeb70cd667 (patch)
tree2be7f22bc4f0dd68dec45ff3dd5262ecb7ad508a /src
parent5481cb720e47bcde3e48609270669b2933d0601c (diff)
imported patch ignore-unknown-at-rules-0
Diffstat (limited to 'src')
-rw-r--r--src/cssparser.cc45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc
index 7d5e3ae3..ed880d17 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -1416,32 +1416,26 @@ void CssParser::parseImport(DilloHtml *html, DilloUrl *baseUrl)
{
char *urlStr = NULL;
- if (html != NULL &&
- ttype == CSS_TK_SYMBOL &&
- dStrcasecmp(tval, "import") == 0) {
- nextToken();
-
- if (ttype == CSS_TK_SYMBOL &&
- dStrcasecmp(tval, "url") == 0)
- urlStr = parseUrl();
- else if (ttype == CSS_TK_STRING)
- urlStr = dStrdup (tval);
+ 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 ||
+ /* 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);
- }
+ 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);
}
}
@@ -1458,7 +1452,12 @@ void CssParser::parse(DilloHtml *html, DilloUrl *url, CssContext * context,
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)