Skip to content

Commit

Permalink
Fix unqualified attribute issue (fixes #237)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Feb 10, 2012
1 parent 12397f0 commit 906ab0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/unqualified-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ CSSLint.addRule({
if (part.type == parser.SELECTOR_PART_TYPE){
for (k=0; k < part.modifiers.length; k++){
modifier = part.modifiers[k];
if (modifier.type == "attribute" && (!modifier.elementName || modifier.elementName == "*")){
reporter.report(rule.desc, modifier.line, modifier.col, rule);
if (modifier.type == "attribute" && (!part.elementName || part.elementName == "*")){
reporter.report(rule.desc, part.line, part.col, rule);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions tests/rules/unqualified-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
"Using an unqualified attribute selector in the middle should not result in a warning": function(){
var result = CSSLint.verify("[type=text] .foo { font-size: 10px; } ", {"unqualified-attributes": 1 });
Assert.areEqual(0, result.messages.length);
},

"Using a qualified attribute selector should not result in a warning": function(){
var result = CSSLint.verify("input[type=text] { font-size: 10px; } ", {"unqualified-attributes": 1 });
Assert.areEqual(0, result.messages.length);
}


}));

})();

0 comments on commit 906ab0a

Please sign in to comment.