Author: toad Date: 2006-09-28 16:56:06 +0000 (Thu, 28 Sep 2006) New Revision: 10546
Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex Log: Minor CSS fixes (relating to whitespace) Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2006-09-28 16:33:27 UTC (rev 10545) +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2006-09-28 16:56:06 UTC (rev 10546) @@ -1,5 +1,8 @@ -/* The following code was generated by JFlex 1.4.1 on 28/09/06 17:29 */ +/* The following code was generated by JFlex 1.4.1 on 28/09/06 17:52 */ +/* This code is part of Freenet. It is distributed under the GNU General + * Public License, version 2 (or at your option any later version). See + * http://www.gnu.org/ for further details of the GPL. */ package freenet.clients.http.filter; import java.io.*; import java.util.*; @@ -11,7 +14,7 @@ /** * This class is a scanner generated by * <a href="http://www.jflex.de/">JFlex</a> 1.4.1 - * on 28/09/06 17:29 from the specification file + * on 28/09/06 17:52 from the specification file * <tt>freenet/clients/http/filter/CSSTokenizerFilter.jflex</tt> */ class CSSTokenizerFilter { @@ -1233,49 +1236,56 @@ if(debug) log("Matched open braces: "+s); } case 41: break; + case 26: + { String s = yytext(); + s = s.substring("@media".length()).trim(); + w.write("@media "+s+" "); + if(debug) log("Matched @media: "+s); + } + case 42: break; case 2: { String s = yytext(); w.write(s); if(debug) log("Matched ident: "+s); } - case 42: break; + case 43: break; case 23: { String s = yytext(); w.write(s); if(debug) log("Matched unicode range: "+s); } - case 43: break; + case 44: break; case 28: { String s = yytext(); w.write(s); if(debug) log("Matched @font-face: "+s); } - case 44: break; + case 45: break; case 9: { String s = yytext(); if(s.startsWith("url")) throwError("Invalid contents of url()"); w.write(s); if(debug) log("Matched function start: "+s); } - case 45: break; + case 46: break; case 17: { String s = yytext(); w.write(s); if(debug) log("Matched HTML comment: "+s); } - case 46: break; + case 47: break; case 3: { String s = yytext(); w.write(s); if(debug) log("Matched whitespace: "+s); } - case 47: break; + case 48: break; case 22: { String s = yytext(); if(debug) log("Ignoring unrecognizable url: "+s); w.write("/* Ignoring unmatchable URL */url()"); } - case 48: break; + case 49: break; case 27: { String s = yytext(); if(debug) log("Found @import: "+s); @@ -1296,13 +1306,13 @@ } else if(debug) log("Dropped @import"); } - case 49: break; + case 50: break; case 29: { String s = yytext(); w.write(s); if(debug) log("Matched important: "+s); } - case 50: break; + case 51: break; case 20: { String s = yytext(); StringBuffer sb = new StringBuffer(s.length()); @@ -1327,7 +1337,7 @@ w.write(sb.toString()); if(debug) log("Matched comment: "+s+" -> "+sb.toString()); } - case 51: break; + case 52: break; case 25: { // This is horrible. However it seems that there is no other way to do it with either jflex or CUP, as {URL} cannot be an unambiguous token :( String s = yytext(); @@ -1356,26 +1366,26 @@ w.write(s); } } - case 52: break; + case 53: break; case 11: { String s = yytext(); w.write(s); if(debug) log("Matched measurement: "+s); } - case 53: break; + case 54: break; case 16: { String s = yytext(); w.write(s); if(debug) log("Matched |=: "+s); } - case 54: break; + case 55: break; case 30: { String s = yytext(); detectedCharset = s; if(debug) log("Matched and ignoring charset: "+s); // Ignore } - case 55: break; + case 56: break; case 10: { if(postBadImportFlag) { // Ignore @@ -1388,13 +1398,6 @@ if(debug) log("Matched and passing on mediums list: "+s); } } - case 56: break; - case 26: - { String s = yytext(); - s = s.substring("@media".length()).trim(); - w.write("@media "+s); - if(debug) log("Matched @media: "+s); - } case 57: break; case 4: { String s = yytext(); Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex 2006-09-28 16:33:27 UTC (rev 10545) +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex 2006-09-28 16:56:06 UTC (rev 10546) @@ -1,3 +1,6 @@ +/* This code is part of Freenet. It is distributed under the GNU General + * Public License, version 2 (or at your option any later version). See + * http://www.gnu.org/ for further details of the GPL. */ package freenet.clients.http.filter; import java.io.*; import java.util.*; @@ -351,10 +354,10 @@ w.write(s); if(debug) log("Matched @page: "+s); } -"@media"{W}{MEDIUMS} { +"@media"{W}{MEDIUMS}{W} { String s = yytext(); s = s.substring("@media".length()).trim(); - w.write("@media "+s); + w.write("@media "+s+" "); if(debug) log("Matched @media: "+s); } "@font-face" { @@ -367,7 +370,7 @@ w.write(s); if(debug) log("Matched #name: "+s); } -"!"{W}"important" { +"!"{W}*"important" { String s = yytext(); w.write(s); if(debug) log("Matched important: "+s);
