From 9b00827ac90e0411ff2d106cb799465af18f703f Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 22 Apr 2011 00:51:23 -0400 Subject: Disabling .add(form.elements) unit test. --- test/unit/traversing.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/unit/traversing.js') diff --git a/test/unit/traversing.js b/test/unit/traversing.js index b5130dbf7..5216ae752 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -480,10 +480,15 @@ test("contents()", function() { }); test("add(String|Element|Array|undefined)", function() { - expect(17); + expect(16); same( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); same( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); - ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" ); + + // We no longer support .add(form.elements), unfortunately. + // There is no way, in browsers, to reliably determine the difference + // between form.elements and form - and doing .add(form) and having it + // add the form elements is way to unexpected, so this gets the boot. + // ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" ); // For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE // use jQuery([]).add(form.elements) instead. -- cgit v1.2.3