Skip to content

Commit ebfaeb1

Browse files
committed
Release 0.1.7
1 parent e9a312a commit ebfaeb1

File tree

14 files changed

+212
-39
lines changed

14 files changed

+212
-39
lines changed

CHANGELOG

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
May 4, 2012 - v0.1.7
2+
3+
* Added text-rendering (Nicholas C. Zakas)
4+
* A little cleanup for validation with hacks (Nicholas C. Zakas)
5+
* Merge pull request #26 from moddular/webkit-gradient (Nicholas C. Zakas)
6+
* Updated <gradient> regex to allow -webkit-gradient (Andrew Walker)
7+
* Add 'behavior' as known property (fixes #25) (Nicholas C. Zakas)
8+
* Fix bug where star and underscore hacks interfered with validation (fixes #24) (Nicholas C. Zakas)
9+
* Merge pull request #22 from madr/patch-1 (Nicholas C. Zakas)
10+
* Update CHANGELOG: "-ms-" instead of "-moz-" (Anders Ytterström)
11+
12+
113
March 2, 2012 - v0.1.6
214

315
* Allow leading semicolon in front of properties (Nicholas C. Zakas)
@@ -221,3 +233,5 @@ November 28, 2011 - v0.1.0
221233

222234

223235

236+
237+

build.xml

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

33
<!-- version number -->
4-
<property name="parserlib.version" value="0.1.6" />
4+
<property name="parserlib.version" value="0.1.7" />
55

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

build/node-parserlib.js

Lines changed: 2 additions & 2 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-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
24+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
934+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

build/npm/lib/node-parserlib.js

Lines changed: 2 additions & 2 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-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
24+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
934+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

build/parserlib-core.js

Lines changed: 1 addition & 1 deletion
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-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
24+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

build/parserlib-css.js

Lines changed: 1 addition & 1 deletion
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-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
24+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
2525
(function(){
2626
var EventTarget = parserlib.util.EventTarget,
2727
TokenStreamBase = parserlib.util.TokenStreamBase,

build/parserlib.js

Lines changed: 2 additions & 2 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-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
24+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 4-May-2012 03:56:19 */
934+
/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

release/node-parserlib.js

Lines changed: 33 additions & 6 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-
/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
24+
/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
934+
/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -2640,7 +2640,8 @@ Parser.prototype = function(){
26402640
expr = null,
26412641
prio = null,
26422642
error = null,
2643-
invalid = null;
2643+
invalid = null,
2644+
propertyName= "";
26442645

26452646
property = this._property();
26462647
if (property !== null){
@@ -2657,8 +2658,20 @@ Parser.prototype = function(){
26572658

26582659
prio = this._prio();
26592660

2661+
/*
2662+
* If hacks should be allowed, then only check the root
2663+
* property. If hacks should not be allowed, treat
2664+
* _property or *property as invalid properties.
2665+
*/
2666+
propertyName = property.toString();
2667+
if (this.options.starHack && property.hack == "*" ||
2668+
this.options.underscoreHack && property.hack == "_") {
2669+
2670+
propertyName = property.text;
2671+
}
2672+
26602673
try {
2661-
this._validateProperty(property, expr);
2674+
this._validateProperty(propertyName, expr);
26622675
} catch (ex) {
26632676
invalid = ex;
26642677
}
@@ -3499,6 +3512,7 @@ var Properties = {
34993512
"background-repeat" : { multi: "<repeat-style>" },
35003513
"background-size" : { multi: "<bg-size>", comma: true },
35013514
"baseline-shift" : "baseline | sub | super | <percentage> | <length>",
3515+
"behavior" : 1,
35023516
"binding" : 1,
35033517
"bleed" : "<length>",
35043518
"bookmark-label" : "<content> | <attr> | <string>",
@@ -3845,6 +3859,7 @@ var Properties = {
38453859
"text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
38463860
"text-outline" : 1,
38473861
"text-overflow" : 1,
3862+
"text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
38483863
"text-shadow" : 1,
38493864
"text-transform" : "capitalize | uppercase | lowercase | none | inherit",
38503865
"text-wrap" : "normal | none | avoid",
@@ -5924,7 +5939,7 @@ var ValidationTypes = {
59245939
i, len, found = false;
59255940

59265941
for (i=0,len=args.length; i < len && !found; i++){
5927-
if (text == args[i]){
5942+
if (text == args[i].toLowerCase()){
59285943
found = true;
59295944
}
59305945
}
@@ -6016,7 +6031,7 @@ var ValidationTypes = {
60166031
},
60176032

60186033
"<gradient>": function(part) {
6019-
return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
6034+
return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
60206035
},
60216036

60226037
"<box>": function(part){
@@ -6108,6 +6123,18 @@ var ValidationTypes = {
61086123
part,
61096124
i, len;
61106125

6126+
/*
6127+
<position> = [
6128+
[ left | center | right | top | bottom | <percentage> | <length> ]
6129+
|
6130+
[ left | center | right | <percentage> | <length> ]
6131+
[ top | center | bottom | <percentage> | <length> ]
6132+
|
6133+
[ center | [ left | right ] [ <percentage> | <length> ]? ] &&
6134+
[ center | [ top | bottom ] [ <percentage> | <length> ]? ]
6135+
]
6136+
6137+
*/
61116138

61126139
if (ValidationTypes.isAny(expression, "top | bottom")) {
61136140
result = true;

release/npm/lib/node-parserlib.js

Lines changed: 33 additions & 6 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-
/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
24+
/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
934+
/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -2640,7 +2640,8 @@ Parser.prototype = function(){
26402640
expr = null,
26412641
prio = null,
26422642
error = null,
2643-
invalid = null;
2643+
invalid = null,
2644+
propertyName= "";
26442645

26452646
property = this._property();
26462647
if (property !== null){
@@ -2657,8 +2658,20 @@ Parser.prototype = function(){
26572658

26582659
prio = this._prio();
26592660

2661+
/*
2662+
* If hacks should be allowed, then only check the root
2663+
* property. If hacks should not be allowed, treat
2664+
* _property or *property as invalid properties.
2665+
*/
2666+
propertyName = property.toString();
2667+
if (this.options.starHack && property.hack == "*" ||
2668+
this.options.underscoreHack && property.hack == "_") {
2669+
2670+
propertyName = property.text;
2671+
}
2672+
26602673
try {
2661-
this._validateProperty(property, expr);
2674+
this._validateProperty(propertyName, expr);
26622675
} catch (ex) {
26632676
invalid = ex;
26642677
}
@@ -3499,6 +3512,7 @@ var Properties = {
34993512
"background-repeat" : { multi: "<repeat-style>" },
35003513
"background-size" : { multi: "<bg-size>", comma: true },
35013514
"baseline-shift" : "baseline | sub | super | <percentage> | <length>",
3515+
"behavior" : 1,
35023516
"binding" : 1,
35033517
"bleed" : "<length>",
35043518
"bookmark-label" : "<content> | <attr> | <string>",
@@ -3845,6 +3859,7 @@ var Properties = {
38453859
"text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
38463860
"text-outline" : 1,
38473861
"text-overflow" : 1,
3862+
"text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
38483863
"text-shadow" : 1,
38493864
"text-transform" : "capitalize | uppercase | lowercase | none | inherit",
38503865
"text-wrap" : "normal | none | avoid",
@@ -5924,7 +5939,7 @@ var ValidationTypes = {
59245939
i, len, found = false;
59255940

59265941
for (i=0,len=args.length; i < len && !found; i++){
5927-
if (text == args[i]){
5942+
if (text == args[i].toLowerCase()){
59285943
found = true;
59295944
}
59305945
}
@@ -6016,7 +6031,7 @@ var ValidationTypes = {
60166031
},
60176032

60186033
"<gradient>": function(part) {
6019-
return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
6034+
return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
60206035
},
60216036

60226037
"<box>": function(part){
@@ -6108,6 +6123,18 @@ var ValidationTypes = {
61086123
part,
61096124
i, len;
61106125

6126+
/*
6127+
<position> = [
6128+
[ left | center | right | top | bottom | <percentage> | <length> ]
6129+
|
6130+
[ left | center | right | <percentage> | <length> ]
6131+
[ top | center | bottom | <percentage> | <length> ]
6132+
|
6133+
[ center | [ left | right ] [ <percentage> | <length> ]? ] &&
6134+
[ center | [ top | bottom ] [ <percentage> | <length> ]? ]
6135+
]
6136+
6137+
*/
61116138

61126139
if (ValidationTypes.isAny(expression, "top | bottom")) {
61136140
result = true;

release/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parserlib",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "CSSLint",
55
"author": "Nicholas C. Zakas",
66
"os": ["darwin", "linux"],

0 commit comments

Comments
 (0)