Skip to content

Commit 3586ea2

Browse files
committed
Revert "Landing pull request 581. Updates original patch by Orkel. Fixes #10006."
This reverts commit 299bc65.
1 parent ca08d93 commit 3586ea2

File tree

2 files changed

+2
-65
lines changed

2 files changed

+2
-65
lines changed

src/effects.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jQuery.fn.extend({
3838
// Set elements which have been overridden with display: none
3939
// in a stylesheet to whatever the default browser style is
4040
// for such an element
41-
if ( (display === "" && jQuery.css(elem, "display") === "none") ||
42-
!jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
41+
if ( display === "" && jQuery.css(elem, "display") === "none" ) {
4342
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
4443
}
4544
}

test/unit/effects.js

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ test("Persist correct display value", function() {
167167
});
168168
});
169169

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

186186
tt8099.remove();
187187
dfn8099.remove();
188-
});
189-
190-
test( "show() resolves correct default display, detached nodes (#10006)", function(){
191-
// Tests originally contributed by Orkel in
192-
// https://github.com/jquery/jquery/pull/458
193-
expect( 11 );
194-
195-
var div, span;
196-
197-
div = jQuery("<div class='hidden'>");
198-
div.show().appendTo("#qunit-fixture");
199-
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div is visible." );
200-
div.remove();
201-
202-
div = jQuery("<div style='display: none'>");
203-
div.show().appendTo("#qunit-fixture");
204-
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div is visible." );
205-
div.remove();
206-
207-
span = jQuery("<span class='hidden'/>");
208-
span.show().appendTo("#qunit-fixture");
209-
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through stylesheets ) span has default display." );
210-
span.remove();
211-
212-
span = jQuery("<span style='display: inline'/>");
213-
span.show().appendTo("#qunit-fixture");
214-
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through inline style ) span has default display." );
215-
span.remove();
216-
217-
div = jQuery("<div><div class='hidden'></div></div>").children("div");
218-
div.show().appendTo("#qunit-fixture");
219-
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div inside another visible div is visible." );
220-
div.remove();
221-
222-
div = jQuery("<div><div style='display: none'></div></div>").children("div");
223-
div.show().appendTo("#qunit-fixture");
224-
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div inside another visible div is visible." );
225-
div.remove();
226-
227-
div = jQuery("div.hidden");
228-
div.detach().show();
229-
equal( div.css("display"), "block", "Make sure a detached( through detach() ), pre-hidden div is visible." );
230-
div.remove();
231-
232-
span = jQuery("<span>");
233-
span.appendTo("#qunit-fixture").detach().show().appendTo("#qunit-fixture" );
234-
equal( span.css("display"), "inline", "Make sure a detached( through detach() ), pre-hidden span has default display." );
235-
span.remove();
236-
237-
div = jQuery("<div>");
238-
div.show().appendTo("#qunit-fixture");
239-
ok( !!div.get( 0 ).style.display, "Make sure not hidden div has a inline style." );
240-
div.remove();
241188

242-
div = jQuery( document.createElement("div") );
243-
div.show().appendTo("#qunit-fixture");
244-
equal( div.css("display"), "block", "Make sure a pre-created element has default display." );
245-
div.remove();
246-
247-
div = jQuery("<div style='display: inline'/>");
248-
div.show().appendTo("#qunit-fixture");
249-
equal( div.css("display"), "inline", "Make sure that element has same display when it was created." );
250-
div.remove();
251189
});
252190

253191

0 commit comments

Comments
 (0)