Skip to content

Commit

Permalink
More validations fixes (fixes #219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas C. Zakas committed Jan 5, 2012
1 parent a90d8f2 commit 6b135a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project name="csslint" default="build.all">

<!-- version number -->
<property name="csslint.version" value="0.9.1" />
<property name="csslint.version" value="0.9.2" />

<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
Expand Down
19 changes: 14 additions & 5 deletions lib/parserlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* Version v0.1.2, Build time: 4-January-2012 05:14:28 */
/* Version v0.1.3, Build time: 5-January-2012 09:23:31 */
var parserlib = {};
(function(){

Expand Down Expand Up @@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* Version v0.1.2, Build time: 4-January-2012 05:14:28 */
/* Version v0.1.3, Build time: 5-January-2012 09:23:31 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down Expand Up @@ -3450,8 +3450,8 @@ var Properties = {
"border-bottom-color" : "<color>",
"border-bottom-left-radius" : { single: "<x-one-radius>", complex: true },
"border-bottom-right-radius" : { single: "<x-one-radius>", complex: true },
"border-bottom-style" : "border-style",
"border-bottom-width" : "border-width",
"border-bottom-style" : "<border-style>",
"border-bottom-width" : "<border-width>",
"border-collapse" : "collapse | separate | inherit",
"border-color" : { multi: "<color> | inherit", max: 4 },
"border-image" : 1,
Expand Down Expand Up @@ -5917,6 +5917,7 @@ var Validation = {
//inset? && [ <length>{2,4} && <color>? ]
var result = false,
inset = false,
color = false,
count = 0,
part;

Expand All @@ -5929,6 +5930,14 @@ var Validation = {
inset = true;
}

if (part) {
if (this["<color>"](part)) {
expression.next();
part = expression.peek();
color = true;
}
}

while (part && this["<length>"](part) && count < 4) {
count++;
expression.next();
Expand All @@ -5937,7 +5946,7 @@ var Validation = {


if (part) {
if (this["<color>"](part)) {
if (this["<color>"](part) && !color) {
expression.next();
part = expression.peek();
}
Expand Down

0 comments on commit 6b135a8

Please sign in to comment.