From b990ad3f90f14f99cfbe8bcb2a807027cfee7228 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 2 Aug 2014 00:56:34 +0400 Subject: [PATCH] update csslint --- lib/ace/mode/css/csslint.js | 968 ++++++++++++++++++++++++------------ lib/ace/mode/css_worker.js | 7 +- 2 files changed, 647 insertions(+), 328 deletions(-) diff --git a/lib/ace/mode/css/csslint.js b/lib/ace/mode/css/csslint.js index a3a7a9bd..c3c79a80 100644 --- a/lib/ace/mode/css/csslint.js +++ b/lib/ace/mode/css/csslint.js @@ -4,7 +4,7 @@ CSSLint 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 -of this software and associated documentation files (the "Software"), to deal +of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is @@ -13,7 +13,7 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Build: v0.10.0 31-March-2014 08:16:48 */ +/* Build: v0.10.0 22-July-2014 01:17:52 */ /*! Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -46,11 +46,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.4, Build time: 7-January-2014 07:32:49 */ +/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ var parserlib = {}; (function(){ - /** * A generic base to inherit from for any object * that needs event handling. @@ -506,7 +505,7 @@ SyntaxUnit.prototype = { * @method valueOf */ valueOf: function(){ - return this.toString(); + return this.text; }, /** @@ -921,8 +920,6 @@ TokenStreamBase.prototype = { }; - - parserlib.util = { StringReader: StringReader, SyntaxError : SyntaxError, @@ -931,8 +928,6 @@ EventTarget : EventTarget, TokenStreamBase : TokenStreamBase }; })(); - - /* Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -956,7 +951,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.4, Build time: 7-January-2014 07:32:49 */ +/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ (function(){ var EventTarget = parserlib.util.EventTarget, TokenStreamBase = parserlib.util.TokenStreamBase, @@ -964,7 +959,6 @@ StringReader = parserlib.util.StringReader, SyntaxError = parserlib.util.SyntaxError, SyntaxUnit = parserlib.util.SyntaxUnit; - var Colors = { aliceblue :"#f0f8ff", antiquewhite :"#faebd7", @@ -1182,7 +1176,6 @@ function Combinator(text, line, col){ Combinator.prototype = new SyntaxUnit(); Combinator.prototype.constructor = Combinator; - /*global SyntaxUnit, Parser*/ /** * Represents a media feature, such as max-width:500. @@ -1215,7 +1208,6 @@ function MediaFeature(name, value){ MediaFeature.prototype = new SyntaxUnit(); MediaFeature.prototype.constructor = MediaFeature; - /*global SyntaxUnit, Parser*/ /** * Represents an individual media query. @@ -1259,7 +1251,6 @@ function MediaQuery(modifier, mediaType, features, line, col){ MediaQuery.prototype = new SyntaxUnit(); MediaQuery.prototype.constructor = MediaQuery; - /*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit, PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector, PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */ @@ -1521,7 +1512,7 @@ Parser.prototype = function(){ tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); //grab the URI value - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); + uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1"); this._readWhitespace(); @@ -1626,8 +1617,10 @@ Parser.prototype = function(){ while(true) { if (tokenStream.peek() == Tokens.PAGE_SYM){ this._page(); - } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ + } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ this._font_face(); + } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ + this._viewport(); } else if (!this._ruleset()){ break; } @@ -2823,7 +2816,7 @@ Parser.prototype = function(){ value = null, operator = null; - value = this._term(); + value = this._term(inFunction); if (value !== null){ values.push(value); @@ -2840,7 +2833,7 @@ Parser.prototype = function(){ valueParts = []; }*/ - value = this._term(); + value = this._term(inFunction); if (value === null){ break; @@ -2858,7 +2851,7 @@ Parser.prototype = function(){ return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; }, - _term: function(){ + _term: function(inFunction){ /* * term @@ -2872,6 +2865,7 @@ Parser.prototype = function(){ var tokenStream = this._tokenStream, unary = null, value = null, + endChar = null, token, line, col; @@ -2892,6 +2886,20 @@ Parser.prototype = function(){ col = tokenStream.token().startCol; } + //see if it's a simple block + } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])){ + + token = tokenStream.token(); + endChar = token.endChar; + value = token.value + this._expr(inFunction).text; + if (unary === null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + tokenStream.mustMatch(Tokens.type(endChar)); + value += endChar; + this._readWhitespace(); + //see if there's a simple match } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, Tokens.ANGLE, Tokens.TIME, @@ -3536,7 +3544,6 @@ nth ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* ; */ - /*global Validation, ValidationTypes, ValidationError*/ var Properties = { @@ -3553,6 +3560,7 @@ var Properties = { "animation-delay" : { multi: "