Skip to content
Permalink
Browse files

Revert "Landing pull request 581. Updates original patch by Orkel. Fi…

…xes #10006."

This reverts commit 299bc65.
  • Loading branch information
dmethvin committed Nov 22, 2011
1 parent ca08d93 commit 3586ea28a8303a8de9f7f94da9fe9c4272b3d8ec
Showing with 2 additions and 65 deletions.
  1. +1 −2 src/effects.js
  2. +1 −63 test/unit/effects.js
@@ -38,8 +38,7 @@ jQuery.fn.extend({
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( (display === "" && jQuery.css(elem, "display") === "none") ||
!jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
if ( display === "" && jQuery.css(elem, "display") === "none" ) {
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
}
}
@@ -167,7 +167,7 @@ test("Persist correct display value", function() {
});
});

test("show() resolves correct default display (#8099)", function() {
test("show() resolves correct default display #8099", function() {
expect(7);
var tt8099 = jQuery("<tt/>").appendTo("body"),
dfn8099 = jQuery("<dfn/>", { html: "foo"}).appendTo("body");
@@ -185,69 +185,7 @@ test("show() resolves correct default display (#8099)", function() {

tt8099.remove();
dfn8099.remove();
});

test( "show() resolves correct default display, detached nodes (#10006)", function(){
// Tests originally contributed by Orkel in
// https://github.com/jquery/jquery/pull/458
expect( 11 );

var div, span;

div = jQuery("<div class='hidden'>");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div is visible." );
div.remove();

div = jQuery("<div style='display: none'>");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div is visible." );
div.remove();

span = jQuery("<span class='hidden'/>");
span.show().appendTo("#qunit-fixture");
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through stylesheets ) span has default display." );
span.remove();

span = jQuery("<span style='display: inline'/>");
span.show().appendTo("#qunit-fixture");
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through inline style ) span has default display." );
span.remove();

div = jQuery("<div><div class='hidden'></div></div>").children("div");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div inside another visible div is visible." );
div.remove();

div = jQuery("<div><div style='display: none'></div></div>").children("div");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div inside another visible div is visible." );
div.remove();

div = jQuery("div.hidden");
div.detach().show();
equal( div.css("display"), "block", "Make sure a detached( through detach() ), pre-hidden div is visible." );
div.remove();

span = jQuery("<span>");
span.appendTo("#qunit-fixture").detach().show().appendTo("#qunit-fixture" );
equal( span.css("display"), "inline", "Make sure a detached( through detach() ), pre-hidden span has default display." );
span.remove();

div = jQuery("<div>");
div.show().appendTo("#qunit-fixture");
ok( !!div.get( 0 ).style.display, "Make sure not hidden div has a inline style." );
div.remove();

div = jQuery( document.createElement("div") );
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a pre-created element has default display." );
div.remove();

div = jQuery("<div style='display: inline'/>");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "inline", "Make sure that element has same display when it was created." );
div.remove();
});


0 comments on commit 3586ea2

Please sign in to comment.
You can’t perform that action at this time.