Skip to content

Commit c0fce79

Browse files
committed
Ensure 'ch' is identifier as a length
1 parent 375d726 commit c0fce79

8 files changed

Lines changed: 35 additions & 98 deletions

File tree

build/node-parserlib.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 10-February-2012 12:59:26 */
24+
/* Version v@VERSION@, Build time: 2-March-2012 02:36:35 */
2525
var parserlib = {};
2626
(function(){
2727

28-
2928
/**
3029
* A generic base to inherit from for any object
3130
* that needs event handling.
@@ -896,8 +895,6 @@ TokenStreamBase.prototype = {
896895
};
897896

898897

899-
900-
901898
parserlib.util = {
902899
StringReader: StringReader,
903900
SyntaxError : SyntaxError,
@@ -906,8 +903,6 @@ EventTarget : EventTarget,
906903
TokenStreamBase : TokenStreamBase
907904
};
908905
})();
909-
910-
911906
/*
912907
Parser-Lib
913908
Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
@@ -931,15 +926,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931926
THE SOFTWARE.
932927
933928
*/
934-
/* Version v@VERSION@, Build time: 10-February-2012 12:59:26 */
929+
/* Version v@VERSION@, Build time: 2-March-2012 02:36:35 */
935930
(function(){
936931
var EventTarget = parserlib.util.EventTarget,
937932
TokenStreamBase = parserlib.util.TokenStreamBase,
938933
StringReader = parserlib.util.StringReader,
939934
SyntaxError = parserlib.util.SyntaxError,
940935
SyntaxUnit = parserlib.util.SyntaxUnit;
941936

942-
943937
var Colors = {
944938
aliceblue :"#f0f8ff",
945939
antiquewhite :"#faebd7",
@@ -1120,7 +1114,6 @@ function Combinator(text, line, col){
11201114
Combinator.prototype = new SyntaxUnit();
11211115
Combinator.prototype.constructor = Combinator;
11221116

1123-
11241117
/*global SyntaxUnit, Parser*/
11251118
/**
11261119
* Represents a media feature, such as max-width:500.
@@ -1153,7 +1146,6 @@ function MediaFeature(name, value){
11531146
MediaFeature.prototype = new SyntaxUnit();
11541147
MediaFeature.prototype.constructor = MediaFeature;
11551148

1156-
11571149
/*global SyntaxUnit, Parser*/
11581150
/**
11591151
* Represents an individual media query.
@@ -1197,7 +1189,6 @@ function MediaQuery(modifier, mediaType, features, line, col){
11971189
MediaQuery.prototype = new SyntaxUnit();
11981190
MediaQuery.prototype.constructor = MediaQuery;
11991191

1200-
12011192
/*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit,
12021193
PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector,
12031194
PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */
@@ -3919,7 +3910,6 @@ PropertyName.prototype.constructor = PropertyName;
39193910
PropertyName.prototype.toString = function(){
39203911
return (this.hack ? this.hack : "") + this.text;
39213912
};
3922-
39233913
/*global SyntaxUnit, Parser*/
39243914
/**
39253915
* Represents a single part of a CSS property value, meaning that it represents
@@ -3949,7 +3939,6 @@ function PropertyValue(parts, line, col){
39493939
PropertyValue.prototype = new SyntaxUnit();
39503940
PropertyValue.prototype.constructor = PropertyValue;
39513941

3952-
39533942
/*global SyntaxUnit, Parser*/
39543943
/**
39553944
* A utility class that allows for easy iteration over the various parts of a
@@ -4075,7 +4064,6 @@ PropertyValueIterator.prototype.restore = function(){
40754064
}
40764065
};
40774066

4078-
40794067
/*global SyntaxUnit, Parser, Colors*/
40804068
/**
40814069
* Represents a single part of a CSS property value, meaning that it represents
@@ -4121,6 +4109,7 @@ function PropertyValuePart(text, line, col){
41214109
case "in":
41224110
case "pt":
41234111
case "pc":
4112+
case "ch":
41244113
this.type = "length";
41254114
break;
41264115

@@ -4296,7 +4285,6 @@ function Selector(parts, line, col){
42964285
Selector.prototype = new SyntaxUnit();
42974286
Selector.prototype.constructor = Selector;
42984287

4299-
43004288
/*global SyntaxUnit, Parser*/
43014289
/**
43024290
* Represents a single part of a selector string, meaning a single set of
@@ -4339,7 +4327,6 @@ function SelectorPart(elementName, modifiers, text, line, col){
43394327
SelectorPart.prototype = new SyntaxUnit();
43404328
SelectorPart.prototype.constructor = SelectorPart;
43414329

4342-
43434330
/*global SyntaxUnit, Parser*/
43444331
/**
43454332
* Represents a selector modifier string, meaning a class name, element name,
@@ -4376,7 +4363,6 @@ function SelectorSubPart(text, type, line, col){
43764363
SelectorSubPart.prototype = new SyntaxUnit();
43774364
SelectorSubPart.prototype.constructor = SelectorSubPart;
43784365

4379-
43804366
/*global Pseudos, SelectorPart*/
43814367
/**
43824368
* Represents a selector's specificity.
@@ -4500,7 +4486,6 @@ Specificity.calculate = function(selector){
45004486

45014487
return new Specificity(0, b, c, d);
45024488
};
4503-
45044489
/*global Tokens, TokenStreamBase*/
45054490

45064491
var h = /^[0-9a-fA-F]$/,
@@ -5501,7 +5486,6 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
55015486
}
55025487
});
55035488

5504-
55055489
var Tokens = [
55065490

55075491
/*
@@ -5709,7 +5693,6 @@ var Tokens = [
57095693

57105694

57115695

5712-
57135696
//This file will likely change a lot! Very experimental!
57145697
/*global Properties, ValidationTypes, ValidationError, PropertyValueIterator */
57155698
var Validation = {
@@ -6244,7 +6227,6 @@ var ValidationTypes = {
62446227
}
62456228
};
62466229

6247-
62486230
parserlib.css = {
62496231
Colors :Colors,
62506232
Combinator :Combinator,
@@ -6264,12 +6246,8 @@ ValidationError :ValidationError
62646246
};
62656247
})();
62666248

6267-
6268-
6269-
62706249
(function(){
62716250
for(var prop in parserlib){
62726251
exports[prop] = parserlib[prop];
62736252
}
62746253
})();
6275-

build/npm/lib/node-parserlib.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 10-February-2012 12:59:26 */
24+
/* Version v@VERSION@, Build time: 2-March-2012 02:36:35 */
2525
var parserlib = {};
2626
(function(){
2727

28-
2928
/**
3029
* A generic base to inherit from for any object
3130
* that needs event handling.
@@ -896,8 +895,6 @@ TokenStreamBase.prototype = {
896895
};
897896

898897

899-
900-
901898
parserlib.util = {
902899
StringReader: StringReader,
903900
SyntaxError : SyntaxError,
@@ -906,8 +903,6 @@ EventTarget : EventTarget,
906903
TokenStreamBase : TokenStreamBase
907904
};
908905
})();
909-
910-
911906
/*
912907
Parser-Lib
913908
Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
@@ -931,15 +926,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931926
THE SOFTWARE.
932927
933928
*/
934-
/* Version v@VERSION@, Build time: 10-February-2012 12:59:26 */
929+
/* Version v@VERSION@, Build time: 2-March-2012 02:36:35 */
935930
(function(){
936931
var EventTarget = parserlib.util.EventTarget,
937932
TokenStreamBase = parserlib.util.TokenStreamBase,
938933
StringReader = parserlib.util.StringReader,
939934
SyntaxError = parserlib.util.SyntaxError,
940935
SyntaxUnit = parserlib.util.SyntaxUnit;
941936

942-
943937
var Colors = {
944938
aliceblue :"#f0f8ff",
945939
antiquewhite :"#faebd7",
@@ -1120,7 +1114,6 @@ function Combinator(text, line, col){
11201114
Combinator.prototype = new SyntaxUnit();
11211115
Combinator.prototype.constructor = Combinator;
11221116

1123-
11241117
/*global SyntaxUnit, Parser*/
11251118
/**
11261119
* Represents a media feature, such as max-width:500.
@@ -1153,7 +1146,6 @@ function MediaFeature(name, value){
11531146
MediaFeature.prototype = new SyntaxUnit();
11541147
MediaFeature.prototype.constructor = MediaFeature;
11551148

1156-
11571149
/*global SyntaxUnit, Parser*/
11581150
/**
11591151
* Represents an individual media query.
@@ -1197,7 +1189,6 @@ function MediaQuery(modifier, mediaType, features, line, col){
11971189
MediaQuery.prototype = new SyntaxUnit();
11981190
MediaQuery.prototype.constructor = MediaQuery;
11991191

1200-
12011192
/*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit,
12021193
PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector,
12031194
PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */
@@ -3919,7 +3910,6 @@ PropertyName.prototype.constructor = PropertyName;
39193910
PropertyName.prototype.toString = function(){
39203911
return (this.hack ? this.hack : "") + this.text;
39213912
};
3922-
39233913
/*global SyntaxUnit, Parser*/
39243914
/**
39253915
* Represents a single part of a CSS property value, meaning that it represents
@@ -3949,7 +3939,6 @@ function PropertyValue(parts, line, col){
39493939
PropertyValue.prototype = new SyntaxUnit();
39503940
PropertyValue.prototype.constructor = PropertyValue;
39513941

3952-
39533942
/*global SyntaxUnit, Parser*/
39543943
/**
39553944
* A utility class that allows for easy iteration over the various parts of a
@@ -4075,7 +4064,6 @@ PropertyValueIterator.prototype.restore = function(){
40754064
}
40764065
};
40774066

4078-
40794067
/*global SyntaxUnit, Parser, Colors*/
40804068
/**
40814069
* Represents a single part of a CSS property value, meaning that it represents
@@ -4121,6 +4109,7 @@ function PropertyValuePart(text, line, col){
41214109
case "in":
41224110
case "pt":
41234111
case "pc":
4112+
case "ch":
41244113
this.type = "length";
41254114
break;
41264115

@@ -4296,7 +4285,6 @@ function Selector(parts, line, col){
42964285
Selector.prototype = new SyntaxUnit();
42974286
Selector.prototype.constructor = Selector;
42984287

4299-
43004288
/*global SyntaxUnit, Parser*/
43014289
/**
43024290
* Represents a single part of a selector string, meaning a single set of
@@ -4339,7 +4327,6 @@ function SelectorPart(elementName, modifiers, text, line, col){
43394327
SelectorPart.prototype = new SyntaxUnit();
43404328
SelectorPart.prototype.constructor = SelectorPart;
43414329

4342-
43434330
/*global SyntaxUnit, Parser*/
43444331
/**
43454332
* Represents a selector modifier string, meaning a class name, element name,
@@ -4376,7 +4363,6 @@ function SelectorSubPart(text, type, line, col){
43764363
SelectorSubPart.prototype = new SyntaxUnit();
43774364
SelectorSubPart.prototype.constructor = SelectorSubPart;
43784365

4379-
43804366
/*global Pseudos, SelectorPart*/
43814367
/**
43824368
* Represents a selector's specificity.
@@ -4500,7 +4486,6 @@ Specificity.calculate = function(selector){
45004486

45014487
return new Specificity(0, b, c, d);
45024488
};
4503-
45044489
/*global Tokens, TokenStreamBase*/
45054490

45064491
var h = /^[0-9a-fA-F]$/,
@@ -5501,7 +5486,6 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
55015486
}
55025487
});
55035488

5504-
55055489
var Tokens = [
55065490

55075491
/*
@@ -5709,7 +5693,6 @@ var Tokens = [
57095693

57105694

57115695

5712-
57135696
//This file will likely change a lot! Very experimental!
57145697
/*global Properties, ValidationTypes, ValidationError, PropertyValueIterator */
57155698
var Validation = {
@@ -6244,7 +6227,6 @@ var ValidationTypes = {
62446227
}
62456228
};
62466229

6247-
62486230
parserlib.css = {
62496231
Colors :Colors,
62506232
Combinator :Combinator,
@@ -6264,12 +6246,8 @@ ValidationError :ValidationError
62646246
};
62656247
})();
62666248

6267-
6268-
6269-
62706249
(function(){
62716250
for(var prop in parserlib){
62726251
exports[prop] = parserlib[prop];
62736252
}
62746253
})();
6275-

build/parserlib-core.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 10-February-2012 12:59:26 */
24+
/* Version v@VERSION@, Build time: 2-March-2012 02:36:35 */
2525
var parserlib = {};
2626
(function(){
2727

28-
2928
/**
3029
* A generic base to inherit from for any object
3130
* that needs event handling.
@@ -896,8 +895,6 @@ TokenStreamBase.prototype = {
896895
};
897896

898897

899-
900-
901898
parserlib.util = {
902899
StringReader: StringReader,
903900
SyntaxError : SyntaxError,
@@ -906,4 +903,3 @@ EventTarget : EventTarget,
906903
TokenStreamBase : TokenStreamBase
907904
};
908905
})();
909-

0 commit comments

Comments
 (0)