--- a/cssParser.js Tue Mar 16 03:51:11 2010 -0500
+++ b/cssParser.js Tue Mar 16 04:15:42 2010 -0500
@@ -1001,9 +1001,16 @@
break;
}
- if (!value && token.isIdent(this.kINHERIT)) {
- value += token.value;
- break;
+ if (token.isIdent(this.kINHERIT)) {
+ token = this.getToken(true, true);
+ if (value) {
+ value = "";
+ break;
+ }
+ else {
+ value += token.value;
+ break;
+ }
}
else if (token.isSymbol("{")
|| token.isSymbol("(")
@@ -1058,12 +1065,10 @@
break;
}
- else if (!top && !bottom && !left && !right
- && token.isIdent(this.kINHERIT)) {
- top = this.kINHERIT;
- bottom = this.kINHERIT;
- left = this.kINHERIT;
- right = this.kINHERIT;
+ else if (!values.length && token.isIdent(this.kINHERIT)) {
+ values.push(token.value);
+ token = this.getToken(true, true);
+ break;
}
else if (token.isDimension()
@@ -1136,11 +1141,10 @@
break;
}
- else if (this.isIdent(this.kINHERIT)) {
- top = this.kINHERIT;
- bottom = this.kINHERIT;
- left = this.kINHERIT;
- right = this.kINHERIT;
+ else if (!values.length && this.isIdent(this.kINHERIT)) {
+ values.push(token.value);
+ token = this.getToken(true, true);
+ break;
}
else {
@@ -1211,15 +1215,14 @@
break;
}
- else if (!before && !after
- && token.isIdent(this.kINHERIT)) {
- before = this.kINHERIT;
- after = this.kINHERIT;
+ else if (!values.length && token.isIdent(this.kINHERIT)) {
+ values.push(token.value);
}
else if (token.isIdent("none"))
values.push(token.value);
- else if (token.isFunction("url(")) {
+
+ else if (token.isFunction("url(")) {
var token = this.getToken(true, true);
var urlContent = this.parseURL(token);
if (urlContent)
@@ -1272,10 +1275,8 @@
break;
}
- else if (!before && !after
- && token.isIdent(this.kINHERIT)) {
- before = this.kINHERIT;
- after = this.kINHERIT;
+ else if (!values.length && token.isIdent(this.kINHERIT)) {
+ values.push(token.value);
}
else if (token.isDimensionOfUnit("ms")
@@ -1329,12 +1330,8 @@
break;
}
- else if (!top && !bottom && !left && !right
- && token.isIdent(this.kINHERIT)) {
- top = this.kINHERIT;
- bottom = this.kINHERIT;
- left = this.kINHERIT;
- right = this.kINHERIT;
+ else if (!values.length && token.isIdent(this.kINHERIT)) {
+ values.push(token.value);
}
else if (token.isDimension()
@@ -1406,12 +1403,8 @@
break;
}
- else if (!top && !bottom && !left && !right
- && token.isIdent(this.kINHERIT)) {
- top = this.kINHERIT;
- bottom = this.kINHERIT;
- left = this.kINHERIT;
- right = this.kINHERIT;
+ else if (!values.length && token.isIdent(this.kINHERIT)) {
+ values.push(token.value);
}
else if (token.isIdent() && token.value in this.kBORDER_STYLE_NAMES) {
--- a/demo.xhtml Tue Mar 16 03:51:11 2010 -0500
+++ b/demo.xhtml Tue Mar 16 04:15:42 2010 -0500
@@ -8,7 +8,7 @@
/* comment between two declarations */<a ></a>border: 2px silver solid; padding: 1em; -moz-border-radius: 11px;
-webkit-border-radius:11px}
body { font-family: sans-serif; margin: 1em }
-.foo { /* example of font shorthand */font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
+.foo { border-style: inherit }
/* comment between two style rules */
h1 { background-color: silver }
h2 { background-color: lightgrey }