update csslint

This commit is contained in:
nightwing 2014-03-31 20:23:45 +04:00
commit dcd96294f7
2 changed files with 373 additions and 327 deletions

View file

@ -1,7 +1,7 @@
define(function(require, exports, module) { define(function(require, exports, module) {
/*! /*!
CSSLint CSSLint
Copyright (c) 2013 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* Build: v0.10.0 15-August-2013 01:07:22 */ /* Build: v0.10.0 31-March-2014 08:16:48 */
/*! /*!
Parser-Lib Parser-Lib
Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
@ -46,7 +46,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* Version v0.2.3, Build time: 19-June-2013 11:16:15 */ /* Version v0.2.4, Build time: 7-January-2014 07:32:49 */
var parserlib = {}; var parserlib = {};
(function(){ (function(){
@ -956,7 +956,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* Version v0.2.3, Build time: 19-June-2013 11:16:15 */ /* Version v0.2.4, Build time: 7-January-2014 07:32:49 */
(function(){ (function(){
var EventTarget = parserlib.util.EventTarget, var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase, TokenStreamBase = parserlib.util.TokenStreamBase,
@ -991,6 +991,7 @@ var Colors = {
darkcyan :"#008b8b", darkcyan :"#008b8b",
darkgoldenrod :"#b8860b", darkgoldenrod :"#b8860b",
darkgray :"#a9a9a9", darkgray :"#a9a9a9",
darkgrey :"#a9a9a9",
darkgreen :"#006400", darkgreen :"#006400",
darkkhaki :"#bdb76b", darkkhaki :"#bdb76b",
darkmagenta :"#8b008b", darkmagenta :"#8b008b",
@ -1002,11 +1003,13 @@ var Colors = {
darkseagreen :"#8fbc8f", darkseagreen :"#8fbc8f",
darkslateblue :"#483d8b", darkslateblue :"#483d8b",
darkslategray :"#2f4f4f", darkslategray :"#2f4f4f",
darkslategrey :"#2f4f4f",
darkturquoise :"#00ced1", darkturquoise :"#00ced1",
darkviolet :"#9400d3", darkviolet :"#9400d3",
deeppink :"#ff1493", deeppink :"#ff1493",
deepskyblue :"#00bfff", deepskyblue :"#00bfff",
dimgray :"#696969", dimgray :"#696969",
dimgrey :"#696969",
dodgerblue :"#1e90ff", dodgerblue :"#1e90ff",
firebrick :"#b22222", firebrick :"#b22222",
floralwhite :"#fffaf0", floralwhite :"#fffaf0",
@ -1017,6 +1020,7 @@ var Colors = {
gold :"#ffd700", gold :"#ffd700",
goldenrod :"#daa520", goldenrod :"#daa520",
gray :"#808080", gray :"#808080",
grey :"#808080",
green :"#008000", green :"#008000",
greenyellow :"#adff2f", greenyellow :"#adff2f",
honeydew :"#f0fff0", honeydew :"#f0fff0",
@ -1034,12 +1038,14 @@ var Colors = {
lightcyan :"#e0ffff", lightcyan :"#e0ffff",
lightgoldenrodyellow :"#fafad2", lightgoldenrodyellow :"#fafad2",
lightgray :"#d3d3d3", lightgray :"#d3d3d3",
lightgrey :"#d3d3d3",
lightgreen :"#90ee90", lightgreen :"#90ee90",
lightpink :"#ffb6c1", lightpink :"#ffb6c1",
lightsalmon :"#ffa07a", lightsalmon :"#ffa07a",
lightseagreen :"#20b2aa", lightseagreen :"#20b2aa",
lightskyblue :"#87cefa", lightskyblue :"#87cefa",
lightslategray :"#778899", lightslategray :"#778899",
lightslategrey :"#778899",
lightsteelblue :"#b0c4de", lightsteelblue :"#b0c4de",
lightyellow :"#ffffe0", lightyellow :"#ffffe0",
lime :"#00ff00", lime :"#00ff00",
@ -1092,6 +1098,7 @@ var Colors = {
skyblue :"#87ceeb", skyblue :"#87ceeb",
slateblue :"#6a5acd", slateblue :"#6a5acd",
slategray :"#708090", slategray :"#708090",
slategrey :"#708090",
snow :"#fffafa", snow :"#fffafa",
springgreen :"#00ff7f", springgreen :"#00ff7f",
steelblue :"#4682b4", steelblue :"#4682b4",
@ -1117,6 +1124,7 @@ var Colors = {
buttontext :"Text on push buttons.", buttontext :"Text on push buttons.",
captiontext :"Text in caption, size box, and scrollbar arrow box.", captiontext :"Text in caption, size box, and scrollbar arrow box.",
graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.", graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
greytext :"Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.",
highlight :"Item(s) selected in a control.", highlight :"Item(s) selected in a control.",
highlighttext :"Text of item(s) selected in a control.", highlighttext :"Text of item(s) selected in a control.",
inactiveborder :"Inactive window border.", inactiveborder :"Inactive window border.",
@ -3533,6 +3541,12 @@ nth
var Properties = { var Properties = {
//A //A
"align-items" : "flex-start | flex-end | center | baseline | stretch",
"align-content" : "flex-start | flex-end | center | space-between | space-around | stretch",
"align-self" : "auto | flex-start | flex-end | center | baseline | stretch",
"-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch",
"-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch",
"-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch",
"alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>", "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>",
"alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
"animation" : 1, "animation" : 1,
@ -3728,15 +3742,24 @@ var Properties = {
"border-top-width" : "<border-width>", "border-top-width" : "<border-width>",
"border-width" : { multi: "<border-width>", max: 4 }, "border-width" : { multi: "<border-width>", max: 4 },
"bottom" : "<margin-width> | inherit", "bottom" : "<margin-width> | inherit",
"box-align" : "start | end | center | baseline | stretch", //http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/ "-moz-box-align" : "start | end | center | baseline | stretch",
"box-decoration-break" : "slice |clone", "-moz-box-decoration-break" : "slice |clone",
"box-direction" : "normal | reverse | inherit", "-moz-box-direction" : "normal | reverse | inherit",
"box-flex" : "<number>", "-moz-box-flex" : "<number>",
"box-flex-group" : "<integer>", "-moz-box-flex-group" : "<integer>",
"box-lines" : "single | multiple", "-moz-box-lines" : "single | multiple",
"box-ordinal-group" : "<integer>", "-moz-box-ordinal-group" : "<integer>",
"box-orient" : "horizontal | vertical | inline-axis | block-axis | inherit", "-moz-box-orient" : "horizontal | vertical | inline-axis | block-axis | inherit",
"box-pack" : "start | end | center | justify", "-moz-box-pack" : "start | end | center | justify",
"-webkit-box-align" : "start | end | center | baseline | stretch",
"-webkit-box-decoration-break" : "slice |clone",
"-webkit-box-direction" : "normal | reverse | inherit",
"-webkit-box-flex" : "<number>",
"-webkit-box-flex-group" : "<integer>",
"-webkit-box-lines" : "single | multiple",
"-webkit-box-ordinal-group" : "<integer>",
"-webkit-box-orient" : "horizontal | vertical | inline-axis | block-axis | inherit",
"-webkit-box-pack" : "start | end | center | justify",
"box-shadow" : function (expression) { "box-shadow" : function (expression) {
var result = false, var result = false,
part; part;
@ -3782,7 +3805,7 @@ var Properties = {
//D //D
"direction" : "ltr | rtl | inherit", "direction" : "ltr | rtl | inherit",
"display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box", "display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | -ms-flexbox | -ms-inline-flexbox | flex | -webkit-flex | inline-flex | -webkit-inline-flex",
"dominant-baseline" : 1, "dominant-baseline" : 1,
"drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>", "drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>",
"drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
@ -3799,6 +3822,26 @@ var Properties = {
"filter" : 1, "filter" : 1,
"fit" : "fill | hidden | meet | slice", "fit" : "fill | hidden | meet | slice",
"fit-position" : 1, "fit-position" : 1,
"flex" : "none | [ <flex-grow> <flex-shrink>? || <flex-basis>",
"flex-basis" : "<width>",
"flex-direction" : "row | row-reverse | column | column-reverse",
"flex-flow" : "<flex-direction> || <flex-wrap>",
"flex-grow" : "<number>",
"flex-shrink" : "<number>",
"flex-wrap" : "nowrap | wrap | wrap-reverse",
"-webkit-flex" : "none | [ <flex-grow> <flex-shrink>? || <flex-basis>",
"-webkit-flex-basis" : "<width>",
"-webkit-flex-direction" : "row | row-reverse | column | column-reverse",
"-webkit-flex-flow" : "<flex-direction> || <flex-wrap>",
"-webkit-flex-grow" : "<number>",
"-webkit-flex-shrink" : "<number>",
"-webkit-flex-wrap" : "nowrap | wrap | wrap-reverse",
"-ms-flex" : "[[ <number> <number>? ] || [ <length> || <percentage> || auto ] ] | none",
"-ms-flex-align" : "start | end | center | stretch | baseline",
"-ms-flex-direction" : "row | column | row-reverse | column-reverse | inherit",
"-ms-flex-order" : "<number>",
"-ms-flex-pack" : "start | end | center | justify",
"-ms-flex-wrap" : "nowrap | wrap | wrap-reverse",
"float" : "left | right | none | inherit", "float" : "left | right | none | inherit",
"float-offset" : 1, "float-offset" : 1,
"font" : 1, "font" : 1,
@ -3842,6 +3885,10 @@ var Properties = {
"image-resolution" : 1, "image-resolution" : 1,
"inline-box-align" : "initial | last | <integer>", "inline-box-align" : "initial | last | <integer>",
//J
"justify-content" : "flex-start | flex-end | center | space-between | space-around",
"-webkit-justify-content" : "flex-start | flex-end | center | space-between | space-around",
//L //L
"left" : "<margin-width> | inherit", "left" : "<margin-width> | inherit",
"letter-spacing" : "<length> | normal | inherit", "letter-spacing" : "<length> | normal | inherit",
@ -3885,6 +3932,8 @@ var Properties = {
//O //O
"opacity" : "<number> | inherit", "opacity" : "<number> | inherit",
"order" : "<integer>",
"-webkit-order" : "<integer>",
"orphans" : "<integer> | inherit", "orphans" : "<integer> | inherit",
"outline" : 1, "outline" : 1,
"outline-color" : "<color> | invert | inherit", "outline-color" : "<color> | invert | inherit",
@ -3893,6 +3942,7 @@ var Properties = {
"outline-width" : "<border-width> | inherit", "outline-width" : "<border-width> | inherit",
"overflow" : "visible | hidden | scroll | auto | inherit", "overflow" : "visible | hidden | scroll | auto | inherit",
"overflow-style" : 1, "overflow-style" : 1,
"overflow-wrap" : "normal | break-word",
"overflow-x" : 1, "overflow-x" : 1,
"overflow-y" : 1, "overflow-y" : 1,
@ -3970,6 +4020,8 @@ var Properties = {
"text-transform" : "capitalize | uppercase | lowercase | none | inherit", "text-transform" : "capitalize | uppercase | lowercase | none | inherit",
"text-wrap" : "normal | none | avoid", "text-wrap" : "normal | none | avoid",
"top" : "<margin-width> | inherit", "top" : "<margin-width> | inherit",
"-ms-touch-action" : "auto | none | pan-x | pan-y",
"touch-action" : "auto | none | pan-x | pan-y",
"transform" : 1, "transform" : 1,
"transform-origin" : 1, "transform-origin" : 1,
"transform-style" : 1, "transform-style" : 1,
@ -3980,7 +4032,7 @@ var Properties = {
"transition-timing-function" : 1, "transition-timing-function" : 1,
//U //U
"unicode-bidi" : "normal | embed | bidi-override | inherit", "unicode-bidi" : "normal | embed | isolate | bidi-override | isolate-override | plaintext | inherit",
"user-modify" : "read-only | read-write | write-only | inherit", "user-modify" : "read-only | read-write | write-only | inherit",
"user-select" : "none | text | toggle | element | elements | all | inherit", "user-select" : "none | text | toggle | element | elements | all | inherit",
@ -4004,7 +4056,8 @@ var Properties = {
"width" : "<length> | <percentage> | auto | inherit" , "width" : "<length> | <percentage> | auto | inherit" ,
"word-break" : "normal | keep-all | break-all", "word-break" : "normal | keep-all | break-all",
"word-spacing" : "<length> | normal | inherit", "word-spacing" : "<length> | normal | inherit",
"word-wrap" : 1, "word-wrap" : "normal | break-word",
"writing-mode" : "horizontal-tb | vertical-rl | vertical-lr | lr-tb | rl-tb | tb-rl | bt-rl | tb-lr | bt-lr | lr-bt | rl-bt | lr | rl | tb | inherit",
//Z //Z
"z-index" : "<integer> | auto | inherit", "z-index" : "<integer> | auto | inherit",
@ -4275,9 +4328,6 @@ function PropertyValuePart(text, line, col){
} }
} else if (/^([+\-]?[\d\.]+)%$/i.test(text)){ //percentage
this.type = "percentage";
this.value = +RegExp.$1;
} else if (/^([+\-]?[\d\.]+)%$/i.test(text)){ //percentage } else if (/^([+\-]?[\d\.]+)%$/i.test(text)){ //percentage
this.type = "percentage"; this.type = "percentage";
this.value = +RegExp.$1; this.value = +RegExp.$1;
@ -4374,6 +4424,7 @@ PropertyValuePart.prototype.constructor = PropertyValuePart;
PropertyValuePart.fromToken = function(token){ PropertyValuePart.fromToken = function(token){
return new PropertyValuePart(token.value, token.startLine, token.startCol); return new PropertyValuePart(token.value, token.startLine, token.startCol);
}; };
var Pseudos = { var Pseudos = {
":first-letter": 1, ":first-letter": 1,
":first-line": 1, ":first-line": 1,
@ -5661,7 +5712,7 @@ var Tokens = [
{ name: "FONT_FACE_SYM", text: "@font-face"}, { name: "FONT_FACE_SYM", text: "@font-face"},
{ name: "CHARSET_SYM", text: "@charset"}, { name: "CHARSET_SYM", text: "@charset"},
{ name: "NAMESPACE_SYM", text: "@namespace"}, { name: "NAMESPACE_SYM", text: "@namespace"},
{ name: "VIEWPORT_SYM", text: "@viewport"}, { name: "VIEWPORT_SYM", text: ["@viewport", "@-ms-viewport"]},
{ name: "UNKNOWN_SYM" }, { name: "UNKNOWN_SYM" },
//{ name: "ATKEYWORD"}, //{ name: "ATKEYWORD"},
@ -6443,7 +6494,7 @@ var CSSLint = (function(){
embeddedRuleset = /\/\*csslint([^\*]*)\*\//, embeddedRuleset = /\/\*csslint([^\*]*)\*\//,
api = new parserlib.util.EventTarget(); api = new parserlib.util.EventTarget();
api.version = "0.10.0"; api.version = "@VERSION@";
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Rule Management // Rule Management
@ -8941,13 +8992,14 @@ CSSLint.addFormatter({
output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n"; output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n";
} else { } else {
output += filename + ": " + "line " + message.line + output += filename + ": " + "line " + message.line +
", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + "\n"; ", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + " (" + message.rule.id + ")\n";
} }
}); });
return output; return output;
} }
}); });
/*global CSSLint*/ /*global CSSLint*/
CSSLint.addFormatter({ CSSLint.addFormatter({
//format information //format information

View file

@ -12,13 +12,7 @@ var deps = {
csslint: { csslint: {
path: "mode/css/csslint.js", path: "mode/css/csslint.js",
url: "https://raw.github.com/stubbornella/csslint/master/release/csslint.js", url: "https://raw.github.com/stubbornella/csslint/master/release/csslint.js",
needsFixup: true, needsFixup: true
browserify: {
npmModule: "git+https://github.com/stubbornella/csslint.git#master",
path: "jshint/src/jshint.js",
exports: "jshint"
},
fetch: browserify,
}, },
requirejs: { requirejs: {
path: "../../demo/kitchen-sink/require.js", path: "../../demo/kitchen-sink/require.js",