Skip to content
Permalink
Browse files

Fix #13835: classes separated by form feed

  • Loading branch information
gibson042 committed May 14, 2013
1 parent d80c6ac commit d8a35011ec05ed3493a85c1bd699902893cd437c
Showing with 21 additions and 1 deletion.
  1. +1 −1 src/attributes.js
  2. +20 −0 test/unit/attributes.js
@@ -1,5 +1,5 @@
var nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rclass = /[\t\r\n\f]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button)$/i;

@@ -1353,6 +1353,26 @@ test( "contents().hasClass() returns correct values", function() {
ok( !$contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" );
});

test( "hasClass correctly interprets non-space separators (#13835)", function() {
expect( 4 );

var
map = {
tab: "	",
"line-feed": "
",
"form-feed": "",
"carriage-return": "
"
},
classes = jQuery.map( map, function( separator, label ) {
return " " + separator + label + separator + " ";
}),
$div = jQuery( "<div class='" + classes + "'></div>" );

jQuery.each( map, function( label ) {
ok( $div.hasClass( label ), label.replace( "-", " " ) );
});
});

test( "coords returns correct values in IE6/IE7, see #10828", function() {
expect( 1 );

0 comments on commit d8a3501

Please sign in to comment.
You can’t perform that action at this time.