diff --git a/src/manipulation.js b/src/manipulation.js
index 017345afb4..dec21ea0b4 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -33,13 +33,6 @@ define( [
var
- /* eslint-disable max-len */
-
- // See https://github.com/eslint/eslint/issues/3229
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
-
- /* eslint-enable */
-
// Support: IE <=10 - 11, Edge 12 - 13 only
// In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/
@@ -236,7 +229,7 @@ function remove( elem, selector, keepData ) {
jQuery.extend( {
htmlPrefilter: function( html ) {
- return html.replace( rxhtmlTag, "<$1>$2>" );
+ return html;
},
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
diff --git a/test/data/testinit.js b/test/data/testinit.js
index cfbee6d734..b27ac4caab 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -251,7 +251,7 @@ this.testIframe = function( title, fileName, func, wrapper ) {
}
wrapper.call( QUnit, title, function( assert ) {
var done = assert.async(),
- $iframe = supportjQuery( "" )
+ $iframe = supportjQuery( "" )
.css( { position: "absolute", top: "0", left: "-600px", width: "500px" } )
.attr( { id: "qunit-fixture-iframe", src: url( fileName ) } );
diff --git a/test/localfile.html b/test/localfile.html
index fbafe02ccc..5a79bfec17 100644
--- a/test/localfile.html
+++ b/test/localfile.html
@@ -49,7 +49,7 @@
" ).appendTo( "#qunit-fixture" );
@@ -136,7 +136,7 @@ QUnit.test( "attr(String)", function( assert ) {
assert.equal( $img.attr( "height" ), "53", "Retrieve height attribute on an element with display:none." );
// Check for style support
- styleElem = jQuery( "
" ).appendTo( "#qunit-fixture" ).css( {
+ styleElem = jQuery( "
" ).appendTo( "#qunit-fixture" ).css( {
background: "url(UPPERlower.gif)"
} );
assert.ok( !!~styleElem.attr( "style" ).indexOf( "UPPERlower.gif" ), "Check style attribute getter" );
@@ -158,11 +158,11 @@ QUnit.test( "attr(String)", function( assert ) {
$a = jQuery( "Click " ).appendTo( "#qunit-fixture" );
assert.equal( $a.attr( "onclick" ), "something()", "Retrieve ^on attribute without anonymous function wrapper." );
- assert.ok( jQuery( "
" ).attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no attribute is found." );
- assert.ok( jQuery( "
" ).attr( "title" ) === undefined, "Make sure undefined is returned when no attribute is found." );
- assert.equal( jQuery( "
" ).attr( "title", "something" ).attr( "title" ), "something", "Set the title attribute." );
+ assert.ok( jQuery( "
" ).attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no attribute is found." );
+ assert.ok( jQuery( "
" ).attr( "title" ) === undefined, "Make sure undefined is returned when no attribute is found." );
+ assert.equal( jQuery( "
" ).attr( "title", "something" ).attr( "title" ), "something", "Set the title attribute." );
assert.ok( jQuery().attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no element is there." );
- assert.equal( jQuery( "
" ).attr( "value" ), undefined, "An unset value on a div returns undefined." );
+ assert.equal( jQuery( "
" ).attr( "value" ), undefined, "An unset value on a div returns undefined." );
assert.strictEqual( jQuery( " " ).attr( "value" ), undefined, "An unset value on a select returns undefined." );
$form = jQuery( "#form" ).attr( "enctype", "multipart/form-data" );
@@ -180,7 +180,7 @@ QUnit.test( "attr(String) on cloned elements, #9646", function( assert ) {
assert.strictEqual( input.clone( true ).attr( "name", "test" )[ 0 ].name, "test", "Name attribute should be changed on cloned element" );
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.attr( "id" );
assert.strictEqual( div.clone( true ).attr( "id", "test" )[ 0 ].id, "test", "Id attribute should be changed on cloned element" );
@@ -299,7 +299,7 @@ QUnit.test( "attr(String, Object)", function( assert ) {
$input = jQuery( " " ).attr( "checked", true );
assert.equal( $input.prop( "checked" ), true, "Setting checked updates property (verified by .prop)" );
assert.equal( $input[ 0 ].checked, true, "Setting checked updates property (verified by native property)" );
- $input = jQuery( " " ).attr( "selected", true );
+ $input = jQuery( " " ).attr( "selected", true );
assert.equal( $input.prop( "selected" ), true, "Setting selected updates property (verified by .prop)" );
assert.equal( $input[ 0 ].selected, true, "Setting selected updates property (verified by native property)" );
@@ -592,7 +592,7 @@ QUnit.test( "removeAttr(String)", function( assert ) {
assert.expect( 12 );
var $first;
- assert.equal( jQuery( "
" ).removeAttr( "class" ).attr( "class" ), undefined, "remove class" );
+ assert.equal( jQuery( "
" ).removeAttr( "class" ).attr( "class" ), undefined, "remove class" );
assert.equal( jQuery( "#form" ).removeAttr( "id" ).attr( "id" ), undefined, "Remove id" );
assert.equal( jQuery( "#foo" ).attr( "style", "position:absolute;" ).removeAttr( "style" ).attr( "style" ), undefined, "Check removing style attribute" );
assert.equal( jQuery( "#form" ).attr( "style", "position:absolute;" ).removeAttr( "style" ).attr( "style" ), undefined, "Check removing style attribute on a form" );
@@ -692,7 +692,7 @@ QUnit.test( "prop(String, Object)", function( assert ) {
assert.equal( jQuery( "#select2" ).prop( "selectedIndex" ), 3, "Check for selectedIndex attribute" );
assert.equal( jQuery( "#foo" ).prop( "nodeName" ).toUpperCase(), "DIV", "Check for nodeName attribute" );
assert.equal( jQuery( "#foo" ).prop( "tagName" ).toUpperCase(), "DIV", "Check for tagName attribute" );
- assert.equal( jQuery( " " ).prop( "selected" ), false, "Check selected attribute on disconnected element." );
+ assert.equal( jQuery( " " ).prop( "selected" ), false, "Check selected attribute on disconnected element." );
assert.equal( jQuery( "#listWithTabIndex" ).prop( "tabindex" ), 5, "Check retrieving tabindex" );
jQuery( "#text1" ).prop( "readonly", true );
@@ -837,16 +837,16 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732
function addOptions( $elem ) {
return $elem.append(
- jQuery( " " ).val( "a" ).text( "One" ),
- jQuery( " " ).val( "b" ).text( "Two" ),
- jQuery( " " ).val( "c" ).text( "Three" )
+ jQuery( " " ).val( "a" ).text( "One" ),
+ jQuery( " " ).val( "b" ).text( "Two" ),
+ jQuery( " " ).val( "c" ).text( "Three" )
)
.find( "[value=a]" ).prop( "selected", true ).end()
.find( "[value=c]" ).prop( "selected", true ).end();
}
var $optgroup,
- $select = jQuery( " " );
+ $select = jQuery( " " );
// Check select with options
addOptions( $select ).appendTo( "#qunit-fixture" );
@@ -856,7 +856,7 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732
$select.empty();
// Check select with optgroup
- $optgroup = jQuery( " " );
+ $optgroup = jQuery( " " );
addOptions( $optgroup ).appendTo( $select );
$select.find( "[value=b]" ).prop( "selected", true );
@@ -970,7 +970,7 @@ QUnit.test( "val()", function( assert ) {
assert.equal( $button.val(), "foobar", "Value retrieval on a button does not return innerHTML" );
assert.equal( $button.val( "baz" ).html(), "text", "Setting the value does not change innerHTML" );
- assert.equal( jQuery( " " ).val( "test" ).attr( "value" ), "test", "Setting value sets the value attribute" );
+ assert.equal( jQuery( " " ).val( "test" ).attr( "value" ), "test", "Setting value sets the value attribute" );
} );
QUnit.test( "val() with non-matching values on dropdown list", function( assert ) {
@@ -1029,7 +1029,7 @@ var testVal = function( valueObj, assert ) {
assert.equal( document.getElementById( "text1" ).value, "", "Check for modified (via val(null)) value of input element" );
var j,
- $select = jQuery( " " ),
+ $select = jQuery( " " ),
$select1 = jQuery( "#select1" );
$select1.val( valueObj( "3" ) );
@@ -1145,7 +1145,7 @@ QUnit.test( "val(select) after form.reset() (Bug #2551)", function( assert ) {
QUnit.test( "select.val(space characters) (gh-2978)", function( assert ) {
assert.expect( 37 );
- var $select = jQuery( " " ).appendTo( "#qunit-fixture" ),
+ var $select = jQuery( " " ).appendTo( "#qunit-fixture" ),
spaces = {
"\\t": {
html: " ",
@@ -1230,7 +1230,7 @@ var testAddClass = function( valueObj, assert ) {
j.addClass( valueObj( "asdf" ) );
assert.ok( j.hasClass( "asdf" ), "Check node,textnode,comment for addClass" );
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.addClass( valueObj( "test" ) );
assert.equal( div.attr( "class" ), "test", "Make sure there's no extra whitespace." );
@@ -1669,9 +1669,9 @@ QUnit.test( "coords returns correct values in IE6/IE7, see #10828", function( as
assert.expect( 1 );
var area,
- map = jQuery( " " );
+ map = jQuery( " " );
- area = map.html( " " ).find( "area" );
+ area = map.html( " " ).find( "area" );
assert.equal( area.attr( "coords" ), "0,0,0,0", "did not retrieve coords correctly" );
} );
@@ -1679,7 +1679,7 @@ QUnit.test( "should not throw at $(option).val() (#14686)", function( assert ) {
assert.expect( 1 );
try {
- jQuery( " " ).val();
+ jQuery( " " ).val();
assert.ok( true );
} catch ( _ ) {
assert.ok( false );
diff --git a/test/unit/basic.js b/test/unit/basic.js
index 9cb7d25bef..aadf36fa37 100644
--- a/test/unit/basic.js
+++ b/test/unit/basic.js
@@ -36,7 +36,7 @@ QUnit.test( "ajax", function( assert ) {
QUnit.test( "attributes", function( assert ) {
assert.expect( 6 );
- var a = jQuery( " " ).appendTo( "#qunit-fixture" ),
+ var a = jQuery( " " ).appendTo( "#qunit-fixture" ),
input = jQuery( " " ).appendTo( "#qunit-fixture" );
assert.strictEqual( a.attr( "foo", "bar" ).attr( "foo" ), "bar", ".attr getter/setter" );
@@ -56,7 +56,7 @@ if ( jQuery.css ) {
QUnit.test( "css", function( assert ) {
assert.expect( 1 );
- var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
assert.strictEqual( div.css( "width", "50px" ).css( "width" ), "50px", ".css getter/setter" );
} );
@@ -66,7 +66,7 @@ if ( jQuery.fn.show && jQuery.fn.hide ) {
QUnit.test( "show/hide", function( assert ) {
assert.expect( 2 );
- var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
div.hide();
assert.strictEqual( div.css( "display" ), "none", "div hidden" );
@@ -126,7 +126,7 @@ QUnit.test( "core", function( assert ) {
QUnit.test( "data", function( assert ) {
assert.expect( 4 );
- var elem = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var elem = jQuery( "
" ).appendTo( "#qunit-fixture" );
assert.ok( !jQuery.hasData( elem[ 0 ] ), "jQuery.hasData - false" );
assert.strictEqual( elem.data( "a", "b" ).data( "a" ), "b", ".data getter/setter" );
@@ -138,7 +138,7 @@ QUnit.test( "dimensions", function( assert ) {
assert.expect( 3 );
var elem = jQuery(
- "
"
+ "
"
).appendTo( "#qunit-fixture" );
assert.strictEqual( elem.width( 50 ).width(), 50, ".width getter/setter" );
@@ -149,7 +149,7 @@ QUnit.test( "dimensions", function( assert ) {
QUnit.test( "event", function( assert ) {
assert.expect( 1 );
- var elem = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var elem = jQuery( "
" ).appendTo( "#qunit-fixture" );
elem
.on( "click", function() {
@@ -168,12 +168,12 @@ QUnit.test( "manipulation", function( assert ) {
var child,
elem1 = jQuery( "
" ).appendTo( "#qunit-fixture" ),
- elem2 = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ elem2 = jQuery( "
" ).appendTo( "#qunit-fixture" );
assert.strictEqual( elem1.text( "foo" ).text(), "foo", ".html getter/setter" );
assert.strictEqual(
- elem1.html( " " ).html(),
+ elem1.html( " " ).html(),
" ",
".html getter/setter"
);
@@ -182,8 +182,8 @@ QUnit.test( "manipulation", function( assert ) {
assert.strictEqual( elem1.prepend( elem2 )[ 0 ].childNodes[ 0 ], elem2[ 0 ], ".prepend" );
child = elem1.find( "span" );
- child.after( " " );
- child.before( " " );
+ child.after( " " );
+ child.before( " " );
assert.strictEqual(
elem1.html(),
@@ -197,8 +197,8 @@ QUnit.test( "manipulation", function( assert ) {
QUnit[ /jsdom\//.test( navigator.userAgent ) ? "skip" : "test" ]( "offset", function( assert ) {
assert.expect( 3 );
- var parent = jQuery( "
" ).appendTo( "#qunit-fixture" ),
- elem = jQuery( "
" ).appendTo( parent );
+ var parent = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ elem = jQuery( "
" ).appendTo( parent );
assert.strictEqual( elem.offset().top, 25, ".offset getter" );
assert.strictEqual( elem.position().top, 5, ".position getter" );
diff --git a/test/unit/core.js b/test/unit/core.js
index 1c3dc73657..b31ee9e2be 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -23,9 +23,9 @@ QUnit.test( "jQuery()", function( assert ) {
var elem, i,
obj = jQuery( "div" ),
- code = jQuery( "
" ),
+ code = jQuery( "
" ),
img = jQuery( " " ),
- div = jQuery( "
" ),
+ div = jQuery( "
" ),
exec = false,
expected = 23,
attrObj = {
@@ -113,7 +113,7 @@ QUnit.test( "jQuery()", function( assert ) {
elem = jQuery( "\n\nworld " )[ 0 ];
assert.equal( elem.nodeName.toLowerCase(), "em", "leading newlines" );
- elem = jQuery( "
", attrObj );
+ elem = jQuery( "
", attrObj );
if ( jQuery.fn.width ) {
assert.equal( elem[ 0 ].style.width, "10px", "jQuery() quick setter width" );
@@ -458,7 +458,7 @@ QUnit.test( "jQuery('html')", function( assert ) {
assert.ok( jQuery( " " )[ 0 ], "Creating a link" );
- assert.ok( !jQuery( "" )[ 0 ].parentNode, "Create a script" );
+ assert.ok( !jQuery( "" )[ 0 ].parentNode, "Create a script" );
assert.ok( jQuery( " " ).attr( "type", "hidden" ), "Create an input and set the type." );
@@ -526,8 +526,8 @@ QUnit.test( "jQuery('massive html #7990')", function( assert ) {
QUnit.test( "jQuery('html', context)", function( assert ) {
assert.expect( 1 );
- var $div = jQuery( "
" )[ 0 ],
- $span = jQuery( " ", $div );
+ var $div = jQuery( "
" )[ 0 ],
+ $span = jQuery( " ", $div );
assert.equal( $span.length, 1, "verify a span created with a div context works, #1763" );
} );
@@ -1356,7 +1356,7 @@ QUnit.test( "jQuery.parseHTML", function( assert ) {
assert.equal( jQuery.parseHTML( "text" )[ 0 ].nodeType, 3, "Parsing text returns a text node" );
assert.equal( jQuery.parseHTML( "\t
" )[ 0 ].nodeValue, "\t", "Preserve leading whitespace" );
- assert.equal( jQuery.parseHTML( "
" )[ 0 ].nodeType, 3, "Leading spaces are treated as text nodes (#11290)" );
+ assert.equal( jQuery.parseHTML( "
" )[ 0 ].nodeType, 3, "Leading spaces are treated as text nodes (#11290)" );
html = jQuery.parseHTML( "test div
" );
diff --git a/test/unit/css.js b/test/unit/css.js
index 190e6d169d..c6a17a7c84 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -13,7 +13,7 @@ QUnit.test( "css(String|Hash)", function( assert ) {
assert.notEqual( $child.css( "width" ), "20px", "Retrieving a width percentage on the child of a hidden div returns percentage" );
assert.notEqual( $child.css( "height" ), "20px", "Retrieving a height percentage on the child of a hidden div returns percentage" );
- div = jQuery( "
" );
+ div = jQuery( "
" );
// These should be "auto" (or some better value)
// temporarily provide "0px" for backwards compat
@@ -25,7 +25,7 @@ QUnit.test( "css(String|Hash)", function( assert ) {
assert.equal( div.css( "width" ), "4px", "Width on disconnected node." );
assert.equal( div.css( "height" ), "4px", "Height on disconnected node." );
- div2 = jQuery( "" ).appendTo( "body" );
+ div2 = jQuery( "" ).appendTo( "body" );
assert.equal( div2.find( "input" ).css( "height" ), "20px", "Height on hidden input." );
assert.equal( div2.find( "textarea" ).css( "height" ), "20px", "Height on hidden textarea." );
@@ -42,7 +42,7 @@ QUnit.test( "css(String|Hash)", function( assert ) {
assert.equal( parseFloat( jQuery( "#nothiddendiv" ).css( "width" ) ), 0, "Test negative width set to 0" );
assert.equal( parseFloat( jQuery( "#nothiddendiv" ).css( "height" ) ), 0, "Test negative height set to 0" );
- assert.equal( jQuery( "
" ).css( "display" ), "none", "Styles on disconnected nodes" );
+ assert.equal( jQuery( "
" ).css( "display" ), "none", "Styles on disconnected nodes" );
jQuery( "#floatTest" ).css( { "float": "right" } );
assert.equal( jQuery( "#floatTest" ).css( "float" ), "right", "Modified CSS float using \"float\": Assert float is right" );
@@ -111,7 +111,7 @@ QUnit.test( "css(String|Hash)", function( assert ) {
assert.strictEqual( child.css( "x-fake" ), undefined, "Make sure undefined is returned from css(nonexistent)." );
- div = jQuery( "
" ).css( { position: "absolute", "z-index": 1000 } ).appendTo( "#qunit-fixture" );
+ div = jQuery( "
" ).css( { position: "absolute", "z-index": 1000 } ).appendTo( "#qunit-fixture" );
assert.strictEqual( div.css( "z-index" ), "1000",
"Make sure that a string z-index is returned from css('z-index') (#14432)." );
} );
@@ -275,10 +275,10 @@ QUnit.test( "css() mismatched relative values with bounded styles (gh-2144)", fu
assert.expect( 1 );
var right,
- $container = jQuery( "
" )
+ $container = jQuery( "
" )
.css( { position: "absolute", width: "400px", fontSize: "4px" } )
.appendTo( "#qunit-fixture" ),
- $el = jQuery( "
" )
+ $el = jQuery( "
" )
.css( { position: "absolute", left: "50%", right: "50%" } )
.appendTo( $container );
@@ -574,7 +574,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
assert.equal( div.css( "display" ), "none",
"A shown-while-detached div inside a visible div can be hidden by the CSS cascade" );
- span = jQuery( " " );
+ span = jQuery( " " );
span.show().appendTo( "#qunit-fixture" );
assert.equal( span.css( "display" ), "none",
"A shown-while-detached span can be hidden by the CSS cascade" );
@@ -588,7 +588,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
"A shown-while-detached cascade-hidden div is hidden after attachment" );
div.remove();
- span = jQuery( " " );
+ span = jQuery( " " );
span.appendTo( "#qunit-fixture" ).detach().show().appendTo( "#qunit-fixture" );
assert.equal( span.css( "display" ), "none",
"A shown-while-detached cascade-hidden span is hidden after attachment" );
@@ -615,7 +615,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
"A shown-while-detached inline-hidden div inside a visible div has default display " +
"after attachment" );
- span = jQuery( " " );
+ span = jQuery( " " );
span.show();
assert.equal( span[ 0 ].style.display, "",
"show() updates inline style of a detached inline-hidden span" );
@@ -623,20 +623,20 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
assert.equal( span.css( "display" ), "inline",
"A shown-while-detached inline-hidden span has default display after attachment" );
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.show().appendTo( "#qunit-fixture" );
assert.equal( div.css( "display" ), "inline",
"show() does not update inline style of a detached inline-visible div" );
div.remove();
- tr = jQuery( " " );
+ tr = jQuery( " " );
jQuery( "#table" ).append( tr );
tr.detach().hide().show();
assert.ok( !tr[ 0 ].style.display, "Not-hidden detached tr elements have no inline style" );
tr.remove();
- span = jQuery( " " ).hide().show();
+ span = jQuery( " " ).hide().show();
assert.ok( !span[ 0 ].style.display, "Not-hidden detached span elements have no inline style" );
span.remove();
} );
@@ -718,7 +718,7 @@ QUnit.test( "hide hidden elements (bug #7141)", function( assert ) {
QUnit.test( "show() after hide() should always set display to initial value (#14750)", function( assert ) {
assert.expect( 1 );
- var div = jQuery( "
" ),
+ var div = jQuery( "
" ),
fixture = jQuery( "#qunit-fixture" );
fixture.append( div );
@@ -732,11 +732,11 @@ QUnit.test( "show/hide 3.0, default display", function( assert ) {
assert.expect( 36 );
var i,
- $elems = jQuery( "
" )
+ $elems = jQuery( "
" )
.appendTo( "#qunit-fixture" )
- .html( "
" +
- " " +
- "" )
+ .html( "
" +
+ " " +
+ "" )
.find( "[data-expected-display]" );
$elems.each( function() {
@@ -790,9 +790,9 @@ QUnit.test( "show/hide 3.0, cascade display", function( assert ) {
assert.expect( 36 );
var i,
- $elems = jQuery( "
" )
+ $elems = jQuery( "
" )
.appendTo( "#qunit-fixture" )
- .html( "
" )
+ .html( "
" )
.children();
$elems.each( function() {
@@ -829,17 +829,17 @@ QUnit.test( "show/hide 3.0, inline display", function( assert ) {
assert.expect( 96 );
var i,
- $elems = jQuery( "
" )
+ $elems = jQuery( "
" )
.appendTo( "#qunit-fixture" )
- .html( " " +
- " " +
- "
" +
- "
" +
+ .html( " " +
+ " " +
+ "
" +
+ "
" +
"" +
- " " +
- " " +
- " " +
- " " +
+ " " +
+ " " +
+ " " +
+ " " +
" " )
.find( "[data-expected-display]" );
@@ -878,15 +878,15 @@ QUnit.test( "show/hide 3.0, cascade hidden", function( assert ) {
assert.expect( 72 );
var i,
- $elems = jQuery( "
" )
+ $elems = jQuery( "
" )
.appendTo( "#qunit-fixture" )
- .html( "
" +
- "
" +
- " " +
- " " +
+ .html( "
" +
+ "
" +
+ " " +
+ " " +
"" +
- " " +
- " " +
+ " " +
+ " " +
" " )
.find( "[data-expected-display]" );
@@ -925,16 +925,16 @@ QUnit.test( "show/hide 3.0, inline hidden", function( assert ) {
assert.expect( 84 );
var i,
- $elems = jQuery( "
" )
+ $elems = jQuery( "
" )
.appendTo( "#qunit-fixture" )
- .html( " " +
- " " +
- "
" +
- "
" +
+ .html( " " +
+ " " +
+ "
" +
+ "
" +
"" +
- " " +
- " " +
- " " +
+ " " +
+ " " +
+ " " +
" " )
.find( "[data-expected-display]" );
@@ -1005,9 +1005,9 @@ QUnit[ jQuery.find.compile && jQuery.fn.toggle ? "test" : "skip" ]( "toggle()",
QUnit[ jQuery.find.compile && jQuery.fn.toggle ? "test" : "skip" ]( "detached toggle()", function( assert ) {
assert.expect( 6 );
- var detached = jQuery( "
" ).find( "*" ).addBack(),
- hiddenDetached = jQuery( "
" ).find( "*" ).addBack().css( "display", "none" ),
- cascadeHiddenDetached = jQuery( "
" ).find( "*" ).addBack().addClass( "hidden" );
+ var detached = jQuery( "
" ).find( "*" ).addBack(),
+ hiddenDetached = jQuery( "
" ).find( "*" ).addBack().css( "display", "none" ),
+ cascadeHiddenDetached = jQuery( "
" ).find( "*" ).addBack().addClass( "hidden" );
detached.toggle();
detached.appendTo( "#qunit-fixture" );
@@ -1108,9 +1108,9 @@ QUnit.test( "computed margins (trac-3333; gh-2237)", function( assert ) {
QUnit.test( "box model properties incorrectly returning % instead of px, see #10639 and #12088", function( assert ) {
assert.expect( 2 );
- var container = jQuery( "
" ).width( 400 ).appendTo( "#qunit-fixture" ),
- el = jQuery( "
" ).css( { "width": "50%", "marginRight": "50%" } ).appendTo( container ),
- el2 = jQuery( "
" ).css( { "width": "50%", "minWidth": "300px", "marginLeft": "25%" } ).appendTo( container );
+ var container = jQuery( "
" ).width( 400 ).appendTo( "#qunit-fixture" ),
+ el = jQuery( "
" ).css( { "width": "50%", "marginRight": "50%" } ).appendTo( container ),
+ el2 = jQuery( "
" ).css( { "width": "50%", "minWidth": "300px", "marginLeft": "25%" } ).appendTo( container );
assert.equal( el.css( "marginRight" ), "200px", "css('marginRight') returning % instead of px, see #10639" );
assert.equal( el2.css( "marginLeft" ), "100px", "css('marginLeft') returning incorrect pixel value, see #12088" );
@@ -1154,10 +1154,10 @@ QUnit.test( "can't get css for disconnected in IE<9, see #10254 and #8388", func
assert.expect( 2 );
var span, div;
- span = jQuery( " " ).css( "background-image", "url(" + baseURL + "1x1.jpg)" );
+ span = jQuery( " " ).css( "background-image", "url(" + baseURL + "1x1.jpg)" );
assert.notEqual( span.css( "background-image" ), null, "can't get background-image in IE<9, see #10254" );
- div = jQuery( "
" ).css( "top", 10 );
+ div = jQuery( "
" ).css( "top", 10 );
assert.equal( div.css( "top" ), "10px", "can't get top in IE<9, see #8388" );
} );
@@ -1172,7 +1172,7 @@ QUnit.test( "Ensure styles are retrieving from parsed html on document fragments
} );
QUnit.test( "can't get background-position in IE<9, see #10796", function( assert ) {
- var div = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ var div = jQuery( "
" ).appendTo( "#qunit-fixture" ),
units = [
"0 0",
"12px 12px",
@@ -1262,7 +1262,7 @@ QUnit[
};
for ( prop in gridProps ) {
- $div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ $div = jQuery( "
" ).appendTo( "#qunit-fixture" );
$div.css( prop, 2 );
value = gridProps[ prop ];
@@ -1627,7 +1627,7 @@ QUnit.test(
QUnit.test( "Don't append px to CSS \"order\" value (#14049)", function( assert ) {
assert.expect( 1 );
- var $elem = jQuery( "
" );
+ var $elem = jQuery( "
" );
$elem.css( "order", 2 );
assert.equal( $elem.css( "order" ), "2", "2 on order" );
@@ -1706,7 +1706,7 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
resetCssPropsFor( "appearance" );
resetCssPropsFor( "transform" );
- elem = jQuery( "
" )
+ elem = jQuery( "
" )
.css( {
msAppearance: "none",
appearance: "none",
@@ -1730,7 +1730,7 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
QUnit.test( "Don't detect fake set properties on a node when caching the prefixed version", function( assert ) {
assert.expect( 1 );
- var elem = jQuery( "
" ),
+ var elem = jQuery( "
" ),
style = elem[ 0 ].style;
style.MozFakeProperty = "old value";
elem.css( "fakeProperty", "new value" );
diff --git a/test/unit/data.js b/test/unit/data.js
index 138bb8399e..55879415fa 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -427,7 +427,7 @@ QUnit.test( ".data(Object)", function( assert ) {
assert.expect( 4 );
var obj, jqobj,
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.data( { "test": "in", "test2": "in2" } );
assert.equal( div.data( "test" ), "in", "Verify setting an object in data" );
@@ -556,7 +556,7 @@ QUnit.test( ".data should not miss preset data-* w/ hyphenated property names",
assert.expect( 2 );
- var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
+ var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
test = {
"camelBar": "camelBar",
"hyphen-foo": "hyphen-foo"
@@ -573,7 +573,7 @@ QUnit.test( "jQuery.data should not miss data-* w/ hyphenated property names #14
assert.expect( 1 );
- var div = jQuery( "
" );
+ var div = jQuery( "
" );
div.data( "foo-bar", "baz" );
@@ -585,14 +585,14 @@ QUnit.test( ".data should not miss attr() set data-* with hyphenated property na
var a, b;
- a = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ a = jQuery( "
" ).appendTo( "#qunit-fixture" );
a.attr( "data-long-param", "test" );
a.data( "long-param", { a: 2 } );
assert.deepEqual( a.data( "long-param" ), { a: 2 }, "data with property long-param was found, 1" );
- b = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ b = jQuery( "
" ).appendTo( "#qunit-fixture" );
b.attr( "data-long-param", "test" );
b.data( "long-param" );
@@ -668,7 +668,7 @@ QUnit.test( ".data should not strip more than one hyphen when camelCasing (gh-20
QUnit.test( ".data supports interoperable hyphenated/camelCase get/set of properties with arbitrary non-null|NaN|undefined values", function( assert ) {
- var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
+ var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
datas = {
"non-empty": {
key: "nonEmpty",
@@ -736,7 +736,7 @@ QUnit.test( ".data supports interoperable hyphenated/camelCase get/set of proper
} );
QUnit.test( ".data supports interoperable removal of hyphenated/camelCase properties", function( assert ) {
- var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
+ var div = jQuery( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
rdashAlpha = /-([a-z])/g,
datas = {
"non-empty": "a string",
@@ -943,7 +943,7 @@ QUnit.test( "Check that the expando is removed when there's no more data", funct
assert.expect( 2 );
var key,
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.data( "some", "data" );
assert.equal( div.data( "some" ), "data", "Data is added" );
div.removeData( "some" );
@@ -977,7 +977,7 @@ QUnit.test( ".data(prop) does not create expando", function( assert ) {
assert.expect( 1 );
var key,
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.data( "foo" );
assert.equal( jQuery.hasData( div[ 0 ] ), false, "No data exists after access" );
@@ -993,7 +993,7 @@ QUnit.test( ".data(prop) does not create expando", function( assert ) {
QUnit.test( "keys matching Object.prototype properties (gh-3256)", function( assert ) {
assert.expect( 2 );
- var div = jQuery( "
" );
+ var div = jQuery( "
" );
assert.strictEqual( div.data( "hasOwnProperty" ), undefined,
"hasOwnProperty not matched (before forced data creation)" );
diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js
index 8ab520e585..a562f0f945 100644
--- a/test/unit/deprecated.js
+++ b/test/unit/deprecated.js
@@ -138,7 +138,7 @@ if ( jQuery.ajax && jQuery.fn.ajaxSend ) {
QUnit[ jQuery.fn.click ? "test" : "skip" ]( "Event aliases", function( assert ) {
// Explicitly skipping focus/blur events due to their flakiness
- var $elem = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ var $elem = jQuery( "
" ).appendTo( "#qunit-fixture" ),
aliases = ( "resize scroll click dblclick mousedown mouseup " +
"mousemove mouseover mouseout mouseenter mouseleave change " +
"select submit keydown keypress keyup contextmenu" ).split( " " );
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js
index f4dc0bd1aa..230f047f31 100644
--- a/test/unit/dimensions.js
+++ b/test/unit/dimensions.js
@@ -342,7 +342,7 @@ QUnit.test( "getting dimensions shouldn't modify runtimeStyle see #9233", functi
QUnit.test( "table dimensions", function( assert ) {
assert.expect( 2 );
- var table = jQuery( "" ).appendTo( "#qunit-fixture" ),
+ var table = jQuery( "" ).appendTo( "#qunit-fixture" ),
tdElem = table.find( "td" ).first(),
colElem = table.find( "col" ).first().width( 300 );
@@ -536,7 +536,7 @@ QUnit.test( "allow modification of coordinates argument (gh-1848)", function( as
assert.expect( 1 );
var offsetTop,
- element = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ element = jQuery( "
" ).appendTo( "#qunit-fixture" );
element.offset( function( index, coords ) {
coords.top = 100;
@@ -583,7 +583,7 @@ QUnit.test( "width/height on element with transform (gh-3193)", function( assert
assert.expect( 2 );
- var $elem = jQuery( "
" )
+ var $elem = jQuery( "
" )
.appendTo( "#qunit-fixture" );
assert.equal( $elem.width(), 200, "Width ignores transforms" );
@@ -663,7 +663,7 @@ QUnit.test( "interaction with scrollbars (gh-3589)", function( assert ) {
return old + adjustment;
};
},
- parent = jQuery( "
" )
+ parent = jQuery( "
" )
.css( { position: "absolute", width: "1000px", height: "1000px" } )
.appendTo( "#qunit-fixture" ),
fraction = jQuery.support.boxSizingReliable() ?
@@ -672,7 +672,7 @@ QUnit.test( "interaction with scrollbars (gh-3589)", function( assert ) {
borderWidth = 1,
padding = 2,
size = 100 + fraction,
- plainBox = jQuery( "
" )
+ plainBox = jQuery( "
" )
.css( {
"box-sizing": "content-box",
position: "absolute",
@@ -759,11 +759,11 @@ QUnit.test( "interaction with scrollbars (gh-3589)", function( assert ) {
QUnit.test( "outerWidth/Height for table cells and textarea with border-box in IE 11 (gh-4102)", function( assert ) {
assert.expect( 5 );
- var $table = jQuery( "" ).appendTo( "#qunit-fixture" ),
- $thead = jQuery( " " ).appendTo( $table ),
- $firstTh = jQuery( " " ),
- $secondTh = jQuery( " " ),
- $thirdTh = jQuery( " " ),
+ var $table = jQuery( "" ).appendTo( "#qunit-fixture" ),
+ $thead = jQuery( " " ).appendTo( $table ),
+ $firstTh = jQuery( " " ),
+ $secondTh = jQuery( " " ),
+ $thirdTh = jQuery( " " ),
// Support: Firefox 63, Edge 16-17, Android 8, iOS 7-11
// These browsers completely ignore the border-box and height settings
@@ -771,12 +771,12 @@ QUnit.test( "outerWidth/Height for table cells and textarea with border-box in I
// Either way, what we're doing in css.js is correct
$td = jQuery( "text " ),
- $tbody = jQuery( " " ).appendTo( $table ),
- $textarea = jQuery( "" ).appendTo( "#qunit-fixture" );
+ $tbody = jQuery( " " ).appendTo( $table ),
+ $textarea = jQuery( "" ).appendTo( "#qunit-fixture" );
- jQuery( " " ).appendTo( $thead ).append( $firstTh );
- jQuery( " " ).appendTo( $thead ).append( $secondTh );
- jQuery( " " ).appendTo( $thead ).append( $thirdTh );
+ jQuery( " " ).appendTo( $thead ).append( $firstTh );
+ jQuery( " " ).appendTo( $thead ).append( $secondTh );
+ jQuery( " " ).appendTo( $thead ).append( $thirdTh );
jQuery( " " ).appendTo( $tbody ).append( $td );
assert.strictEqual( $firstTh.outerWidth(), 200, "First th has outerWidth 200." );
diff --git a/test/unit/effects.js b/test/unit/effects.js
index ba11eabf50..dfe5b7c321 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -605,7 +605,7 @@ QUnit.test( "animate duration 0", function( assert ) {
} );
this.clock.tick( 200 );
- $elem = jQuery( "
" );
+ $elem = jQuery( "
" );
$elem.show( 0, function() {
assert.ok( true, "Show callback with no duration" );
} );
@@ -1302,7 +1302,7 @@ QUnit.test( "animate with CSS shorthand properties", function( assert ) {
QUnit.test( "hide hidden elements, with animation (bug #7141)", function( assert ) {
assert.expect( 4 );
- var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
assert.equal( div.css( "display" ), "none", "Element is initially hidden" );
div.hide( 10, function() {
assert.equal( div.css( "display" ), "none", "Element is hidden in .hide() callback" );
@@ -1603,10 +1603,10 @@ QUnit.test( "animate should set display for disconnected nodes", function( asser
toggle: [ 1 ],
slideToggle: []
},
- $divEmpty = jQuery( "
" ),
+ $divEmpty = jQuery( "
" ),
$divTest = jQuery( "test
" ),
- $divNone = jQuery( "
" ),
- $divInline = jQuery( "
" ),
+ $divNone = jQuery( "
" ),
+ $divInline = jQuery( "
" ),
nullParentDisplay = $divEmpty.css( "display" ),
underFragmentDisplay = $divTest.css( "display" ),
clock = this.clock;
@@ -1626,7 +1626,7 @@ QUnit.test( "animate should set display for disconnected nodes", function( asser
assert.expectJqData( env, $divNone[ 0 ], "olddisplay" );
jQuery.each( showMethods, function( name, opt ) {
- jQuery.fn[ name ].apply( jQuery( "
" ), opt.concat( [ function() {
+ jQuery.fn[ name ].apply( jQuery( "
" ), opt.concat( [ function() {
assert.strictEqual( jQuery( this ).css( "display" ), nullParentDisplay,
"." + name + " block with null parentNode" );
} ] ) );
@@ -1637,7 +1637,7 @@ QUnit.test( "animate should set display for disconnected nodes", function( asser
} ] ) );
} );
jQuery.each( toggleMethods, function( name, opt ) {
- jQuery.fn[ name ].apply( jQuery( "
" ), opt.concat( [ function() {
+ jQuery.fn[ name ].apply( jQuery( "
" ), opt.concat( [ function() {
assert.strictEqual( jQuery( this ).css( "display" ), "none",
"." + name + " block with null parentNode" );
} ] ) );
@@ -2362,8 +2362,8 @@ QUnit.test( "Respect display value on inline elements (#14824)", function( asser
assert.expect( 2 );
var clock = this.clock,
- fromStyleSheet = jQuery( " " ),
- fromStyleAttr = jQuery( " " );
+ fromStyleSheet = jQuery( " " ),
+ fromStyleAttr = jQuery( " " );
jQuery( "#qunit-fixture" ).append( fromStyleSheet, fromStyleAttr );
@@ -2463,7 +2463,7 @@ QUnit.test( "jQuery.easing._default in Tween (gh-2218)", function( assert ) {
QUnit.test( "Display value is correct for disconnected nodes (trac-13310)", function( assert ) {
assert.expect( 3 );
- var div = jQuery( "
" );
+ var div = jQuery( "
" );
assert.equal( div.css( "display", "inline" ).hide().show().appendTo( "body" ).css( "display" ), "inline", "Initialized display value has returned" );
div.remove();
@@ -2484,7 +2484,7 @@ QUnit.test( "Show/hide/toggle and display: inline", function( assert ) {
var clock = this.clock;
- jQuery( "
" ).each( function() {
+ jQuery( "
" ).each( function() {
var completed, interrupted,
N = 100,
fixture = jQuery( "#qunit-fixture" ),
diff --git a/test/unit/event.js b/test/unit/event.js
index 5ad20e3fdc..ea9b67f16f 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -153,7 +153,7 @@ QUnit.test( "on(), multiple events at once and namespaces", function( assert ) {
var cur, div,
obj = {};
- div = jQuery( "
" ).on( "focusin.a", function( e ) {
+ div = jQuery( "
" ).on( "focusin.a", function( e ) {
assert.equal( e.type, cur, "Verify right single event was fired." );
} );
@@ -163,7 +163,7 @@ QUnit.test( "on(), multiple events at once and namespaces", function( assert ) {
// manually clean up detached elements
div.remove();
- div = jQuery( "
" ).on( "click mouseover", obj, function( e ) {
+ div = jQuery( "
" ).on( "click mouseover", obj, function( e ) {
assert.equal( e.type, cur, "Verify right multi event was fired." );
assert.equal( e.data, obj, "Make sure the data came in correctly." );
} );
@@ -177,7 +177,7 @@ QUnit.test( "on(), multiple events at once and namespaces", function( assert ) {
// manually clean up detached elements
div.remove();
- div = jQuery( "
" ).on( "focusin.a focusout.b", function( e ) {
+ div = jQuery( "
" ).on( "focusin.a focusout.b", function( e ) {
assert.equal( e.type, cur, "Verify right multi event was fired." );
} );
@@ -195,7 +195,7 @@ QUnit.test( "on(), namespace with special add", function( assert ) {
assert.expect( 27 );
var i = 0,
- div = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "test", function() {
+ div = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "test", function() {
assert.ok( true, "Test event fired." );
} );
@@ -244,7 +244,7 @@ QUnit.test( "on(), namespace with special add", function( assert ) {
// Should trigger 4
div.off( "test" );
- div = jQuery( "
" ).on( "test", function() {
+ div = jQuery( "
" ).on( "test", function() {
assert.ok( true, "Test event fired." );
} );
@@ -876,7 +876,7 @@ QUnit.test( "mouseover triggers mouseenter", function( assert ) {
assert.expect( 1 );
var count = 0,
- elem = jQuery( " " );
+ elem = jQuery( " " );
elem.on( "mouseenter", function() {
count++;
} );
@@ -890,7 +890,7 @@ QUnit.test( "pointerover triggers pointerenter", function( assert ) {
assert.expect( 1 );
var count = 0,
- elem = jQuery( " " );
+ elem = jQuery( " " );
elem.on( "pointerenter", function() {
count++;
} );
@@ -1075,7 +1075,7 @@ QUnit.test( "submit event bubbles on copied forms (#11649)", function( assert )
var $formByClone, $formByHTML,
$testForm = jQuery( "#testForm" ),
$fixture = jQuery( "#qunit-fixture" ),
- $wrapperDiv = jQuery( "
" ).appendTo( $fixture );
+ $wrapperDiv = jQuery( "
" ).appendTo( $fixture );
function noSubmit( e ) {
e.preventDefault();
@@ -1111,7 +1111,7 @@ QUnit.test( "change event bubbles on copied forms (#11796)", function( assert )
var $formByClone, $formByHTML,
$form = jQuery( "#form" ),
$fixture = jQuery( "#qunit-fixture" ),
- $wrapperDiv = jQuery( "
" ).appendTo( $fixture );
+ $wrapperDiv = jQuery( "
" ).appendTo( $fixture );
function delegatedChange() {
assert.ok( true, "Make sure change event bubbles up." );
@@ -1141,7 +1141,7 @@ QUnit.test( "trigger(eventObject, [data], [fn])", function( assert ) {
assert.expect( 28 );
var event,
- $parent = jQuery( "
" ).appendTo( "body" ),
+ $parent = jQuery( "
" ).appendTo( "body" ),
$child = jQuery( "foo
" ).appendTo( $parent );
$parent.get( 0 ).style.display = "none";
@@ -1799,7 +1799,7 @@ QUnit.test( "jQuery.off using dispatched jQuery.Event", function( assert ) {
QUnit.test( "events with type matching an Object.prototype property (gh-3256)", function( assert ) {
assert.expect( 1 );
- var elem = jQuery( "
" ),
+ var elem = jQuery( "
" ),
eventFired = false;
elem.appendTo( "#qunit-fixture" );
@@ -1819,7 +1819,7 @@ QUnit.test( "events with type matching an Object.prototype property, cloned elem
function( assert ) {
assert.expect( 1 );
- var elem = jQuery( "
" ),
+ var elem = jQuery( "
" ),
eventFired = false;
elem.appendTo( "#qunit-fixture" );
@@ -2783,7 +2783,7 @@ QUnit.test( ".off() removes the expando when there's no more data", function( as
assert.expect( 2 );
var key,
- div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ div = jQuery( "
" ).appendTo( "#qunit-fixture" );
div.on( "click", false );
div.on( "custom", function() {
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 3cf5cf77ef..3e50389d07 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -88,9 +88,9 @@ function testText( valueObj, assert ) {
assert.equal( $multipleElements.eq( 1 ).text(), expected, "text() updates multiple elements (#11809)" );
// Prevent memory leaks #11809
- $childDiv = jQuery( "
" );
+ $childDiv = jQuery( "
" );
$childDiv.data( "leak", true );
- $parentDiv = jQuery( "
" );
+ $parentDiv = jQuery( "
" );
$parentDiv.append( $childDiv );
$parentDiv.text( "Dry off" );
}
@@ -241,10 +241,10 @@ function testAppend( valueObj, assert ) {
assert.strictEqual( e.message || e, undefined, message );
}
- jQuery( " " ).appendTo( "#form" ).append( valueObj( "test " ) );
+ jQuery( " " ).appendTo( "#form" ).append( valueObj( "test " ) );
assert.t( "Append legend", "#legend", [ "legend" ] );
- $map = jQuery( " " ).append( valueObj( " " ) );
+ $map = jQuery( " " ).append( valueObj( " " ) );
assert.equal( $map[ 0 ].childNodes.length, 1, "The area was inserted." );
assert.equal( $map[ 0 ].firstChild.nodeName.toLowerCase(), "area", "The area was inserted." );
@@ -264,7 +264,7 @@ function testAppend( valueObj, assert ) {
assert.ok( jQuery.parseHTML( "<" + name + "/>" ).length, name + " wrapped correctly" );
} );
- jQuery( "#table colgroup" ).append( valueObj( " " ) );
+ jQuery( "#table colgroup" ).append( valueObj( " " ) );
assert.equal( jQuery( "#table colgroup col" ).length, 1, "Append col" );
jQuery( "#form" )
@@ -272,12 +272,12 @@ function testAppend( valueObj, assert ) {
.append( valueObj( "Test " ) );
assert.t( "Append Select", "#appendSelect1, #appendSelect2", [ "appendSelect1", "appendSelect2" ] );
- assert.equal( "Two nodes", jQuery( "
" ).append( "Two", " nodes" ).text(), "Appending two text nodes (#4011)" );
- assert.equal( jQuery( "
" ).append( "1", "", 3 ).text(), "13", "If median is false-like value, subsequent arguments should not be ignored" );
+ assert.equal( "Two nodes", jQuery( "
" ).append( "Two", " nodes" ).text(), "Appending two text nodes (#4011)" );
+ assert.equal( jQuery( "
" ).append( "1", "", 3 ).text(), "13", "If median is false-like value, subsequent arguments should not be ignored" );
// using contents will get comments regular, text, and comment nodes
j = jQuery( "#nonnodes" ).contents();
- d = jQuery( "
" ).appendTo( "#nonnodes" ).append( j );
+ d = jQuery( "
" ).appendTo( "#nonnodes" ).append( j );
assert.equal( jQuery( "#nonnodes" ).length, 1, "Check node,textnode,comment append moved leaving just the div" );
assert.equal( d.contents().length, 3, "Check node,textnode,comment append works" );
@@ -294,12 +294,12 @@ function testAppend( valueObj, assert ) {
$radioChecked.trigger( "click" );
$radioUnchecked[ 0 ].checked = false;
- jQuery( "
" ).insertBefore( $radioParent ).append( $radioParent );
+ jQuery( "
" ).insertBefore( $radioParent ).append( $radioParent );
assert.equal( $radioChecked[ 0 ].checked, true, "Reappending radios uphold which radio is checked" );
assert.equal( $radioUnchecked[ 0 ].checked, false, "Reappending radios uphold not being checked" );
- assert.equal( jQuery( "
" ).append( valueObj( "option " ) )[ 0 ].childNodes.length, 2, "HTML-string with leading text should be processed correctly" );
+ assert.equal( jQuery( "
" ).append( valueObj( "option " ) )[ 0 ].childNodes.length, 2, "HTML-string with leading text should be processed correctly" );
}
QUnit.test( "append(String|Element|Array|jQuery)", function( assert ) {
@@ -672,7 +672,7 @@ QUnit.test( "appendTo(jQuery)", function( assert ) {
jQuery( "#select1" ).appendTo( "#foo" );
assert.t( "Append select", "#foo select", [ "select1" ] );
- div = jQuery( "
" ).on( "click", function() {
+ div = jQuery( "
" ).on( "click", function() {
assert.ok( true, "Running a cloned click." );
} );
div.appendTo( "#qunit-fixture, #moretests" );
@@ -680,7 +680,7 @@ QUnit.test( "appendTo(jQuery)", function( assert ) {
jQuery( "#qunit-fixture div" ).last().trigger( "click" );
jQuery( "#moretests div" ).last().trigger( "click" );
- div = jQuery( "
" ).appendTo( "#qunit-fixture, #moretests" );
+ div = jQuery( "
" ).appendTo( "#qunit-fixture, #moretests" );
assert.equal( div.length, 2, "appendTo returns the inserted elements" );
@@ -689,7 +689,7 @@ QUnit.test( "appendTo(jQuery)", function( assert ) {
assert.ok( jQuery( "#qunit-fixture div" ).last().hasClass( "test" ), "appendTo element was modified after the insertion" );
assert.ok( jQuery( "#moretests div" ).last().hasClass( "test" ), "appendTo element was modified after the insertion" );
- div = jQuery( "
" );
+ div = jQuery( "
" );
jQuery( "a b " ).filter( "span" ).appendTo( div );
assert.equal( div.children().length, 1, "Make sure the right number of children were inserted." );
@@ -989,7 +989,7 @@ QUnit.test( "before(no-op)", function( assert ) {
assert.expect( 2 );
var set;
- set = jQuery( "
" ).before( "test " );
+ set = jQuery( "
" ).before( "test " );
assert.equal( set[ 0 ].nodeName.toLowerCase(), "div", "Insert before a disconnected node should be a no-op" );
assert.equal( set.length, 1, "Insert the element before the disconnected node. should be a no-op" );
} );
@@ -1008,8 +1008,8 @@ QUnit.test( ".before() and .after() disconnected node", function( assert ) {
assert.expect( 2 );
- assert.equal( jQuery( " " ).before( "
" ).length, 1, "before() on disconnected node is no-op" );
- assert.equal( jQuery( " " ).after( "
" ).length, 1, "after() on disconnected node is no-op" );
+ assert.equal( jQuery( " " ).before( "
" ).length, 1, "before() on disconnected node is no-op" );
+ assert.equal( jQuery( " " ).after( "
" ).length, 1, "after() on disconnected node is no-op" );
} );
QUnit.test( "insert with .before() on disconnected node last", function( assert ) {
@@ -1018,7 +1018,7 @@ QUnit.test( "insert with .before() on disconnected node last", function( assert
var expectedBefore = "This is a normal link: bugaYahoo";
- jQuery( "#yahoo" ).add( " " ).before( "buga " );
+ jQuery( "#yahoo" ).add( " " ).before( "buga " );
assert.equal( jQuery( "#en" ).text(), expectedBefore, "Insert String before with disconnected node last" );
} );
@@ -1028,7 +1028,7 @@ QUnit.test( "insert with .before() on disconnected node first", function( assert
var expectedBefore = "This is a normal link: bugaYahoo";
- jQuery( " " ).add( "#yahoo" ).before( "buga " );
+ jQuery( " " ).add( "#yahoo" ).before( "buga " );
assert.equal( jQuery( "#en" ).text(), expectedBefore, "Insert String before with disconnected node first" );
} );
@@ -1038,7 +1038,7 @@ QUnit.test( "insert with .before() on disconnected node last", function( assert
var expectedAfter = "This is a normal link: Yahoobuga";
- jQuery( "#yahoo" ).add( " " ).after( "buga " );
+ jQuery( "#yahoo" ).add( " " ).after( "buga " );
assert.equal( jQuery( "#en" ).text(), expectedAfter, "Insert String after with disconnected node last" );
} );
@@ -1048,7 +1048,7 @@ QUnit.test( "insert with .before() on disconnected node last", function( assert
var expectedAfter = "This is a normal link: Yahoobuga";
- jQuery( " " ).add( "#yahoo" ).after( "buga " );
+ jQuery( " " ).add( "#yahoo" ).after( "buga " );
assert.equal( jQuery( "#en" ).text(), expectedAfter, "Insert String after with disconnected node first" );
} );
@@ -1168,7 +1168,7 @@ QUnit.test( ".after(disconnected node)", function( assert ) {
assert.expect( 2 );
- var set = jQuery( "
" ).before( "test " );
+ var set = jQuery( "
" ).before( "test " );
assert.equal( set[ 0 ].nodeName.toLowerCase(), "div", "Insert after a disconnected node should be a no-op" );
assert.equal( set.length, 1, "Insert the element after the disconnected node should be a no-op" );
} );
@@ -1250,10 +1250,10 @@ function testReplaceWith( val, assert ) {
jQuery( "#anchor1" ).contents().replaceWith( val( tmp ) );
assert.deepEqual( jQuery( "#anchor1" ).contents().get(), [ tmp ], "Replace text node with element" );
- tmp = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
+ tmp = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
assert.ok( true, "Newly bound click run." );
} );
- y = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
+ y = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
assert.ok( false, "Previously bound click run." );
} );
child = y.append( "test " ).find( "b" ).on( "click", function() {
@@ -1267,7 +1267,7 @@ function testReplaceWith( val, assert ) {
y.trigger( "click" ); // Shouldn't be run
child.trigger( "click" ); // Shouldn't be run
- y = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
+ y = jQuery( "
" ).appendTo( "#qunit-fixture" ).on( "click", function() {
assert.ok( false, "Previously bound click run." );
} );
child2 = y.append( "test " ).find( "u" ).on( "click", function() {
@@ -1279,13 +1279,13 @@ function testReplaceWith( val, assert ) {
child2.trigger( "click" );
- set = jQuery( "
" ).replaceWith( val( "test " ) );
+ set = jQuery( "
" ).replaceWith( val( "test " ) );
assert.equal( set[ 0 ].nodeName.toLowerCase(), "div", "No effect on a disconnected node." );
assert.equal( set.length, 1, "No effect on a disconnected node." );
assert.equal( set[ 0 ].childNodes.length, 0, "No effect on a disconnected node." );
child = jQuery( "#qunit-fixture" ).children().first();
- $div = jQuery( "
" ).insertBefore( child );
+ $div = jQuery( "
" ).insertBefore( child );
$div.replaceWith( $div );
assert.deepEqual( jQuery( ".pathological", "#qunit-fixture" ).get(), $div.get(),
"Self-replacement" );
@@ -1342,7 +1342,7 @@ QUnit.test( "Empty replaceWith (trac-13401; trac-13596; gh-2204)", function( ass
assert.expect( 25 );
- var $el = jQuery( "
" ).html( "0
" ),
+ var $el = jQuery( "
" ).html( "0
" ),
expectedHTML = $el.html(),
tests = {
"empty string": "",
@@ -1355,13 +1355,13 @@ QUnit.test( "Empty replaceWith (trac-13401; trac-13596; gh-2204)", function( ass
};
jQuery.each( tests, function( label, input ) {
- $el.html( " " ).children().replaceWith( input );
+ $el.html( " " ).children().replaceWith( input );
assert.strictEqual( $el.html(), "", "replaceWith(" + label + ")" );
- $el.html( " " ).children().replaceWith( function() { return input; } );
+ $el.html( " " ).children().replaceWith( function() { return input; } );
assert.strictEqual( $el.html(), "", "replaceWith(function returning " + label + ")" );
- $el.html( " " ).children().replaceWith( function( i ) { return input; } );
+ $el.html( " " ).children().replaceWith( function( i ) { return input; } );
assert.strictEqual( $el.html(), "", "replaceWith(other function returning " + label + ")" );
- $el.html( "
" ).children().replaceWith( function( i ) {
+ $el.html( "
" ).children().replaceWith( function( i ) {
return i ?
input :
jQuery( this ).html( i + "" );
@@ -1482,7 +1482,7 @@ QUnit.test( "clone()", function( assert ) {
div.remove();
// Verify that cloned children can keep event listeners
- div = jQuery( "
" ).append( [ document.createElement( "table" ), document.createElement( "table" ) ] );
+ div = jQuery( "
" ).append( [ document.createElement( "table" ), document.createElement( "table" ) ] );
div.find( "table" ).on( "click", function() {
assert.ok( true, "Bound event still exists." );
} );
@@ -1509,7 +1509,7 @@ QUnit.test( "clone()", function( assert ) {
div.remove();
// Test both html() and clone() for and types
- div = jQuery( "
" ).html( " " );
+ div = jQuery( "
" ).html( " " );
clone = div.clone( true );
assert.equal( clone.length, 1, "One element cloned" );
@@ -1519,7 +1519,7 @@ QUnit.test( "clone()", function( assert ) {
// this is technically an invalid object, but because of the special
// classid instantiation it is the only kind that IE has trouble with,
// so let's test with it too.
- div = jQuery( "
" ).html( " " );
+ div = jQuery( "
" ).html( " " );
clone = div.clone( true );
assert.equal( clone.length, 1, "One element cloned" );
@@ -1546,14 +1546,14 @@ QUnit.test( "clone()", function( assert ) {
} )();
// and here's a valid one.
- div = jQuery( "
" ).html( " " );
+ div = jQuery( "
" ).html( " " );
clone = div.clone( true );
assert.equal( clone.length, 1, "One element cloned" );
assert.equal( clone.html(), div.html(), "Element contents cloned" );
assert.equal( clone[ 0 ].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
- div = jQuery( "
" ).data( { "a": true } );
+ div = jQuery( "
" ).data( { "a": true } );
clone = div.clone( true );
assert.equal( clone.data( "a" ), true, "Data cloned." );
clone.data( "a", false );
@@ -1688,12 +1688,12 @@ function testHtml( valueObj, assert ) {
div = jQuery( "
" ),
fixture = jQuery( "#qunit-fixture" );
- div.html( valueObj( "
" ) );
+ div.html( valueObj( "
" ) );
assert.equal( div.children().length, 2, "Found children" );
assert.equal( div.children().children().length, 1, "Found grandchild" );
actual = []; expected = [];
- tmp = jQuery( " " ).html( valueObj( " " ) ).each( function() {
+ tmp = jQuery( " " ).html( valueObj( " " ) ).each( function() {
expected.push( "AREA" );
actual.push( childNodeNames( this ) );
} );
@@ -1748,7 +1748,7 @@ function testHtml( valueObj, assert ) {
assert.equal( expected.length, 1, "Expecting one parent" );
assert.deepEqual( actual, expected, "Found the inserted style element" );
- fixture.html( valueObj( " " ) );
+ fixture.html( valueObj( " " ) );
jQuery( "#qunit-fixture select" ).html( valueObj( "O1 O2 O3 " ) );
assert.equal( jQuery( "#qunit-fixture select" ).val(), "O2", "Selected option correct" );
@@ -1903,7 +1903,7 @@ QUnit.test( "html(Function) with incoming value -- jQuery.contents()", function(
assert.equal( j.html().replace( / xmlns="[^"]+"/g, "" ).toLowerCase(), "bold ", "Check node,textnode,comment with html()" );
- $div = jQuery( "
" );
+ $div = jQuery( "
" );
assert.equal( $div.html( function( i, val ) {
assert.equal( val, "", "Make sure the incoming value is correct." );
@@ -1915,7 +1915,7 @@ QUnit.test( "html(Function) with incoming value -- jQuery.contents()", function(
return 0;
} ).html(), "0", "Setting a zero as html" );
- $div2 = jQuery( "
" );
+ $div2 = jQuery( "
" );
insert = "<div>hello1</div>";
assert.equal( $div2.html( function( i, val ) {
assert.equal( val, "", "Make sure the incoming value is correct." );
@@ -2211,7 +2211,7 @@ QUnit.test( "jQuery.cleanData", function( assert ) {
QUnit.test( "jQuery.cleanData eliminates all private data (gh-2127)", function( assert ) {
assert.expect( 3 );
- var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
+ var div = jQuery( "
" ).appendTo( "#qunit-fixture" );
jQuery._data( div[ 0 ], "gh-2127", "testing" );
@@ -2231,7 +2231,7 @@ QUnit.test( "jQuery.cleanData eliminates all public data", function( assert ) {
assert.expect( 3 );
var key,
- div = jQuery( "
" );
+ div = jQuery( "
" );
div.data( "some", "data" );
assert.ok( !jQuery.isEmptyObject( jQuery.data( div[ 0 ] ) ), "Ensure some public data exists" );
@@ -2253,7 +2253,7 @@ QUnit.test( "domManip plain-text caching (trac-6779)", function( assert ) {
// DOM manipulation fails if added text matches an Object method
var i,
- $f = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ $f = jQuery( "
" ).appendTo( "#qunit-fixture" ),
bad = [ "start-", "toString", "hasOwnProperty", "append", "here&there!", "-end" ];
for ( i = 0; i < bad.length; i++ ) {
@@ -2422,7 +2422,7 @@ QUnit.test( "Guard against exceptions when clearing safeChildNodes", function( a
var div;
try {
- div = jQuery( "
" );
+ div = jQuery( "
" );
} catch ( e ) {}
assert.ok( div && div.jquery, "Created nodes safely, guarded against exceptions on safeChildNodes[ -1 ]" );
@@ -2432,11 +2432,11 @@ QUnit.test( "Ensure oldIE creates a new set on appendTo (#8894)", function( asse
assert.expect( 5 );
- assert.strictEqual( jQuery( "
" ).clone().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.clone" );
- assert.strictEqual( jQuery( "
" ).find( "p" ).end().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.fn.find" );
- assert.strictEqual( jQuery( "
" ).text( "test" ).addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.fn.text" );
- assert.strictEqual( jQuery( " " ).clone().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after clone html5 element" );
- assert.strictEqual( jQuery( "
" ).appendTo( "
" ).end().length, jQuery( "test
" ).appendTo( "
" ).end().length, "Elements created with createElement and with createDocumentFragment should be treated alike" );
+ assert.strictEqual( jQuery( "
" ).clone().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.clone" );
+ assert.strictEqual( jQuery( "
" ).find( "p" ).end().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.fn.find" );
+ assert.strictEqual( jQuery( "
" ).text( "test" ).addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after jQuery.fn.text" );
+ assert.strictEqual( jQuery( " " ).clone().addClass( "test" ).appendTo( "
" ).end().end().hasClass( "test" ), false, "Check jQuery.fn.appendTo after clone html5 element" );
+ assert.strictEqual( jQuery( "
" ).appendTo( "
" ).end().length, jQuery( "test
" ).appendTo( "
" ).end().length, "Elements created with createElement and with createDocumentFragment should be treated alike" );
} );
QUnit.test( "html() - script exceptions bubble (#11743)", function( assert ) {
@@ -2526,7 +2526,7 @@ QUnit.test( "script evaluation (#11795)", function( assert ) {
"",
""
].join( "" ) );
- scriptsIn.appendTo( jQuery( "
" ) );
+ scriptsIn.appendTo( jQuery( "
" ) );
objGlobal.ok = isOk;
scriptsOut = fixture.append( scriptsIn ).find( "script" );
@@ -2543,7 +2543,7 @@ QUnit.test( "script evaluation (#11795)", function( assert ) {
if ( jQuery.ajax ) {
Globals.register( "testBar" );
- jQuery( "#qunit-fixture" ).append( "" );
+ jQuery( "#qunit-fixture" ).append( "" );
assert.strictEqual( window.testBar, "bar", "Global script evaluation" );
} else {
assert.ok( true, "No jQuery.ajax" );
@@ -2565,7 +2565,7 @@ QUnit[ jQuery.ajax ? "test" : "skip" ]( "jQuery._evalUrl (#12838)", function( as
assert.equal( ( input.url || input ).slice( -1 ), expectedArgument, message );
expectedArgument++;
};
- jQuery( "#qunit-fixture" ).append( "" );
+ jQuery( "#qunit-fixture" ).append( "" );
assert.equal( expectedArgument, 3, "synchronous execution" );
message = "custom implementation";
@@ -2574,7 +2574,7 @@ QUnit[ jQuery.ajax ? "test" : "skip" ]( "jQuery._evalUrl (#12838)", function( as
jQuery.ajax = function( options ) {
assert.strictEqual( options, {}, "Unexpected call to jQuery.ajax" );
};
- jQuery( "#qunit-fixture" ).append( "" );
+ jQuery( "#qunit-fixture" ).append( "" );
jQuery.ajax = ajax;
jQuery._evalUrl = evalUrl;
@@ -2588,7 +2588,7 @@ QUnit.test( "jQuery.htmlPrefilter (gh-1747)", function( assert ) {
invocations = 0,
done = assert.async(),
htmlPrefilter = jQuery.htmlPrefilter,
- fixture = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ fixture = jQuery( "
" ).appendTo( "#qunit-fixture" ),
poison = "";
jQuery.htmlPrefilter = function( html ) {
@@ -2604,7 +2604,7 @@ QUnit.test( "jQuery.htmlPrefilter (gh-1747)", function( assert ) {
expectedArgument = "A-" + poison + "B-" + poison + poison + "C-";
fixture.html( expectedArgument );
- expectedArgument = "D-" + poison + "E-" + "" + poison + poison + "
" + "F-";
+ expectedArgument = "D-" + poison + "E-" + "" + poison + poison + "
" + "F-";
fixture.append( expectedArgument );
expectedArgument = poison;
@@ -2659,7 +2659,7 @@ QUnit.test( "Index for function argument should be received (#13094)", function(
var i = 0;
- jQuery( "
" ).before( function( index ) {
+ jQuery( "
" ).before( function( index ) {
assert.equal( index, i++, "Index should be correct" );
} );
@@ -2685,7 +2685,7 @@ QUnit.test( "Make sure specific elements with content created correctly (#13232)
thead: "thead ",
tbody: "tbody ",
tfoot: "tfoot ",
- colgroup: " ",
+ colgroup: " ",
caption: "caption",
tr: "tr ",
th: "th",
@@ -2702,23 +2702,19 @@ QUnit.test( "Make sure specific elements with content created correctly (#13232)
args.push( html );
} );
- jQuery.fn.append.apply( jQuery( "
" ), args ).children().each( function( i ) {
+ jQuery.fn.append.apply( jQuery( "
" ), args ).children().each( function( i ) {
assert.ok( this.nodeName.toLowerCase() === results[ i ] );
} );
} );
QUnit.test( "Validate creation of multiple quantities of certain elements (#13818)", function( assert ) {
- assert.expect( 44 );
+ assert.expect( 22 );
var tags = [ "thead", "tbody", "tfoot", "colgroup", "col", "caption", "tr", "th", "td", "optgroup", "option" ];
jQuery.each( tags, function( index, tag ) {
- jQuery( "<" + tag + "/><" + tag + "/>" ).each( function() {
- assert.ok( this.nodeName.toLowerCase() === tag, tag + " empty elements created correctly" );
- } );
-
- jQuery( "<" + this + ">" + tag + "><" + tag + ">" + tag + ">" ).each( function() {
- assert.ok( this.nodeName.toLowerCase() === tag, tag + " elements with closing tag created correctly" );
+ jQuery( "<" + tag + ">" + tag + "><" + tag + ">" + tag + ">" ).each( function() {
+ assert.ok( this.nodeName.toLowerCase() === tag, tag + " elements created correctly" );
} );
} );
} );
@@ -2766,7 +2762,7 @@ QUnit.test( "Make sure tfoot element will not be appended to tbody element of ta
table.appendChild( document.createElement( "tbody" ) );
document.getElementById( "qunit-fixture" ).appendChild( table );
- jQuery( table ).append( " " );
+ jQuery( table ).append( " " );
// Lowercase and replace spaces to remove possible browser inconsistencies
html = table.innerHTML.toLowerCase().replace( /\s/g, "" );
@@ -2805,7 +2801,7 @@ QUnit.test( "Make sure col element is appended correctly", function( assert ) {
jQuery( table ).appendTo( "#qunit-fixture" );
- jQuery( " " ).prependTo( table );
+ jQuery( " " ).prependTo( table );
assert.strictEqual( table.find( "td" ).width(), 150 );
} );
@@ -2820,7 +2816,7 @@ QUnit.test( "Make sure tr is not appended to the wrong tbody (gh-3439)", functio
"",
newRow = "added ",
htmlExpected = htmlIn.replace( "", "" + newRow ),
- table = supportjQuery( "" ).html( htmlIn ).appendTo( "#qunit-fixture" )[ 0 ];
+ table = supportjQuery( "" ).html( htmlIn ).appendTo( "#qunit-fixture" )[ 0 ];
jQuery( table ).append( newRow );
@@ -2835,7 +2831,7 @@ QUnit.test( "Make sure tags with single-character names are found (gh-4124)", fu
var htmlOut,
htmlIn = "foo
",
- $el = jQuery( "
" );
+ $el = jQuery( "
" );
$el.html( htmlIn );
@@ -2883,7 +2879,7 @@ QUnit.test( "Ignore content from unsuccessful responses (gh-4126)", function( as
try {
jQuery( "#qunit-fixture" ).append(
- "" );
+ "" );
assert.ok( true, "no error thrown from embedding script with unsuccessful-response src" );
} catch ( e ) {
throw e;
diff --git a/test/unit/offset.js b/test/unit/offset.js
index 83edd9fbc3..5607ddaf96 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -5,7 +5,7 @@ if ( !jQuery.fn.offset ) {
}
var supportsFixedPosition, supportsScroll, alwaysScrollable,
- forceScroll = supportjQuery( "
" ).css( { width: 2000, height: 2000 } ),
+ forceScroll = supportjQuery( "
" ).css( { width: 2000, height: 2000 } ),
checkSupport = function( assert ) {
// Only run once
@@ -81,7 +81,7 @@ QUnit.test( "disconnected element", function( assert ) {
QUnit.test( "hidden (display: none) element", function( assert ) {
assert.expect( 4 );
- var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
result = node.offset();
node.remove();
@@ -98,7 +98,7 @@ QUnit.test( "hidden (display: none) element", function( assert ) {
QUnit.test( "0 sized element", function( assert ) {
assert.expect( 4 );
- var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
result = node.offset();
node.remove();
@@ -112,7 +112,7 @@ QUnit.test( "0 sized element", function( assert ) {
QUnit.test( "hidden (visibility: hidden) element", function( assert ) {
assert.expect( 4 );
- var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
+ var node = jQuery( "
" ).appendTo( "#qunit-fixture" ),
result = node.offset();
node.remove();
@@ -785,7 +785,7 @@ QUnit.test( "offsetParent", function( assert ) {
QUnit.test( "fractions (see #7730 and #7885)", function( assert ) {
assert.expect( 2 );
- jQuery( "body" ).append( "
" );
+ jQuery( "body" ).append( "
" );
var result,
expected = { "top": 1000, "left": 1000 },
diff --git a/test/unit/selector.js b/test/unit/selector.js
index f9c6ffc7a2..bf688709f8 100644
--- a/test/unit/selector.js
+++ b/test/unit/selector.js
@@ -92,7 +92,7 @@ QUnit.test( "name", function( assert ) {
QUnit.test( "selectors with comma", function( assert ) {
assert.expect( 4 );
- var fixture = jQuery( "" );
+ var fixture = jQuery( "" );
assert.equal( fixture.find( "h2, div p" ).filter( "p" ).length, 2, "has to find two " );
assert.equal( fixture.find( "h2, div p" ).filter( "h2" ).length, 1, "has to find one
" );
@@ -275,7 +275,7 @@ QUnit.test( "attributes", function( assert ) {
QUnit.test( "disconnected nodes", function( assert ) {
assert.expect( 1 );
- var $div = jQuery( "
" );
+ var $div = jQuery( "
" );
assert.equal( $div.is( "div" ), true, "Make sure .is('nodeName') works on disconnected nodes." );
} );
diff --git a/test/unit/traversing.js b/test/unit/traversing.js
index e8d23536ef..013fd77949 100644
--- a/test/unit/traversing.js
+++ b/test/unit/traversing.js
@@ -197,7 +197,7 @@ QUnit.test( "index()", function( assert ) {
assert.equal( jQuery( "#text2" ).index(), 2, "Returns the index of a child amongst its siblings" );
- assert.equal( jQuery( "
" ).index(), -1, "Node without parent returns -1" );
+ assert.equal( jQuery( "
" ).index(), -1, "Node without parent returns -1" );
} );
QUnit.test( "index(Object|String|undefined)", function( assert ) {
@@ -502,7 +502,7 @@ QUnit.test( "has(Element)", function( assert ) {
obj = jQuery( "#qunit-fixture" ).has( jQuery( "#sndp" )[ 0 ] );
assert.deepEqual( obj.get(), q( "qunit-fixture" ), "Keeps elements that have the element as a descendant" );
- detached = jQuery( " " );
+ detached = jQuery( " " );
assert.deepEqual( detached.has( detached.find( "i" )[ 0 ] ).get(), detached.get(), "...Even when detached" );
multipleParent = jQuery( "#qunit-fixture, #header" ).has( jQuery( "#sndp" )[ 0 ] );
@@ -517,7 +517,7 @@ QUnit.test( "has(Selector)", function( assert ) {
obj = jQuery( "#qunit-fixture" ).has( "#sndp" );
assert.deepEqual( obj.get(), q( "qunit-fixture" ), "Keeps elements that have any element matching the selector as a descendant" );
- detached = jQuery( " " );
+ detached = jQuery( " " );
assert.deepEqual( detached.has( "i" ).get(), detached.get(), "...Even when detached" );
multipleParent = jQuery( "#qunit-fixture, #header" ).has( "#sndp" );
@@ -538,7 +538,7 @@ QUnit.test( "has(Arrayish)", function( assert ) {
simple = jQuery( "#qunit-fixture" ).has( jQuery( "#sndp" ) );
assert.deepEqual( simple.get(), q( "qunit-fixture" ), "Keeps elements that have any element in the jQuery list as a descendant" );
- detached = jQuery( " " );
+ detached = jQuery( " " );
assert.deepEqual( detached.has( detached.find( "i" ) ).get(), detached.get(), "...Even when detached" );
multipleParent = jQuery( "#qunit-fixture, #header" ).has( jQuery( "#sndp" ) );
@@ -566,7 +566,7 @@ QUnit.test( "siblings([String])", function( assert ) {
var set = q( "sndp", "en", "sap" );
assert.deepEqual( jQuery( "#en, #sndp" ).siblings().get(), set, "Check for unique results from siblings" );
assert.deepEqual( jQuery( "#option5a" ).siblings( "option[data-attr]" ).get(), q( "option5c" ), "Has attribute selector in siblings (#9261)" );
- assert.equal( jQuery( " " ).siblings().length, 0, "Detached elements have no siblings (#11370)" );
+ assert.equal( jQuery( " " ).siblings().length, 0, "Detached elements have no siblings (#11370)" );
} );
QUnit[ jQuery.find.compile ? "test" : "skip" ]( "siblings([String])", function( assert ) {
@@ -733,7 +733,7 @@ QUnit.test( "contents()", function( assert ) {
assert.equal( jQuery( "div", ibody ).text(), "span text", "Make sure the correct div is still left after deletion in IFrame" );
- jQuery( "", ibody ).append( "cell " ).appendTo( ibody );
+ jQuery( "", ibody ).append( "cell " ).appendTo( ibody );
jQuery( "table", ibody ).remove();
assert.equal( jQuery( "div", ibody ).length, 1, "Check for JS error on add and delete of a table in IFrame" );
@@ -761,7 +761,7 @@ QUnit.test( "contents() for ", function( assert ) {
assert.equal( contents.find( "span" ).text(), "Hello, Web Component!", "Find span in template and check its text" );
- jQuery( "
" ).append(
+ jQuery( "
" ).append(
jQuery( jQuery.map( contents, function( node ) {
return document.importNode( node, true );
} ) )
@@ -875,7 +875,7 @@ QUnit.test( "add(String selector)", function( assert ) {
"Check elements from document"
);
- divs = jQuery( "
" ).add( "#sndp" );
+ divs = jQuery( "
" ).add( "#sndp" );
assert.ok( divs[ 0 ].parentNode, "Sort with the disconnected node last (started with disconnected first)." );
} );
@@ -893,7 +893,7 @@ QUnit.test( "add(String html)", function( assert ) {
assert.expect( 3 );
var x,
- divs = jQuery( "#sndp" ).add( "
" );
+ divs = jQuery( "#sndp" ).add( "
" );
assert.ok( !divs[ 1 ].parentNode, "Sort with the disconnected node last." );
@@ -906,7 +906,7 @@ QUnit.test( "add(jQuery)", function( assert ) {
assert.expect( 4 );
var x,
- tmp = jQuery( "
" );
+ tmp = jQuery( "
" );
x = jQuery( [] )
.add(
@@ -935,7 +935,7 @@ QUnit.test( "add(Element)", function( assert ) {
assert.expect( 2 );
var x,
- tmp = jQuery( "
" );
+ tmp = jQuery( "
" );
x = jQuery( [] ).add( jQuery( "xxx
" ).appendTo( tmp )[ 0 ] ).add( jQuery( "xxx
" ).appendTo( tmp )[ 0 ] );
assert.equal( x[ 0 ].id, "x1", "Check on-the-fly element1" );
diff --git a/test/unit/wrap.js b/test/unit/wrap.js
index 40c35d6928..21335c36f6 100644
--- a/test/unit/wrap.js
+++ b/test/unit/wrap.js
@@ -74,7 +74,7 @@ function testWrap( val, assert ) {
cacheLength++;
}
- j = jQuery( " " ).wrap( val( " " ) );
+ j = jQuery( " " ).wrap( val( " " ) );
assert.equal(
j[ 0 ] .nodeName.toUpperCase(), "LABEL", "Element is a label"
);
@@ -90,7 +90,7 @@ function testWrap( val, assert ) {
);
// Wrap an element containing a text node
- j = jQuery( " " ).wrap( "test
" );
+ j = jQuery( " " ).wrap( "test
" );
assert.equal(
j[ 0 ].previousSibling.nodeType, 3, "Make sure the previous node is a text element"
);
@@ -112,7 +112,7 @@ function testWrap( val, assert ) {
);
// Wrap an element with a jQuery set
- j = jQuery( " " ).wrap( jQuery( "
" ) );
+ j = jQuery( " " ).wrap( jQuery( "
" ) );
assert.equal(
j[ 0 ].parentNode.nodeName.toLowerCase(), "div", "Wrapping works."
);
@@ -128,7 +128,7 @@ function testWrap( val, assert ) {
jQuery( this ).off();
} );
- j = jQuery( " " ).wrap( result );
+ j = jQuery( " " ).wrap( result );
assert.equal(
j[ 0 ].parentNode.nodeName.toLowerCase(), "div", "Wrapping works."
);
@@ -313,7 +313,7 @@ QUnit.test( "wrapInner(Element)", function( assert ) {
assert.expect( 5 );
var num,
- div = jQuery( "
" );
+ div = jQuery( "
" );
num = jQuery( "#first" ).children().length;
jQuery( "#first" ).wrapInner( document.getElementById( "empty" ) );
@@ -375,7 +375,7 @@ QUnit.test( "wrapInner(Function) returns Element", function( assert ) {
var num,
val = manipulationFunctionReturningObj,
- div = jQuery( "
" );
+ div = jQuery( "
" );
num = jQuery( "#first" ).children().length;
jQuery( "#first" ).wrapInner( val( document.getElementById( "empty" ) ) );