Skip to content

Commit

Permalink
Revert "Merge branch '8099' of https://github.com/rwldrn/jquery into …
Browse files Browse the repository at this point in the history
…rwldrn-8099"

This reverts commit bb94085, reversing
changes made to 3ad8dd2.

Conflicts:

	src/effects.js
  • Loading branch information
jitter committed Feb 15, 2011
1 parent 6b08d88 commit faa6fe3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
29 changes: 2 additions & 27 deletions src/effects.js
Expand Up @@ -505,42 +505,17 @@ if ( jQuery.expr && jQuery.expr.filters ) {
}

function defaultDisplay( nodeName ) {
var stylesheets = document.styleSheets,
disabled = [],
elem, display, style, idx;

if ( !elemdisplay[ nodeName ] ) {
var elem = jQuery("<" + nodeName + ">").appendTo("body"),
display = elem.css("display");

// #8099 - If the end-dev has globally changed a default
// display, we can temporarily disable their styles to check
// for the correct default value
for ( idx = 0; idx < stylesheets.length; ++idx ) {
style = stylesheets[ idx ];
disabled[ idx ] = style.disabled;
style.disabled = true;
}

// 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");

// Remove temp element
elem.remove();

if ( display === "none" || display === "" ) {
display = "block";
}

// Store the correct default display
elemdisplay[ nodeName ] = display;

// Restore stylesheets
for ( idx = 0; idx < stylesheets.length; ++idx ) {
stylesheets[ idx ].disabled = disabled[ idx ];
}
}

return elemdisplay[ nodeName ];
Expand Down
3 changes: 0 additions & 3 deletions test/data/testsuite.css
Expand Up @@ -109,6 +109,3 @@ div#show-tests * { display: none; }
#nothiddendiv { font-size: 16px; }
#nothiddendivchild.em { font-size: 2em; }
#nothiddendivchild.prct { font-size: 150%; }

/* 8099 changes to default styles are read correctly */
tt { display: none; }
12 changes: 0 additions & 12 deletions test/unit/effects.js
Expand Up @@ -162,18 +162,6 @@ test("Persist correct display value", function() {
});
});

test("show() resolves correct default display #8099", function() {
expect(3);
var bug8099 = jQuery("<tt/>").appendTo("#main");

equals( bug8099.css("display"), "none", "default display override for all tt" );
equals( bug8099.show().css("display"), "inline", "Correctly resolves display:inline" );

bug8099.remove();

equals( jQuery("#foo").hide().show().css("display"), "block", "Correctly resolves display:block after hide/show" );
});

test("animate(Hash, Object, Function)", function() {
expect(1);
stop();
Expand Down

0 comments on commit faa6fe3

Please sign in to comment.