Copyright (c) 2016 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
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
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
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
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
var CSSLint = (function(){
var module = module || {},
Copyright (c) 2009-2016 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
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
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
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
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/* Version v1.1.0, Build time: 6-December-2016 10:31:29 */
var parserlib = (function () {
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var Colors = module.exports = {
blanchedalmond :"#ffebcd",
cornflowerblue :"#6495ed",
darkgoldenrod :"#b8860b",
darkolivegreen :"#556b2f",
darkslateblue :"#483d8b",
darkslategray :"#2f4f4f",
darkslategrey :"#2f4f4f",
darkturquoise :"#00ced1",
lavenderblush :"#fff0f5",
lightgoldenrodyellow :"#fafad2",
lightseagreen :"#20b2aa",
lightslategray :"#778899",
lightslategrey :"#778899",
lightsteelblue :"#b0c4de",
mediumaquamarine:"#66cdaa",
mediumseagreen :"#3cb371",
mediumslateblue :"#7b68ee",
mediumspringgreen :"#00fa9a",
mediumturquoise :"#48d1cc",
mediumvioletred :"#c71585",
palegoldenrod :"#eee8aa",
paleturquoise :"#afeeee",
palevioletred :"#d87093",
//'currentColor' color keyword https://www.w3.org/TR/css3-color/#currentcolor
currentColor :"The value of the 'color' property.",
//CSS2 system colors https://www.w3.org/TR/css3-color/#css2-system
activeBorder :"Active window border.",
activecaption :"Active window caption.",
appworkspace :"Background color of multiple document interface.",
background :"Desktop background.",
buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttontext :"Text on push buttons.",
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.",
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.",
highlighttext :"Text of item(s) selected in a control.",
inactiveborder :"Inactive window border.",
inactivecaption :"Inactive window caption.",
inactivecaptiontext :"Color of text in an inactive caption.",
infobackground :"Background color for tooltip controls.",
infotext :"Text color for tooltip controls.",
menu :"Menu background.",
menutext :"Text in menus.",
scrollbar :"Scroll bar gray area.",
threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
window :"Window background.",
windowframe :"Window frame.",
windowtext :"Text in windows."
},{}],2:[function(require,module,exports){
module.exports = Combinator;
var SyntaxUnit = require("../util/SyntaxUnit");
var Parser = require("./Parser");
* Represents a selector combinator (whitespace, +, >).
* @namespace parserlib.css
* @extends parserlib.util.SyntaxUnit
* @param {String} text The text representation of the unit.
* @param {int} line The line of text on which the unit resides.
* @param {int} col The column of text on which the unit resides.
function Combinator(text, line, col) {
SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE);
if (/^\s+$/.test(text)) {
this.type = "descendant";
} else if (text === ">") {
} else if (text === "+") {
this.type = "adjacent-sibling";
} else if (text === "~") {
Combinator.prototype = new SyntaxUnit();
Combinator.prototype.constructor = Combinator;
},{"../util/SyntaxUnit":26,"./Parser":6}],3:[function(require,module,exports){
module.exports = Matcher;
var StringReader = require("../util/StringReader");
var SyntaxError = require("../util/SyntaxError");
* This class implements a combinator library for matcher functions.
* The combinators are described at:
* https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax#Component_value_combinators
function Matcher(matchFunc, toString) {
this.match = function(expression) {
// Save/restore marks to ensure that failed matches always restore
// the original location in the expression.
result = matchFunc(expression);
this.toString = typeof toString === "function" ? toString : function() {
/** Precedence table of combinators. */
/** Simple recursive-descent grammar to build matchers from strings. */
Matcher.parse = function(str) {
var reader, eat, expr, oror, andand, seq, mod, term, result;
reader = new StringReader(str);
eat = function(matcher) {
var result = reader.readMatch(matcher);
"Expected "+matcher, reader.getLine(), reader.getCol());
// expr = oror (" | " oror)*
while (reader.readMatch(" | ") !== null) {
return m.length === 1 ? m[0] : Matcher.alt.apply(Matcher, m);
// oror = andand ( " || " andand)*
while (reader.readMatch(" || ") !== null) {
return m.length === 1 ? m[0] : Matcher.oror.apply(Matcher, m);
// andand = seq ( " && " seq)*
while (reader.readMatch(" && ") !== null) {
return m.length === 1 ? m[0] : Matcher.andand.apply(Matcher, m);
while (reader.readMatch(/^ (?![&|\]])/) !== null) {
return m.length === 1 ? m[0] : Matcher.seq.apply(Matcher, m);
// mod = term ( "?" | "*" | "+" | "#" | "{<num>,<num>}" )?
if (reader.readMatch("?") !== null) {
} else if (reader.readMatch("*") !== null) {
} else if (reader.readMatch("+") !== null) {
} else if (reader.readMatch("#") !== null) {
} else if (reader.readMatch(/^\{\s*/) !== null) {
return m.braces(+min, +max);
// term = <nt> | literal | "[ " expression " ]"
if (reader.readMatch("[ ") !== null) {
return Matcher.fromType(eat(/^[^ ?*+#{]+/));
"Expected end of string", reader.getLine(), reader.getCol());
* Convert a string to a matcher (parsing simple alternations),
* or do nothing if the argument is already a matcher.
Matcher.cast = function(m) {
if (m instanceof Matcher) {
* Create a matcher for a single type.
Matcher.fromType = function(type) {
// Late require of ValidationTypes to break a dependency cycle.
var ValidationTypes = require("./ValidationTypes");
return new Matcher(function(expression) {
return expression.hasNext() && ValidationTypes.isType(expression, type);
* Create a matcher for one or more juxtaposed words, which all must
* occur, in the given order.
Matcher.seq = function() {
var ms = Array.prototype.slice.call(arguments).map(Matcher.cast);
return new Matcher(function(expression) {
for (i = 0; result && i < ms.length; i++) {
result = ms[i].match(expression);
var p = Matcher.prec.SEQ;
var s = ms.map(function(m) {
* Create a matcher for one or more alternatives, where exactly one
Matcher.alt = function() {
var ms = Array.prototype.slice.call(arguments).map(Matcher.cast);
return new Matcher(function(expression) {
for (i = 0; !result && i < ms.length; i++) {
result = ms[i].match(expression);
var p = Matcher.prec.ALT;
var s = ms.map(function(m) {
* Create a matcher for two or more options. This implements the
* double bar (||) and double ampersand (&&) operators, as well as
* variants of && where some of the alternatives are optional.
* This will backtrack through even successful matches to try to
* maximize the number of items matched.
Matcher.many = function(required) {
var ms = Array.prototype.slice.call(arguments, 1).reduce(function(acc, v) {
// Insert all of the options for the given complex rule as
var ValidationTypes = require("./ValidationTypes");
acc.push.apply(acc, ValidationTypes.complex[v.expand].options);