Skip to content

Commit 2f43244

Browse files
author
Nicholas C. Zakas
committed
Cleanup of text-indent rule and tests
1 parent 61b87e9 commit 2f43244

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/rules/text-indent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CSSLint.addRule({
2424
//event handler for end of rules
2525
function endRule(event){
2626
if (textIndent){
27-
reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set text-direction for that item to ltr.", textIndent.line, textIndent.col, rule);
27+
reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule);
2828
}
2929
}
3030

tests/rules/text-indent.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var result = CSSLint.verify(".foo{text-indent: -100px;}", {"text-indent": 1 });
1212
Assert.areEqual(1, result.messages.length);
1313
Assert.areEqual("warning", result.messages[0].type);
14-
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set text-direction for that item to ltr.", result.messages[0].message);
14+
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", result.messages[0].message);
1515
},
1616

1717
"-98px text-indent should not result in a warning": function(){
@@ -24,6 +24,13 @@
2424
Assert.areEqual(0, result.messages.length);
2525
},
2626

27+
"-100px text-indent with RTL should result in a warning": function(){
28+
var result = CSSLint.verify(".foo{text-indent: -100px; direction: rtl; }", {"text-indent": 1 });
29+
Assert.areEqual(1, result.messages.length);
30+
Assert.areEqual("warning", result.messages[0].type);
31+
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", result.messages[0].message);
32+
},
33+
2734
"5px text-indent should not result in a warning": function(){
2835
var result = CSSLint.verify(".foo{text-indent: 5px;}", {"text-indent": 1 });
2936
Assert.areEqual(0, result.messages.length);
@@ -33,7 +40,7 @@
3340
var result = CSSLint.verify(".top h1 a { background: url(../images/background/logo.png) no-repeat; display: block; height: 44px; position: relative; text-indent: -9999px; width: 250px; }", { "text-indent": 1 });
3441
Assert.areEqual(1, result.messages.length);
3542
Assert.areEqual("warning", result.messages[0].type);
36-
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set text-direction for that item to ltr.", result.messages[0].message);
43+
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", result.messages[0].message);
3744
}
3845

3946
}));

0 commit comments

Comments
 (0)