Skip to content

Commit 9ac0176

Browse files
author
Nicholas C. Zakas
committed
Release 0.8.1
1 parent a22aece commit 9ac0176

File tree

9 files changed

+330
-73
lines changed

9 files changed

+330
-73
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
October 25, 2011 - v0.8.1
2+
3+
* Updated parser and fixed CLI errors (fixes #203 and fixes #205) (Nicholas C. Zakas)
4+
5+
16
October 24, 2011 - v0.8.0
27

38
* Fixup compact format (Nicholas C. Zakas)
@@ -175,3 +180,5 @@ June 15, 2011 - v0.1.0
175180

176181

177182

183+
184+

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project name="csslint" default="build.all">
22

33
<!-- version number -->
4-
<property name="csslint.version" value="0.8.0" />
4+
<property name="csslint.version" value="0.8.1" />
55

66
<!-- the directories containing the source files -->
77
<property name="src.dir" value="./src" />

release/csslint-node.js

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Build time: 24-October-2011 03:14:38 */
24+
/* Build time: 25-October-2011 09:25:06 */
2525

2626
/*!
2727
Parser-Lib
@@ -46,7 +46,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
4646
THE SOFTWARE.
4747
4848
*/
49-
/* Build time: 21-October-2011 04:48:14 */
49+
/* Build time: 25-October-2011 09:11:57 */
5050
var parserlib = {};
5151
(function(){
5252

@@ -955,7 +955,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
955955
THE SOFTWARE.
956956
957957
*/
958-
/* Build time: 21-October-2011 04:48:14 */
958+
/* Build time: 25-October-2011 09:11:57 */
959959
(function(){
960960
var EventTarget = parserlib.util.EventTarget,
961961
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3429,6 +3429,10 @@ var ValidationType = {
34293429
return part.type == "color" || part == "transparent";
34303430
},
34313431

3432+
"number": function(part){
3433+
return part.type == "number" || this.integer(part);
3434+
},
3435+
34323436
"integer": function(part){
34333437
return part.type == "integer";
34343438
},
@@ -3516,13 +3520,13 @@ var Properties = {
35163520
"border-bottom-style": [ "border-style" ],
35173521
"border-bottom-width": [ "border-width" ],
35183522
"border-collapse": [ "collapse | separate | inherit" ],
3519-
"border-color": [ "color", "inherit" ],
3523+
"border-color": { multi: [ "color", "inherit" ], max: 4 },
35203524
"border-image": 1,
3521-
"border-image-outset": 1,
3522-
"border-image-repeat": 1,
3525+
"border-image-outset": { multi: [ "length", "number" ], max: 4 },
3526+
"border-image-repeat": { multi: [ "stretch | repeat | round" ], max: 2 },
35233527
"border-image-slice": 1,
35243528
"border-image-source": [ "image", "none" ],
3525-
"border-image-width": 1,
3529+
"border-image-width": { multi: [ "length", "percentage", "number", "auto" ], max: 4 },
35263530
"border-left": 1,
35273531
"border-left-color": [ "color", "inherit" ],
35283532
"border-left-style": [ "border-style" ],
@@ -3533,14 +3537,14 @@ var Properties = {
35333537
"border-right-style": [ "border-style" ],
35343538
"border-right-width": [ "border-width" ],
35353539
"border-spacing": 1,
3536-
"border-style": 1,
3540+
"border-style": { multi: [ "border-style" ], max: 4 },
35373541
"border-top": 1,
35383542
"border-top-color": [ "color", "inherit" ],
35393543
"border-top-left-radius": 1,
35403544
"border-top-right-radius": 1,
35413545
"border-top-style": [ "border-style" ],
35423546
"border-top-width": [ "border-width" ],
3543-
"border-width": 1,
3547+
"border-width": { multi: [ "border-width" ], max: 4 },
35443548
"bottom": [ "margin-width", "inherit" ],
35453549
"box-align": [ "start | end | center | baseline | stretch" ], //http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/
35463550
"box-decoration-break": [ "slice |clone" ],
@@ -3659,7 +3663,7 @@ var Properties = {
36593663
"list-style-type": [ "disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit" ],
36603664

36613665
//M
3662-
"margin": 1,
3666+
"margin": { multi: [ "margin-width", "inherit" ], max: 4 },
36633667
"margin-bottom": [ "margin-width", "inherit" ],
36643668
"margin-left": [ "margin-width", "inherit" ],
36653669
"margin-right": [ "margin-width", "inherit" ],
@@ -3699,7 +3703,7 @@ var Properties = {
36993703
"overflow-y": 1,
37003704

37013705
//P
3702-
"padding": 1,
3706+
"padding": { multi: [ "padding-width", "inherit" ], max: 4 },
37033707
"padding-bottom": [ "padding-width", "inherit" ],
37043708
"padding-left": [ "padding-width", "inherit" ],
37053709
"padding-right": [ "padding-width", "inherit" ],
@@ -3841,6 +3845,51 @@ var Properties = {
38413845
}
38423846
};
38433847
})(Properties[prop]);
3848+
} else if (typeof Properties[prop] == "object"){
3849+
Properties[prop] = (function(spec){
3850+
return function(value){
3851+
var valid,
3852+
i, len, j, count,
3853+
msg,
3854+
values,
3855+
parts = value.parts;
3856+
3857+
if (spec.max) {
3858+
if (parts.length > spec.max){
3859+
throw new ValidationError("Expected a max of " + spec.max + " property values but found " + parts.length + ".", value.line, value.col);
3860+
}
3861+
}
3862+
3863+
if (spec.multi){
3864+
values = spec.multi;
3865+
}
3866+
3867+
for (i=0, len=parts.length; i < len; i++){
3868+
msg = [];
3869+
valid = false;
3870+
for (j=0, count=values.length; j < count; j++){
3871+
if (typeof ValidationType[values[j]] == "undefined"){
3872+
if(ValidationType.identifier(parts[i], values[j])){
3873+
valid = true;
3874+
break;
3875+
}
3876+
msg.push("one of (" + values[j] + ")");
3877+
} else {
3878+
if (ValidationType[values[j]](parts[i])){
3879+
valid = true;
3880+
break;
3881+
}
3882+
msg.push(values[j]);
3883+
}
3884+
}
3885+
3886+
if (!valid) {
3887+
throw new ValidationError("Expected " + msg.join(" or ") + " but found '" + parts[i] + "'.", value.line, value.col);
3888+
}
3889+
}
3890+
3891+
};
3892+
})(Properties[prop]);
38443893
}
38453894
}
38463895
}
@@ -5574,7 +5623,7 @@ var CSSLint = (function(){
55745623
formatters = [],
55755624
api = new parserlib.util.EventTarget();
55765625

5577-
api.version = "0.8.0";
5626+
api.version = "0.8.1";
55785627

55795628
//-------------------------------------------------------------------------
55805629
// Rule Management
@@ -5689,15 +5738,16 @@ var CSSLint = (function(){
56895738
underscoreHack: true, strict: false });
56905739

56915740
lines = text.split(/\n\r?/g);
5692-
reporter = new Reporter(lines, ruleset);
5693-
5741+
56945742
if (!ruleset){
56955743
ruleset = {};
56965744
while (i < len){
56975745
ruleset[rules[i++].id] = 1; //by default, everything is a warning
56985746
}
56995747
}
57005748

5749+
reporter = new Reporter(lines, ruleset);
5750+
57015751
ruleset.errors = 2; //always report parsing errors as errors
57025752
for (i in ruleset){
57035753
if(ruleset.hasOwnProperty(i)){

release/csslint-rhino.js

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Build time: 24-October-2011 03:14:38 */
24+
/* Build time: 25-October-2011 09:25:06 */
2525
var CSSLint = (function(){
2626

2727
/*!
@@ -47,7 +47,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
4747
THE SOFTWARE.
4848
4949
*/
50-
/* Build time: 21-October-2011 04:48:14 */
50+
/* Build time: 25-October-2011 09:11:57 */
5151
var parserlib = {};
5252
(function(){
5353

@@ -956,7 +956,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
956956
THE SOFTWARE.
957957
958958
*/
959-
/* Build time: 21-October-2011 04:48:14 */
959+
/* Build time: 25-October-2011 09:11:57 */
960960
(function(){
961961
var EventTarget = parserlib.util.EventTarget,
962962
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3430,6 +3430,10 @@ var ValidationType = {
34303430
return part.type == "color" || part == "transparent";
34313431
},
34323432

3433+
"number": function(part){
3434+
return part.type == "number" || this.integer(part);
3435+
},
3436+
34333437
"integer": function(part){
34343438
return part.type == "integer";
34353439
},
@@ -3517,13 +3521,13 @@ var Properties = {
35173521
"border-bottom-style": [ "border-style" ],
35183522
"border-bottom-width": [ "border-width" ],
35193523
"border-collapse": [ "collapse | separate | inherit" ],
3520-
"border-color": [ "color", "inherit" ],
3524+
"border-color": { multi: [ "color", "inherit" ], max: 4 },
35213525
"border-image": 1,
3522-
"border-image-outset": 1,
3523-
"border-image-repeat": 1,
3526+
"border-image-outset": { multi: [ "length", "number" ], max: 4 },
3527+
"border-image-repeat": { multi: [ "stretch | repeat | round" ], max: 2 },
35243528
"border-image-slice": 1,
35253529
"border-image-source": [ "image", "none" ],
3526-
"border-image-width": 1,
3530+
"border-image-width": { multi: [ "length", "percentage", "number", "auto" ], max: 4 },
35273531
"border-left": 1,
35283532
"border-left-color": [ "color", "inherit" ],
35293533
"border-left-style": [ "border-style" ],
@@ -3534,14 +3538,14 @@ var Properties = {
35343538
"border-right-style": [ "border-style" ],
35353539
"border-right-width": [ "border-width" ],
35363540
"border-spacing": 1,
3537-
"border-style": 1,
3541+
"border-style": { multi: [ "border-style" ], max: 4 },
35383542
"border-top": 1,
35393543
"border-top-color": [ "color", "inherit" ],
35403544
"border-top-left-radius": 1,
35413545
"border-top-right-radius": 1,
35423546
"border-top-style": [ "border-style" ],
35433547
"border-top-width": [ "border-width" ],
3544-
"border-width": 1,
3548+
"border-width": { multi: [ "border-width" ], max: 4 },
35453549
"bottom": [ "margin-width", "inherit" ],
35463550
"box-align": [ "start | end | center | baseline | stretch" ], //http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/
35473551
"box-decoration-break": [ "slice |clone" ],
@@ -3660,7 +3664,7 @@ var Properties = {
36603664
"list-style-type": [ "disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit" ],
36613665

36623666
//M
3663-
"margin": 1,
3667+
"margin": { multi: [ "margin-width", "inherit" ], max: 4 },
36643668
"margin-bottom": [ "margin-width", "inherit" ],
36653669
"margin-left": [ "margin-width", "inherit" ],
36663670
"margin-right": [ "margin-width", "inherit" ],
@@ -3700,7 +3704,7 @@ var Properties = {
37003704
"overflow-y": 1,
37013705

37023706
//P
3703-
"padding": 1,
3707+
"padding": { multi: [ "padding-width", "inherit" ], max: 4 },
37043708
"padding-bottom": [ "padding-width", "inherit" ],
37053709
"padding-left": [ "padding-width", "inherit" ],
37063710
"padding-right": [ "padding-width", "inherit" ],
@@ -3842,6 +3846,51 @@ var Properties = {
38423846
}
38433847
};
38443848
})(Properties[prop]);
3849+
} else if (typeof Properties[prop] == "object"){
3850+
Properties[prop] = (function(spec){
3851+
return function(value){
3852+
var valid,
3853+
i, len, j, count,
3854+
msg,
3855+
values,
3856+
parts = value.parts;
3857+
3858+
if (spec.max) {
3859+
if (parts.length > spec.max){
3860+
throw new ValidationError("Expected a max of " + spec.max + " property values but found " + parts.length + ".", value.line, value.col);
3861+
}
3862+
}
3863+
3864+
if (spec.multi){
3865+
values = spec.multi;
3866+
}
3867+
3868+
for (i=0, len=parts.length; i < len; i++){
3869+
msg = [];
3870+
valid = false;
3871+
for (j=0, count=values.length; j < count; j++){
3872+
if (typeof ValidationType[values[j]] == "undefined"){
3873+
if(ValidationType.identifier(parts[i], values[j])){
3874+
valid = true;
3875+
break;
3876+
}
3877+
msg.push("one of (" + values[j] + ")");
3878+
} else {
3879+
if (ValidationType[values[j]](parts[i])){
3880+
valid = true;
3881+
break;
3882+
}
3883+
msg.push(values[j]);
3884+
}
3885+
}
3886+
3887+
if (!valid) {
3888+
throw new ValidationError("Expected " + msg.join(" or ") + " but found '" + parts[i] + "'.", value.line, value.col);
3889+
}
3890+
}
3891+
3892+
};
3893+
})(Properties[prop]);
38453894
}
38463895
}
38473896
}
@@ -5575,7 +5624,7 @@ var CSSLint = (function(){
55755624
formatters = [],
55765625
api = new parserlib.util.EventTarget();
55775626

5578-
api.version = "0.8.0";
5627+
api.version = "0.8.1";
55795628

55805629
//-------------------------------------------------------------------------
55815630
// Rule Management
@@ -5690,15 +5739,16 @@ var CSSLint = (function(){
56905739
underscoreHack: true, strict: false });
56915740

56925741
lines = text.split(/\n\r?/g);
5693-
reporter = new Reporter(lines, ruleset);
5694-
5742+
56955743
if (!ruleset){
56965744
ruleset = {};
56975745
while (i < len){
56985746
ruleset[rules[i++].id] = 1; //by default, everything is a warning
56995747
}
57005748
}
57015749

5750+
reporter = new Reporter(lines, ruleset);
5751+
57025752
ruleset.errors = 2; //always report parsing errors as errors
57035753
for (i in ruleset){
57045754
if(ruleset.hasOwnProperty(i)){

0 commit comments

Comments
 (0)