Bug #8099 - Updates per review
This commit is contained in:
parent
0d2e4796dc
commit
c67867ad0c
22
src/effects.js
vendored
22
src/effects.js
vendored
|
@ -507,19 +507,23 @@ if ( jQuery.expr && jQuery.expr.filters ) {
|
||||||
function defaultDisplay( nodeName ) {
|
function defaultDisplay( nodeName ) {
|
||||||
var stylesheets = document.styleSheets,
|
var stylesheets = document.styleSheets,
|
||||||
disabled = [],
|
disabled = [],
|
||||||
elem, display;
|
elem, display, style, idx;
|
||||||
|
|
||||||
if ( !elemdisplay[ nodeName ] ) {
|
if ( !elemdisplay[ nodeName ] ) {
|
||||||
|
|
||||||
// #8099 - If the end-dev has globally changed a default
|
// #8099 - If the end-dev has globally changed a default
|
||||||
// display, we can temporarily disable their styles to check
|
// display, we can temporarily disable their styles to check
|
||||||
// for the correct default value
|
// for the correct default value
|
||||||
jQuery.each( stylesheets, function( idx, obj ) {
|
for ( idx = 0; idx < stylesheets.length; ++idx ) {
|
||||||
disabled[ idx ] = obj.disabled;
|
style = stylesheets[ idx ];
|
||||||
obj.disabled = true;
|
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"),
|
elem = jQuery("<" + nodeName + ">").appendTo("body"),
|
||||||
display = elem.css("display");
|
display = elem.css("display");
|
||||||
|
|
||||||
|
@ -534,9 +538,9 @@ function defaultDisplay( nodeName ) {
|
||||||
elemdisplay[ nodeName ] = display;
|
elemdisplay[ nodeName ] = display;
|
||||||
|
|
||||||
// Restore stylesheets
|
// Restore stylesheets
|
||||||
jQuery.each( stylesheets, function( idx, obj ) {
|
for ( idx = 0; idx < stylesheets.length; ++idx ) {
|
||||||
this.disabled = disabled[ idx ];
|
stylesheets[ idx ].disabled = disabled[ idx ];
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return elemdisplay[ nodeName ];
|
return elemdisplay[ nodeName ];
|
||||||
|
|
Loading…
Reference in a new issue