@@ -744,56 +744,53 @@ QUnit.test( "contents()", function( assert ) {
744744} ) ;
745745
746746QUnit . test ( "contents() for <template />" , function ( assert ) {
747- assert . expect ( 4 ) ;
747+ assert . expect ( 4 ) ;
748748
749- jQuery ( "#qunit-fixture" ) . append (
750- "<template id='template'>" +
751- " <div id='template-div0'>" +
752- " <span>Hello, Web Component!</span>" +
753- " </div>" +
754- " <div id='template-div1'></div>" +
755- " <div id='template-div2'></div>" +
756- "</template>"
757- ) ;
749+ jQuery ( "#qunit-fixture" ) . append (
750+ "<template id='template'>" +
751+ " <div id='template-div0'>" +
752+ " <span>Hello, Web Component!</span>" +
753+ " </div>" +
754+ " <div id='template-div1'></div>" +
755+ " <div id='template-div2'></div>" +
756+ "</template>"
757+ ) ;
758758
759- var contents = jQuery ( "#template" ) . contents ( ) ;
760- assert . equal ( contents . length , 6 , "Check template element contents" ) ;
759+ var contents = jQuery ( "#template" ) . contents ( ) ;
760+ assert . equal ( contents . length , 6 , "Check template element contents" ) ;
761761
762- assert . equal ( contents . find ( "span" ) . text ( ) , "Hello, Web Component!" , "Find span in template and check its text" ) ;
762+ assert . equal ( contents . find ( "span" ) . text ( ) , "Hello, Web Component!" , "Find span in template and check its text" ) ;
763763
764- jQuery ( "<div id='templateTest' />" ) . append (
765- jQuery ( jQuery . map ( contents , function ( node ) {
766- return document . importNode ( node , true ) ;
767- } ) )
768- ) . appendTo ( "#qunit-fixture" ) ;
764+ jQuery ( "<div id='templateTest' />" ) . append (
765+ jQuery ( jQuery . map ( contents , function ( node ) {
766+ return document . importNode ( node , true ) ;
767+ } ) )
768+ ) . appendTo ( "#qunit-fixture" ) ;
769769
770- contents = jQuery ( "#templateTest" ) . contents ( ) ;
771- assert . equal ( contents . length , 6 , "Check cloned nodes of template element contents" ) ;
770+ contents = jQuery ( "#templateTest" ) . contents ( ) ;
771+ assert . equal ( contents . length , 6 , "Check cloned nodes of template element contents" ) ;
772772
773- assert . equal ( contents . filter ( "div" ) . length , 3 , "Count cloned elements from template" ) ;
773+ assert . equal ( contents . filter ( "div" ) . length , 3 , "Count cloned elements from template" ) ;
774774} ) ;
775775
776- QUnit [ "content" in document . createElement ( "template" ) ? "test" : "skip" ] (
777- "contents() for <template /> remains inert" ,
778- function ( assert ) {
779- assert . expect ( 2 ) ;
776+ QUnit [ "content" in document . createElement ( "template" ) ? "test" : "skip" ] ( "contents() for <template /> remains inert" , function ( assert ) {
777+ assert . expect ( 2 ) ;
780778
781- Globals . register ( "testScript" ) ;
782- Globals . register ( "testImgOnload" ) ;
779+ Globals . register ( "testScript" ) ;
780+ Globals . register ( "testImgOnload" ) ;
783781
784- jQuery ( "#qunit-fixture" ) . append (
785- "<template id='template'>" +
786- " <script>testScript = 1;</script>" +
787- " <img src='" + baseURL + "1x1.jpg' onload='testImgOnload = 1' >" +
788- "</template>"
789- ) ;
782+ jQuery ( "#qunit-fixture" ) . append (
783+ "<template id='template'>" +
784+ " <script>testScript = 1;</script>" +
785+ " <img src='" + baseURL + "1x1.jpg' onload='testImgOnload = 1' >" +
786+ "</template>"
787+ ) ;
790788
791- var content = jQuery ( "#template" ) . contents ( ) ;
789+ var content = jQuery ( "#template" ) . contents ( ) ;
792790
793- assert . strictEqual ( window . testScript , true , "script in template isn't executed" ) ;
794- assert . strictEqual ( window . testImgOnload , true , "onload of image in template isn't executed" ) ;
795- }
796- ) ;
791+ assert . strictEqual ( window . testScript , true , "script in template isn't executed" ) ;
792+ assert . strictEqual ( window . testImgOnload , true , "onload of image in template isn't executed" ) ;
793+ } ) ;
797794
798795QUnit . test ( "contents() for <object />" , function ( assert ) {
799796 assert . expect ( 2 ) ;
@@ -820,6 +817,7 @@ QUnit.test( "contents() for <frame />", function( assert ) {
820817 iframe . on ( "load" , function ( ) {
821818 var container = jQuery ( "#frame-contents" ) . contents ( ) ;
822819 var contents = container . find ( "#test-frame" ) . contents ( ) ;
820+ console . log ( contents . find ( "html" ) . html ( ) ) ;
823821 assert . equal ( contents . length , 1 , "Check frame contents" ) ;
824822 assert . equal ( contents . find ( "body" ) . length , 1 , "Find body within frame" ) ;
825823 done ( ) ;
0 commit comments