mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #13835: classes separated by form feed
(cherry picked from commit d8a35011ec
)
This commit is contained in:
parent
42c25656d1
commit
a7f42d9966
@ -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|object)$/i,
|
||||
rclickable = /^(?:a|area)$/i,
|
||||
|
@ -1357,6 +1357,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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user