# This rule is taken from https://github.com/stubbornella/csslint/tree/master/src/rules # # # Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. # TODO: Paste the CSSLint LICENSE here. # # # /* # * Rule: Don't use unqualified attribute selectors because they're just like universal selectors. # */ # /*global CSSLint*/ # CSSLint.addRule({ # # //rule information # id: "unqualified-attributes", # name: "Disallow unqualified attribute selectors", # desc: "Unqualified attribute selectors are known to be slow.", # browsers: "All", # # //initialization # init: function(parser, reporter){ # var rule = this; # # parser.addListener("startrule", function(event){ # # var selectors = event.selectors, # selector, # part, # modifier, # i, j, k; # # for (i=0; i < selectors.length; i++){ # selector = selectors[i]; # # part = selector.parts[selector.parts.length-1]; # if (part.type == parser.SELECTOR_PART_TYPE){ # for (k=0; k < part.modifiers.length; k++){ # modifier = part.modifiers[k]; # if (modifier.type == "attribute" && (!part.elementName || part.elementName == "*")){ # reporter.report(rule.desc, part.line, part.col, rule); # } # } # } # # } # }); # } # # });