diff options
author | Oleg <markelog@gmail.com> | 2013-02-01 16:57:50 +0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-02-04 15:13:01 -0500 |
commit | 8226666b1344b27f22f3f0699586054a20718ad3 (patch) | |
tree | be90a8c502eb85f1a60d647e08b900a0844abfb6 /test | |
parent | 219a1935eea509bf147a05ef9d47502d8230991d (diff) | |
download | jquery-8226666b1344b27f22f3f0699586054a20718ad3.tar.gz jquery-8226666b1344b27f22f3f0699586054a20718ad3.zip |
Fix #13310. Get the right display value for disconnected nodes. Close gh-1155.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/testsuite.css | 2 | ||||
-rw-r--r-- | test/index.html | 1 | ||||
-rw-r--r-- | test/unit/css.js | 23 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test/data/testsuite.css b/test/data/testsuite.css index 6bb3a5ded..1dfa7cd34 100644 --- a/test/data/testsuite.css +++ b/test/data/testsuite.css @@ -151,3 +151,5 @@ section { background:#f0f; display:block; } /* #11971 */ #foo { background: url(1x1.jpg) right bottom no-repeat; } + +#display { display: list-item !important; } diff --git a/test/index.html b/test/index.html index 918d7d2d7..f073054d8 100644 --- a/test/index.html +++ b/test/index.html @@ -318,6 +318,7 @@ Z</textarea> </div> <div id="fx-tests"></div> + <span id="display"></span> </div> </div> </dl> diff --git a/test/unit/css.js b/test/unit/css.js index f7c7ad424..303ee5515 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1010,4 +1010,27 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme window.setTimeout( start, 1000 ); }); +asyncTest( "Make sure initialized display value for disconnected nodes is correct (#13310)", 4, function() { + var display = jQuery("#display").css("display"), + div = jQuery("<div/>"); + + equal( div.css( "display", "inline" ).hide().show().appendTo("body").css( "display" ), "inline", "Initialized display value has returned" ); + div.remove(); + + div.css( "display", "none" ).hide(); + equal( jQuery._data( div[ 0 ], "olddisplay" ), undefined, "olddisplay is undefined after hiding a detached and hidden element" ); + div.remove(); + + div.css( "display", "inline-block" ).hide().appendTo("body").fadeIn(function() { + equal( div.css( "display" ), "inline-block", "Initialized display value has returned" ); + div.remove(); + + start(); + }); + + equal( jQuery._data( jQuery("#display").css( "display", "inline" ).hide()[ 0 ], "olddisplay" ), display, + "display: * !Important value should used as initialized display" ); + jQuery._removeData( jQuery("#display")[ 0 ] ); +}); + } |