diff --git a/csslint/csslint.js b/csslint/csslint.js index 35e0916e..d253dbb5 100644 --- a/csslint/csslint.js +++ b/csslint/csslint.js @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Build: v0.10.0 07-May-2015 01:08:02 */ +/* Build: v0.10.0 07-May-2015 02:11:31 */ var exports = exports || {}; var CSSLint = (function(){ /*! @@ -47,10 +47,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ +/* Version v0.2.5dev+PR, Build time: 6-May-2015 08:03:14 */ var parserlib = {}; (function(){ + /** * A generic base to inherit from for any object * that needs event handling. @@ -405,6 +406,7 @@ StringReader.prototype = { } }; + /** * Type to use when a syntax error occurs. * @class SyntaxError @@ -921,6 +923,8 @@ TokenStreamBase.prototype = { }; + + parserlib.util = { StringReader: StringReader, SyntaxError : SyntaxError, @@ -929,6 +933,8 @@ EventTarget : EventTarget, TokenStreamBase : TokenStreamBase }; })(); + + /* Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -952,7 +958,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ +/* Version v0.2.5dev+PR, Build time: 6-May-2015 08:03:14 */ (function(){ var EventTarget = parserlib.util.EventTarget, TokenStreamBase = parserlib.util.TokenStreamBase, @@ -960,6 +966,7 @@ StringReader = parserlib.util.StringReader, SyntaxError = parserlib.util.SyntaxError, SyntaxUnit = parserlib.util.SyntaxUnit; + var Colors = { aliceblue :"#f0f8ff", antiquewhite :"#faebd7", @@ -1177,6 +1184,7 @@ 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. @@ -1209,6 +1217,7 @@ function MediaFeature(name, value){ MediaFeature.prototype = new SyntaxUnit(); MediaFeature.prototype.constructor = MediaFeature; + /*global SyntaxUnit, Parser*/ /** * Represents an individual media query. @@ -1252,6 +1261,7 @@ 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 */ @@ -1381,6 +1391,10 @@ Parser.prototype = function(){ this._viewport(); this._skipCruft(); break; + case Tokens.DOCUMENT_SYM: + this._document(); + this._skipCruft(); + break; case Tokens.UNKNOWN_SYM: //unknown @ rule tokenStream.get(); if (!this.options.strict){ @@ -1622,6 +1636,8 @@ Parser.prototype = function(){ this._font_face(); } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ this._viewport(); + } else if (tokenStream.peek() == Tokens.DOCUMENT_SYM){ + this._document(); } else if (!this._ruleset()){ break; } @@ -1780,6 +1796,8 @@ Parser.prototype = function(){ */ var tokenStream = this._tokenStream; + this._readWhitespace(); + tokenStream.mustMatch(Tokens.IDENT); return SyntaxUnit.fromToken(tokenStream.token()); @@ -2003,6 +2021,92 @@ Parser.prototype = function(){ }, + _document: function(){ + /* + * document + * : DOCUMENT_SYM S* + * _document_function [ ',' S* _document_function ]* S* + * '{' S* ruleset* '}' + * ; + */ + + var tokenStream = this._tokenStream, + token, + tt, + functions = [], + prefix = ""; + + tokenStream.mustMatch(Tokens.DOCUMENT_SYM); + token = tokenStream.token(); + if (/^@\-([^\-]+)\-/.test(token.value)) { + prefix = RegExp.$1; + } + + this._readWhitespace(); + functions.push(this._document_function()); + + while(tokenStream.match(Tokens.COMMA)) { + this._readWhitespace(); + functions.push(this._document_function()); + } + + tokenStream.mustMatch(Tokens.LBRACE); + this._readWhitespace(); + + this.fire({ + type: "startdocument", + functions: functions, + prefix: prefix, + line: token.startLine, + col: token.startCol + }); + + while(true) { + if (tokenStream.peek() == Tokens.PAGE_SYM){ + this._page(); + } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ + this._font_face(); + } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ + this._viewport(); + } else if (tokenStream.peek() == Tokens.MEDIA_SYM){ + this._media(); + } else if (!this._ruleset()){ + break; + } + } + + tokenStream.mustMatch(Tokens.RBRACE); + this._readWhitespace(); + + this.fire({ + type: "enddocument", + functions: functions, + prefix: prefix, + line: token.startLine, + col: token.startCol + }); + }, + + _document_function: function(){ + /* + * document_function + * : function | URI S* + * ; + */ + + var tokenStream = this._tokenStream, + value; + + if (tokenStream.match(Tokens.URI)) { + value = tokenStream.token().value; + this._readWhitespace(); + } else { + value = this._function(); + } + + return value; + }, + _operator: function(inFunction){ /* @@ -3545,6 +3649,7 @@ nth ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* ; */ + /*global Validation, ValidationTypes, ValidationError*/ var Properties = { @@ -3556,7 +3661,7 @@ var Properties = { "-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 | | ", - "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", + "alignment-baseline" : "auto | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical | inherit", "animation" : 1, "animation-delay" : { multi: "