git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7d36ccf
)
Make sure that expando properties aren't set on embed, applet, or object elements...
author
John Resig
<jeresig@gmail.com>
Mon, 7 Dec 2009 04:00:31 +0000
(20:00 -0800)
committer
John Resig
<jeresig@gmail.com>
Mon, 7 Dec 2009 04:00:31 +0000
(20:00 -0800)
src/data.js
patch
|
blob
|
history
src/manipulation.js
patch
|
blob
|
history
diff --git
a/src/data.js
b/src/data.js
index
1d993fe
..
44d77a9
100644
(file)
--- a/
src/data.js
+++ b/
src/data.js
@@
-6,7
+6,19
@@
jQuery.extend({
expando:expando,
expando:expando,
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
data: function( elem, name, data ) {
data: function( elem, name, data ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;
elem = elem == window ?
windowData :
elem;
@@
-43,6
+55,10
@@
jQuery.extend({
},
removeData: function( elem, name ) {
},
removeData: function( elem, name ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;
elem = elem == window ?
windowData :
elem;
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
a8cb484
..
e1657a8
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-463,7
+463,7
@@
jQuery.extend({
function cleanData( elems ) {
for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
function cleanData( elems ) {
for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( (id = elem[expando]) ) {
+ if ( !jQuery.noData[elem.nodeNode.toLowerCase()] && (id = elem[expando]) ) {
delete jQuery.cache[ id ];
}
}
delete jQuery.cache[ id ];
}
}