diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-12-14 17:38:33 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-12-14 17:38:33 -0500 |
commit | f4839f73a7057a21ea0506d903c4473575aed4a2 (patch) | |
tree | 5068d698d4806ce8b65c5f07fb4626a40a880f24 /tests/unit | |
parent | ec5f395260c5e4b678d2fe39c5405d466ee8369e (diff) | |
download | jquery-ui-f4839f73a7057a21ea0506d903c4473575aed4a2.tar.gz jquery-ui-f4839f73a7057a21ea0506d903c4473575aed4a2.zip |
Draggable Unit Tests: Ensure IFRAMEs can be written to
Draggable tests were failing in IE because the frame needs to be
written to to be accessible to further DOM manipulation.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index b8ea19930..c9cdde260 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -224,11 +224,15 @@ test( "#9379: Draggable: position bug in scrollable div", function() { test( "#5727: draggable from iframe" , function() { expect( 1 ); - var iframe = $( "<iframe id='iframe-draggable-container' src='about:blank'></iframe>" ).appendTo( "#qunit-fixture" ), - iframeBody = iframe.contents().find( "body" ).append( - "<div id='iframe-draggable-1' style='background: green; width: 200px; height: 100px;'>Relative</div>" - ), - draggable1 = iframeBody.find( "#iframe-draggable-1" ); + var iframeBody, draggable1, + iframe = $( "<iframe />" ).appendTo( "#qunit-fixture" ), + iframeDoc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; + + iframeDoc.write( "<!doctype html><html><body>" ); + iframeDoc.close(); + + iframeBody = $( iframeDoc.body ).append( "<div style='width: 2px; height: 2px;' />" ); + draggable1 = iframeBody.find( "div" ); draggable1.draggable(); |