]> source.dussan.org Git - jquery.git/commitdiff
Landing pull request 365. jQuery.buildFragment, ensure doc is a document; Fixes ...
authorRick Waldron <waldron.rick@gmail.com>
Fri, 13 May 2011 16:26:17 +0000 (12:26 -0400)
committertimmywil <tim.willison@thisismedium.com>
Fri, 13 May 2011 16:26:17 +0000 (12:26 -0400)
More Details:
 - https://github.com/jquery/jquery/pull/365
 - http://bugs.jquery.com/ticket/8950

1  2 
src/manipulation.js
test/unit/manipulation.js

Simple merge
index 2f125b17ee35198da9f19762189b2f27c4d8af37,a2b5c2e59dd78e8bdfee9055ad5ea902914acce6..ad3d048487663a76697d68db351de8a4c8ce9b11
@@@ -1397,27 -1386,11 +1397,37 @@@ test("jQuery.buildFragment - no plain-t
        $f.remove();
  });
  
 +test( "jQuery.html - execute scripts escaped with html comment or CDATA (#9221)", function() {
 +      expect( 3 );
 +      jQuery( [
 +               '<script type="text/javascript">',
 +               '<!--',
 +               'ok( true, "<!-- handled" );',
 +               '//-->',
 +               '</script>'
 +           ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
 +      jQuery( [
 +               '<script type="text/javascript">',
 +               '<![CDATA[',
 +               'ok( true, "<![CDATA[ handled" );',
 +               '//]]>',
 +               '</script>'
 +           ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
 +      jQuery( [
 +               '<script type="text/javascript">',
 +               '<!--//--><![CDATA[//><!--',
 +               'ok( true, "<!--//--><![CDATA[//><!-- (Drupal case) handled" );',
 +               '//--><!]]>',
 +               '</script>'
 +           ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
 +});
++
+ test("jQuery.buildFragment - plain objects are not a document #8950", function() {
+       expect(1);
+       try {
+               jQuery('<input type="hidden">', {});
+               ok( true, "Does not allow attribute object to be treated like a doc object");
+       } catch (e) {}
++
+ });