git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Landing a fix for non-link anchor tabIndex (from scott.gonzalez). Fixes ticket #3916.
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
493a655
..
6dc4f00
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-206,20
+206,22
@@
jQuery.fn = jQuery.prototype = {
},
wrapAll: function( html ) {
},
wrapAll: function( html ) {
- if ( this[0] )
+ if ( this[0] ) {
// The elements to wrap the target around
// The elements to wrap the target around
- jQuery( html, this[0].ownerDocument )
- .clone()
- .insertBefore( this[0] )
- .map(function(){
- var elem = this;
+ var wrap = jQuery( html, this[0].ownerDocument ).clone();
+
+ if ( this[0].parentNode )
+ wrap.insertBefore( this[0] );
- while ( elem.firstChild )
- elem = elem.firstChild;
+ wrap.map(function(){
+ var elem = this;
- return elem;
- })
- .append(this);
+ while ( elem.firstChild )
+ elem = elem.firstChild;
+
+ return elem;
+ }).append(this);
+ }
return this;
},
return this;
},
@@
-266,6
+268,8
@@
jQuery.fn = jQuery.prototype = {
return this.prevObject || jQuery( [] );
},
return this.prevObject || jQuery( [] );
},
+ // For internal use only.
+ // Behaves like an Array's .push method, not like a jQuery method.
push: [].push,
find: function( selector ) {
push: [].push,
find: function( selector ) {
@@
-923,7
+927,7
@@
jQuery.extend({
if ( fragment ) {
for ( var i = 0; ret[i]; i++ ) {
if ( fragment ) {
for ( var i = 0; ret[i]; i++ ) {
- if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type === "text/javascript") ) {
+ if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 )
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 )
@@
-959,7
+963,7
@@
jQuery.extend({
// Safari mis-reports the default selected property of a hidden option
// Accessing the parent's selectedIndex property fixes it
// Safari mis-reports the default selected property of a hidden option
// Accessing the parent's selectedIndex property fixes it
- if ( name == "selected" )
+ if ( name == "selected" && elem.parentNode )
elem.parentNode.selectedIndex;
// If applicable, access the attribute via the DOM 0 way
elem.parentNode.selectedIndex;
// If applicable, access the attribute via the DOM 0 way
@@
-982,9
+986,11
@@
jQuery.extend({
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified
? attributeNode.value
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified
? attributeNode.value
- : elem.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)
+ : elem.nodeName.match(/(button|input|object|select|textarea)/i)
? 0
? 0
- : undefined;
+ : elem.nodeName.match(/^(a|area)$/i) && elem.href
+ ? 0
+ : undefined;
}
return elem[ name ];
}
return elem[ name ];