rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- area: [ 1, "<map>", "</map>" ],
- param: [ 1, "<object>", "</object>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ option: [ 1, "<select multiple='multiple'>" ],
+ legend: [ 1, "<fieldset>" ],
+ area: [ 1, "<map>" ],
+ param: [ 1, "<object>" ],
+ thead: [ 1, "<table>" ],
+ tr: [ 2, "<table><tbody>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</table>" ],
+ td: [ 3, "<table><tbody><tr>" ],
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
- _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "" ]
+ _default: jQuery.support.htmlSerialize ? [ 0, "" ] : [ 1, "X<div>" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + ( wrap[2] || "" );
// Descend through wrappers to the right content
j = wrap[0];
equal( jQuery("#tAnchor5").attr("href"), "#5", "Check for non-absolute href (an anchor)" );
jQuery("<a id='tAnchor6' href='#5' />").appendTo("#qunit-fixture");
equal( jQuery("#tAnchor5").prop("href"), jQuery("#tAnchor6").prop("href"), "Check for absolute href prop on an anchor" );
-
+
$("<script type='jquery/test' src='#5' id='scriptSrc'></script>").appendTo("#qunit-fixture");
equal( jQuery("#tAnchor5").prop("href"), jQuery("#scriptSrc").prop("src"), "Check for absolute src prop on a script" );
});
test( "coords returns correct values in IE6/IE7, see #10828", function() {
- expect( 2 );
+ expect( 1 );
var area,
map = jQuery("<map />");
area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("area");
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
-
- area = map.html("<area shape='rect' href='#' alt='a' /></map>").find("area");
- equal( area.attr("coords"), undefined, "did not retrieve coords correctly" );
});
};
var testAppend = function(valueObj) {
- expect(58);
+ expect(59);
testAppendForObject(valueObj, false);
testAppendForObject(valueObj, true);
$radioParent.wrap("<div></div>");
equal( $radioChecked[0].checked, true, "Reappending radios uphold which radio is checked" );
equal( $radioUnchecked[0].checked, false, "Reappending radios uphold not being checked" );
+
+ equal( jQuery("<div/>").append("option<area/>")[0].childNodes.length, 2, "HTML-string with leading text should be processed correctly" );
};
test("append(String|Element|Array<Element>|jQuery)", function() {
xml2 = jQuery( xmlDoc2 ),
scxml1 = jQuery( ":first", xml1 ),
scxml2 = jQuery( ":first", xml2 );
-
+
scxml1.replaceWith( scxml2 );
-
+
newNode = jQuery( ":first>state[id='provisioning3']", xml1 );
-
+
equal( newNode.length, 1, "ReplaceWith not working on document nodes." );
});