[patch]: CSS parser cleanup
Just some small cleanup and refactoring of the CSS parser code. Any reason not to push these? Regards, Jeremy Henty
Jeremy wrote:
diff -r 6276951c09ca -r 863857740f7f src/cssparser.cc --- a/src/cssparser.cc Sun Dec 05 16:45:24 2010 +0000 +++ b/src/cssparser.cc Sun Dec 05 18:50:21 2010 +0000 @@ -1422,12 +1422,7 @@ 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(); - - nextToken(); + ignoreStatement();
if (urlStr) { MSG("CssParser::parseImport(): @import %s\n", urlStr);
I just wanted to mention that CSS2 says that there can be media types after the URL there...
On Tue, Dec 14, 2010 at 02:10:49AM +0000, corvid wrote:
Jeremy wrote:
diff -r 6276951c09ca -r 863857740f7f src/cssparser.cc --- a/src/cssparser.cc Sun Dec 05 16:45:24 2010 +0000 +++ b/src/cssparser.cc Sun Dec 05 18:50:21 2010 +0000 @@ -1422,12 +1422,7 @@ 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(); - - nextToken(); + ignoreStatement();
if (urlStr) { MSG("CssParser::parseImport(): @import %s\n", urlStr);
I just wanted to mention that CSS2 says that there can be media types after the URL there...
Next on the TO DO list! But I don't think this patch will block implementing that - just call nextToken() before ignoreStatement() and do the right thing if it's a string. Regards, Jeremy Henty
participants (2)
-
corvid@lavabit.com
-
onepoint@starurchin.org