[svn r32] missing font-family token loop in font shorthand parsing trunk
authordglazman
Mon, 15 Mar 2010 07:35:07 -0500
branchtrunk
changeset 28 7e973fc72b2c
parent 27 f4a1067b7074
child 29 33de0b974ff6
[svn r32] missing font-family token loop in font shorthand parsing
cssParser.js
demo.xhtml
--- a/cssParser.js	Mon Mar 15 07:30:07 2010 -0500
+++ b/cssParser.js	Mon Mar 15 07:35:07 2010 -0500
@@ -1506,6 +1506,12 @@
             while (true) {
               if (!token.isNotNull())
                 break;
+				      else if (token.isSymbol(";")
+				          || (aAcceptPriority && token.isSymbol("!"))
+				          || token.isSymbol("}")) {
+			          this.ungetToken();
+				        break;
+				      }
               else if (token.isIdent() && token.value in kFamily) {
                 fFamily += token.value;
                 break;
@@ -1521,6 +1527,7 @@
               else
                 return "";
             }
+            token = this.getToken(true, true);
           }
 
           else {
--- a/demo.xhtml	Mon Mar 15 07:30:07 2010 -0500
+++ b/demo.xhtml	Mon Mar 15 07:35:07 2010 -0500
@@ -7,7 +7,7 @@
 @media screen,projection,print {/* comment inside a media rule */pre { background-color: #FFFFCC;
 /* comment between two declarations */<a ></a>border: 2px silver solid; padding: 1em; -moz-border-radius: 11px;
 -webkit-border-radius:11px}
-body { font: sans-serif; font-family: sans-serif; margin: 1em }
+body { font: "Courier New", sans-serif; font-family: sans-serif; margin: 1em }
 /* comment between two style rules */
 h1 { background-color: silver }
 h2 { background-color: lightgrey }