[svn r34] crasher in font shorthand trunk
authordglazman
Mon, 15 Mar 2010 07:41:26 -0500
branchtrunk
changeset 30 274a7a689b7f
parent 29 33de0b974ff6
child 31 82da90f0de2c
[svn r34] crasher in font shorthand
cssParser.js
demo.xhtml
--- a/cssParser.js	Mon Mar 15 07:36:37 2010 -0500
+++ b/cssParser.js	Mon Mar 15 07:41:26 2010 -0500
@@ -1477,14 +1477,15 @@
   
           else if (!fSize
                    && ((token.isIdent() && (token.value in kSize))
-                       || token.isDimension())) {
+                       || token.isDimension()
+                       || token.isPercentage())) {
             fSize = token.value;
             var token = this.getToken(false, false);
-            if (nextToken.isSymbol("/")) {
+            if (token.isSymbol("/")) {
               token = this.getToken(false, false);
               if (!fLineHeight &&
                   (token.isDimension() || token.isNumber() || token.isPercentage())) {
-                fLineheight = token.value;
+                fLineHeight = token.value;
               }
               else
                 return "";
--- a/demo.xhtml	Mon Mar 15 07:36:37 2010 -0500
+++ b/demo.xhtml	Mon Mar 15 07:41:26 2010 -0500
@@ -7,7 +7,8 @@
 @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: "Courier New", sans-serif; font-family: sans-serif; margin: 1em }
+body { font-family: sans-serif; margin: 1em }
+.foo { font: normal small-caps 120%/120% fantasy; }
 /* comment between two style rules */
 h1 { background-color: silver }
 h2 { background-color: lightgrey }