X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=b5a1c7072030a85dda77baf3472d9f63f2d7badb;hb=d36382e9a3fa604597d400d1084a2424f0d3eb80;hp=ad938f2b53ace3d0c6a5ac0cbdb6506dbdaec398;hpb=7ef40fd19926c779086ae7d79796032708d568e0;p=jquery.git diff --git a/src/core.js b/src/core.js index ad938f2..b5a1c70 100644 --- a/src/core.js +++ b/src/core.js @@ -323,6 +323,8 @@ jQuery.fn = jQuery.prototype = { // Copy the events from the original to the clone if ( events === true ) this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; var events = jQuery.data( this, "events" ); for ( var type in events ) @@ -498,7 +500,7 @@ jQuery.fn = jQuery.prototype = { jQuery.each(elems, function(){ var elem = clone ? - this.cloneNode( true ) : + jQuery( this ).clone( true )[0] : this; // execute all scripts after the elements have been injected @@ -798,7 +800,7 @@ jQuery.extend({ else jQuery.swap( elem, props, getWH ); - return val; + return Math.max(0, val); } return jQuery.curCSS( elem, name, force ); @@ -932,7 +934,7 @@ jQuery.extend({ if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ? + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + ">"; });