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 (from parent 1:
0d2e479
)
Bug #8099 - Updates per review
author
rwldrn
<waldron.rick@gmail.com>
Mon, 31 Jan 2011 19:50:03 +0000
(14:50 -0500)
committer
rwldrn
<waldron.rick@gmail.com>
Mon, 31 Jan 2011 19:50:03 +0000
(14:50 -0500)
src/effects.js
patch
|
blob
|
history
diff --git
a/src/effects.js
b/src/effects.js
index
c73fd92
..
2dd7011
100644
(file)
--- a/
src/effects.js
+++ b/
src/effects.js
@@
-507,19
+507,23
@@
if ( jQuery.expr && jQuery.expr.filters ) {
function defaultDisplay( nodeName ) {
var stylesheets = document.styleSheets,
disabled = [],
function defaultDisplay( nodeName ) {
var stylesheets = document.styleSheets,
disabled = [],
- elem, display;
+ elem, display, style, idx;
if ( !elemdisplay[ nodeName ] ) {
// #8099 - If the end-dev has globally changed a default
// display, we can temporarily disable their styles to check
// for the correct default value
if ( !elemdisplay[ nodeName ] ) {
// #8099 - If the end-dev has globally changed a default
// display, we can temporarily disable their styles to check
// for the correct default value
- jQuery.each( stylesheets, function( idx, obj ) {
- disabled[ idx ] = obj.disabled;
- obj.disabled = true;
- });
+ for ( idx = 0; idx < stylesheets.length; ++idx ) {
+ style = stylesheets[ idx ];
+ disabled[ idx ] = style.disabled;
+ style.disabled = true;
+ }
- // Create a temp element and check it's default display
+ // To accurately check an element's default display value,
+ // create a temp element and check it's default display, this
+ // will ensure that the value returned is not a user-tampered
+ // value.
elem = jQuery("<" + nodeName + ">").appendTo("body"),
display = elem.css("display");
elem = jQuery("<" + nodeName + ">").appendTo("body"),
display = elem.css("display");
@@
-534,9
+538,9
@@
function defaultDisplay( nodeName ) {
elemdisplay[ nodeName ] = display;
// Restore stylesheets
elemdisplay[ nodeName ] = display;
// Restore stylesheets
- jQuery.each( stylesheets, function( idx, obj ) {
- this.disabled = disabled[ idx ];
- });
+ for ( idx = 0; idx < stylesheets.length; ++idx ) {
+ stylesheets[ idx ].disabled = disabled[ idx ];
+ }
}
return elemdisplay[ nodeName ];
}
return elemdisplay[ nodeName ];