X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=9222e0a12acc5e6fae488aafe401d054b81cb72f;hb=4503457616372973054a85c1628031792a4882f3;hp=9347689a3e922fe34b51e919a861f7234be85a58;hpb=83be3dca69391751276b6a8b38420f25e06c1045;p=jquery.git diff --git a/src/core.js b/src/core.js index 9347689..9222e0a 100644 --- a/src/core.js +++ b/src/core.js @@ -1,14 +1,3 @@ -/* - * jQuery @VERSION - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date$ - * $Rev$ - */ - var // Will speed up references to window, and allows munging its name. window = this, @@ -486,11 +475,11 @@ jQuery.fn = jQuery.prototype = { domManip: function( args, table, callback ) { if ( this[0] ) { - var fragment = this[0].ownerDocument.createDocumentFragment(), - scripts = jQuery.clean( args, this[0].ownerDocument, fragment ), + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), first = fragment.firstChild, extra = this.length > 1 ? fragment.cloneNode(true) : fragment; - + if ( first ) for ( var i = 0, l = this.length; i < l; i++ ) callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); @@ -981,6 +970,13 @@ jQuery.extend({ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) return elem.getAttributeNode( name ).nodeValue; + // elem.tabindex doesn't always return the correct value + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name == jQuery.props.tabindex ) { + var attributeNode = elem.getAttributeNode(jQuery.props.tabindex); + return attributeNode && attributeNode.specified && attributeNode.value || undefined; + } + return elem[ name ]; }