]> source.dussan.org Git - jquery.git/commitdiff
Merge branch 'master' of https://github.com/rjgotten/jquery into rjgotten-master...
authorJohn Resig <jeresig@gmail.com>
Tue, 12 Apr 2011 20:39:30 +0000 (16:39 -0400)
committerJohn Resig <jeresig@gmail.com>
Tue, 12 Apr 2011 20:39:30 +0000 (16:39 -0400)
Conflicts:
src/manipulation.js

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

index 758cdbae0e10eedd783e246c1b5719e760d8e04e,2cd95ce95f970e51ea6f376b62ad8a3cc34a54a6..52d59d83ed2a52f366c66ebe9a15f704b48723e5
@@@ -7,8 -7,8 +7,9 @@@ var rinlinejQuery = / jQuery\d+="(?:\d+
        rtbody = /<tbody/i,
        rhtml = /<|&#?\w+;/,
        rnocache = /<(?:script|object|embed|option|style)/i,
 -      rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
 -      raction = /\=([^="'>\s]+\/)>/g,
 +      // checked="checked" or checked
 +      rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
++      rscriptType = /\/(java|ecma)script/i,
        wrapMap = {
                option: [ 1, "<select multiple='multiple'>", "</select>" ],
                legend: [ 1, "<fieldset>", "</fieldset>" ],
@@@ -635,7 -531,9 +636,11 @@@ jQuery.extend(
  
                                } else {
                                        if ( ret[i].nodeType === 1 ) {
-                                               ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
 -                                              var jsTags = jQuery.makeArray( ret[i].getElementsByTagName( "script" )),
 -                                              jsTags = jQuery.grep(jsTags, function(n, i) { return ( !n.type || n.type.toLowerCase() === "text/javascript" ) });
 -                                              ret.splice.apply( ret, [i + 1, 0].concat( jsTags ));
++                                              var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), function( elem ) {
++                                                      return !elem.type || rscriptType.test( elem.type );
++                                              });
++
++                                              ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
                                        }
                                        fragment.appendChild( ret[i] );
                                }
index 64265c9b554cba3aa49fea8e3fcb93fd3a6ad56e,d4c43487192395dbfaadfeb183d4dada4fd8a17b..de65daa132e2234b583ebd3bac53eb5255537d35
@@@ -1058,7 -892,7 +1058,7 @@@ test("clone() on XML nodes", function(
  }
  
  var testHtml = function(valueObj) {
--      expect(31);
++      expect(34);
  
        jQuery.scriptorder = 0;
  
  
        QUnit.reset();
  
 -      jQuery("#main").html(valueObj('<script type="something/else">ok( false, "Non-script evaluated." );</script><script type="text/javascript">ok( true, "text/javascript is evaluated." );</script><script>ok( true, "No type is evaluated." );</script><div><script type="text/javascript">ok( true, "Inner text/javascript is evaluated." );</script><script>ok( true, "Inner No type is evaluated." );</script><script type="something/else">ok( false, "Non-script evaluated." );</script></div>'));
 +      jQuery("#main").html(valueObj("<script type='something/else'>ok( false, 'Non-script evaluated.' );</script><script type='text/javascript'>ok( true, 'text/javascript is evaluated.' );</script><script>ok( true, 'No type is evaluated.' );</script><div><script type='text/javascript'>ok( true, 'Inner text/javascript is evaluated.' );</script><script>ok( true, 'Inner No type is evaluated.' );</script><script type='something/else'>ok( false, 'Non-script evaluated.' );</script></div>"));
 +
++      var child = jQuery("#main").find("script");
++
++      equals( child.length, 2, "Make sure that two non-JavaScript script tags are left." );
++      equals( child[0].type, "something/else", "Verify type of script tag." );
++      equals( child[1].type, "something/else", "Verify type of script tag." );
        jQuery("#main").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
        jQuery("#main").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
        jQuery("#main").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
@@@ -1133,7 -967,7 +1139,7 @@@ test("html(String)", function() 
  test("html(Function)", function() {
        testHtml(functionReturningObj);
  
--      expect(33);
++      expect(36);
  
        QUnit.reset();