]> source.dussan.org Git - jquery.git/commitdiff
Remove leading white space check
authorOleg <markelog@gmail.com>
Wed, 19 Dec 2012 16:27:42 +0000 (20:27 +0400)
committerOleg <markelog@gmail.com>
Sun, 23 Dec 2012 23:03:19 +0000 (03:03 +0400)
src/manipulation.js
src/support.js

index 32b5b5f8161d16fba1f90229d8b66c22691297e8..e933ba08ffc8b43770c171bceb94bb2dd626b0bb 100644 (file)
@@ -1,5 +1,4 @@
-var rleadingWhitespace = /^\s+/,
-       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
        rtagName = /<([\w:]+)/,
        rtbody = /<tbody/i,
        rhtml = /<|&#?\w+;/,
@@ -195,7 +194,6 @@ jQuery.fn.extend({
 
                        // See if we can take a shortcut and just use innerHTML
                        if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-                               ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
 
                                value = value.replace( rxhtmlTag, "<$1></$2>" );
@@ -617,11 +615,6 @@ jQuery.extend({
                                                tmp = tmp.lastChild;
                                        }
 
-                                       // Manually add leading whitespace removed by IE
-                                       if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-                                               ret.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
-                                       }
-
                                        // Remove IE's autoinserted <tbody> from table fragments
                                        if ( !jQuery.support.tbody ) {
 
index 25ce0298ece48a7c91ca1c2d63573790cc031d2e..953564013160ca50c2dd81744ee9b6c66ef2afb3 100644 (file)
@@ -5,7 +5,7 @@ jQuery.support = (function() {
 
        // Setup
        div.setAttribute( "className", "t" );
-       div.innerHTML = "  <table></table><a href='/a'>a</a><input type='checkbox'/>";
+       div.innerHTML = "<table></table><a href='/a'>a</a><input type='checkbox'/>";
 
        // Support tests won't run in some limited or non-browser environments
        all = div.getElementsByTagName("*");
@@ -24,9 +24,6 @@ jQuery.support = (function() {
                // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
                getSetAttribute: div.className !== "t",
 
-               // IE strips leading whitespace when .innerHTML is used
-               leadingWhitespace: div.firstChild.nodeType === 3,
-
                // Make sure that tbody elements aren't automatically inserted
                // IE will insert them into empty tables
                tbody: !div.getElementsByTagName("tbody").length,