(function( jQuery ) {
var elemdisplay = {},
+ iframe = null,
+ iframeDoc = null,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
timerId,
if ( display === "none" || display === "" ) {
- var iframe = defaultDisplay.iframe,
- iframeDoc = defaultDisplay.iframeDoc;
-
// No iframe to use yet, so create it
- if ( !defaultDisplay.iframe ) {
+ if ( !iframe ) {
iframe = document.createElement( "iframe" );
iframe.width = iframe.height = 0;
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
iframeDoc.write("<!doctype><html><body></body></html>");
- // Cache iframe element
- defaultDisplay.iframe = iframe;
- defaultDisplay.iframeDoc = iframeDoc;
} else {
// Reuse previous iframe
return elemdisplay[ nodeName ];
}
-defaultDisplay.iframe = null;
-defaultDisplay.iframeDoc = null;
-
})( jQuery );
});
test("show() resolves correct default display #8099", function() {
- expect(5);
- var bug8099 = jQuery("<tt/>").appendTo("#main");
+ expect(7);
+ var bug8099 = jQuery("<tt/>").appendTo("#main"),
+ div8099 = jQuery("<div/>", { className: "hidden" }).appendTo("#main");
equals( bug8099.css("display"), "none", "default display override for all tt" );
equals( bug8099.show().css("display"), "inline", "Correctly resolves display:inline" );
equals( bug8099.hide().css("display"), "none", "default display override for all tt" );
equals( bug8099.show().css("display"), "inline", "Correctly resolves display:inline" );
+ equals( div8099.show().css("display"), "block", "default display override for all div.hidden" );
+ equals( div8099.hide().css("display"), "none", "Correctly resolves display:none" );
+
bug8099.remove();
+ div8099.remove();
});