@@ -40,7 +40,7 @@ CSSLint.addRule({
40
40
41
41
if ( heightProperties [ name ] || widthProperties [ name ] ) {
42
42
if ( ! / ^ 0 \S * $ / . test ( event . value ) && ! ( name == "border" && event . value == "none" ) ) {
43
- properties [ name ] = { line : event . property . line , col : event . property . col } ;
43
+ properties [ name ] = { line : event . property . line , col : event . property . col , value : event . value } ;
44
44
}
45
45
} else {
46
46
if ( name == "width" || name == "height" ) {
@@ -55,15 +55,26 @@ CSSLint.addRule({
55
55
if ( properties [ "height" ] ) {
56
56
for ( prop in heightProperties ) {
57
57
if ( heightProperties . hasOwnProperty ( prop ) && properties [ prop ] ) {
58
- reporter . warn ( "Broken box model: using height with " + prop + "." , properties [ prop ] . line , properties [ prop ] . col , rule ) ;
58
+
59
+ //special case for padding
60
+ if ( prop == "padding" && properties [ prop ] . value . parts . length == 2 && properties [ prop ] . value . parts [ 0 ] . value == 0 ) {
61
+ //noop
62
+ } else {
63
+ reporter . warn ( "Broken box model: using height with " + prop + "." , properties [ prop ] . line , properties [ prop ] . col , rule ) ;
64
+ }
59
65
}
60
66
}
61
67
}
62
68
63
69
if ( properties [ "width" ] ) {
64
70
for ( prop in widthProperties ) {
65
71
if ( widthProperties . hasOwnProperty ( prop ) && properties [ prop ] ) {
66
- reporter . warn ( "Broken box model: using width with " + prop + "." , properties [ prop ] . line , properties [ prop ] . col , rule ) ;
72
+
73
+ if ( prop == "padding" && properties [ prop ] . value . parts . length == 2 && properties [ prop ] . value . parts [ 1 ] . value == 0 ) {
74
+ //noop
75
+ } else {
76
+ reporter . warn ( "Broken box model: using width with " + prop + "." , properties [ prop ] . line , properties [ prop ] . col , rule ) ;
77
+ }
67
78
}
68
79
}
69
80
}
0 commit comments