Commit 90fed4b
101+ jQuery( "<a id='tAnchor6' href='#5'></a>" ).appendTo( "#qunit-fixture" );102102 assert.equal( jQuery( "#tAnchor5" ).prop( "href" ), jQuery( "#tAnchor6" ).prop( "href" ), "Check for absolute href prop on an anchor" );103103
104104 jQuery( "<script type='jquery/test' src='#5' id='scriptSrc'></script>" ).appendTo( "#qunit-fixture" );@@ -136,7 +136,7 @@ QUnit.test( "attr(String)", function( assert ) {136136 assert.equal( $img.attr( "height" ), "53", "Retrieve height attribute on an element with display:none." );137137
138138 // Check for style support139- styleElem = jQuery( "<div/>" ).appendTo( "#qunit-fixture" ).css( {139+ styleElem = jQuery( "<div></div>" ).appendTo( "#qunit-fixture" ).css( {140140 background: "url(UPPERlower.gif)"141141 } );142142 assert.ok( !!~styleElem.attr( "style" ).indexOf( "UPPERlower.gif" ), "Check style attribute getter" );@@ -158,11 +158,11 @@ QUnit.test( "attr(String)", function( assert ) {158158 $a = jQuery( "<a href='#' onclick='something()'>Click</a>" ).appendTo( "#qunit-fixture" );159159 assert.equal( $a.attr( "onclick" ), "something()", "Retrieve ^on attribute without anonymous function wrapper." );160160
161- assert.ok( jQuery( "<div/>" ).attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no attribute is found." );162- assert.ok( jQuery( "<div/>" ).attr( "title" ) === undefined, "Make sure undefined is returned when no attribute is found." );163- assert.equal( jQuery( "<div/>" ).attr( "title", "something" ).attr( "title" ), "something", "Set the title attribute." );161+ assert.ok( jQuery( "<div></div>" ).attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no attribute is found." );162+ assert.ok( jQuery( "<div></div>" ).attr( "title" ) === undefined, "Make sure undefined is returned when no attribute is found." );163+ assert.equal( jQuery( "<div></div>" ).attr( "title", "something" ).attr( "title" ), "something", "Set the title attribute." );164164 assert.ok( jQuery().attr( "doesntexist" ) === undefined, "Make sure undefined is returned when no element is there." );165- assert.equal( jQuery( "<div/>" ).attr( "value" ), undefined, "An unset value on a div returns undefined." );165+ assert.equal( jQuery( "<div></div>" ).attr( "value" ), undefined, "An unset value on a div returns undefined." );166166 assert.strictEqual( jQuery( "<select><option value='property'></option></select>" ).attr( "value" ), undefined, "An unset value on a select returns undefined." );167167
168168 $form = jQuery( "#form" ).attr( "enctype", "multipart/form-data" );@@ -180,7 +180,7 @@ QUnit.test( "attr(String) on cloned elements, #9646", function( assert ) {180180
181181 assert.strictEqual( input.clone( true ).attr( "name", "test" )[ 0 ].name, "test", "Name attribute should be changed on cloned element" );182182
183- div = jQuery( "<div id='tester' />" );183+ div = jQuery( "<div id='tester'></div>" );184184 div.attr( "id" );185185
186186 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 ) {299299 $input = jQuery( "<input type='checkbox'/>" ).attr( "checked", true );300300 assert.equal( $input.prop( "checked" ), true, "Setting checked updates property (verified by .prop)" );301301 assert.equal( $input[ 0 ].checked, true, "Setting checked updates property (verified by native property)" );302- $input = jQuery( "<option/>" ).attr( "selected", true );302+ $input = jQuery( "<option></option>" ).attr( "selected", true );303303 assert.equal( $input.prop( "selected" ), true, "Setting selected updates property (verified by .prop)" );304304 assert.equal( $input[ 0 ].selected, true, "Setting selected updates property (verified by native property)" );305305
@@ -569,7 +569,7 @@ QUnit.test( "removeAttr(String)", function( assert ) {569569 assert.expect( 12 );570570 var $first;571571
572- assert.equal( jQuery( "<div class='hello' />" ).removeAttr( "class" ).attr( "class" ), undefined, "remove class" );572+ assert.equal( jQuery( "<div class='hello'></div>" ).removeAttr( "class" ).attr( "class" ), undefined, "remove class" );573573 assert.equal( jQuery( "#form" ).removeAttr( "id" ).attr( "id" ), undefined, "Remove id" );574574 assert.equal( jQuery( "#foo" ).attr( "style", "position:absolute;" ).removeAttr( "style" ).attr( "style" ), undefined, "Check removing style attribute" );575575 assert.equal( jQuery( "#form" ).attr( "style", "position:absolute;" ).removeAttr( "style" ).attr( "style" ), undefined, "Check removing style attribute on a form" );@@ -669,7 +669,7 @@ QUnit.test( "prop(String, Object)", function( assert ) {669669 assert.equal( jQuery( "#select2" ).prop( "selectedIndex" ), 3, "Check for selectedIndex attribute" );670670 assert.equal( jQuery( "#foo" ).prop( "nodeName" ).toUpperCase(), "DIV", "Check for nodeName attribute" );671671 assert.equal( jQuery( "#foo" ).prop( "tagName" ).toUpperCase(), "DIV", "Check for tagName attribute" );672- assert.equal( jQuery( "<option/>" ).prop( "selected" ), false, "Check selected attribute on disconnected element." );672+ assert.equal( jQuery( "<option></option>" ).prop( "selected" ), false, "Check selected attribute on disconnected element." );673673
674674 assert.equal( jQuery( "#listWithTabIndex" ).prop( "tabindex" ), 5, "Check retrieving tabindex" );675675 jQuery( "#text1" ).prop( "readonly", true );@@ -814,16 +814,16 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732814814
815815 function addOptions( $elem ) {816816 return $elem.append(817- jQuery( "<option/>" ).val( "a" ).text( "One" ),818- jQuery( "<option/>" ).val( "b" ).text( "Two" ),819- jQuery( "<option/>" ).val( "c" ).text( "Three" )817+ jQuery( "<option></option>" ).val( "a" ).text( "One" ),818+ jQuery( "<option></option>" ).val( "b" ).text( "Two" ),819+ jQuery( "<option></option>" ).val( "c" ).text( "Three" )820820 )821821 .find( "[value=a]" ).prop( "selected", true ).end()822822 .find( "[value=c]" ).prop( "selected", true ).end();823823 }824824
825825 var $optgroup,826- $select = jQuery( "<select/>" );826+ $select = jQuery( "<select></select>" );827827
828828 // Check select with options829829 addOptions( $select ).appendTo( "#qunit-fixture" );@@ -833,7 +833,7 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732833833 $select.empty();834834
835835 // Check select with optgroup836- $optgroup = jQuery( "<optgroup/>" );836+ $optgroup = jQuery( "<optgroup></optgroup>" );837837 addOptions( $optgroup ).appendTo( $select );838838 $select.find( "[value=b]" ).prop( "selected", true );839839
@@ -947,7 +947,7 @@ QUnit.test( "val()", function( assert ) {947947 assert.equal( $button.val(), "foobar", "Value retrieval on a button does not return innerHTML" );948948 assert.equal( $button.val( "baz" ).html(), "text", "Setting the value does not change innerHTML" );949949
950- assert.equal( jQuery( "<option/>" ).val( "test" ).attr( "value" ), "test", "Setting value sets the value attribute" );950+ assert.equal( jQuery( "<option></option>" ).val( "test" ).attr( "value" ), "test", "Setting value sets the value attribute" );951951} );952952
953953QUnit.test( "val() with non-matching values on dropdown list", function( assert ) {@@ -1014,7 +1014,7 @@ var testVal = function( valueObj, assert ) {10141014 assert.equal( document.getElementById( "text1" ).value, "", "Check for modified (via val(null)) value of input element" );10151015
10161016 var j,1017- $select = jQuery( "<select multiple><option value='1'/><option value='2'/></select>" ),1017+ $select = jQuery( "<select multiple><option value='1'></option><option value='2'></option></select>" ),10181018 $select1 = jQuery( "#select1" );10191019
10201020 $select1.val( valueObj( "3" ) );@@ -1130,7 +1130,7 @@ QUnit.test( "val(select) after form.reset() (Bug #2551)", function( assert ) {11301130QUnit.test( "select.val(space characters) (gh-2978)", function( assert ) {11311131 assert.expect( 37 );11321132
1133- var $select = jQuery( "<select/>" ).appendTo( "#qunit-fixture" ),1133+ var $select = jQuery( "<select></select>" ).appendTo( "#qunit-fixture" ),11341134 spaces = {11351135 "\\t": {11361136 html: "	",@@ -1266,7 +1266,7 @@ var testAddClass = function( valueObj, assert ) {12661266 j.addClass( valueObj( "asdf" ) );12671267 assert.ok( j.hasClass( "asdf" ), "Check node,textnode,comment for addClass" );12681268
1269- div = jQuery( "<div/>" );1269+ div = jQuery( "<div></div>" );12701270
12711271 div.addClass( valueObj( "test" ) );12721272 assert.equal( div.attr( "class" ), "test", "Make sure there's no extra whitespace." );@@ -1697,17 +1697,17 @@ QUnit.test( "coords returns correct values in IE6/IE7, see #10828", function( as16971697 assert.expect( 1 );16981698
16991699 var area,1700- map = jQuery( "<map />" );1700+ map = jQuery( "<map></map>" );17011701
1702- area = map.html( "<area shape='rect' coords='0,0,0,0' href='#' alt='a' />" ).find( "area" );1702+ area = map.html( "<area shape='rect' coords='0,0,0,0' href='#' alt='a'></area>" ).find( "area" );17031703 assert.equal( area.attr( "coords" ), "0,0,0,0", "did not retrieve coords correctly" );17041704} );17051705
17061706QUnit.test( "should not throw at $(option).val() (#14686)", function( assert ) {17071707 assert.expect( 1 );17081708
17091709 try {1710- jQuery( "<option/>" ).val();1710+ jQuery( "<option></option>" ).val();17111711 assert.ok( true );17121712 } catch ( _ ) {17131713 assert.ok( false );| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
| 189 | + | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
| 204 | + | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
| 461 | + | |
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
530 | | - | |
| 529 | + | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
1355 | 1355 | | |
1356 | 1356 | | |
1357 | 1357 | | |
1358 | | - | |
| 1358 | + | |
1359 | 1359 | | |
1360 | 1360 | | |
1361 | 1361 | | |
| |||
0 commit comments