@@ -1853,61 +1853,6 @@ testIframe(
18531853 }
18541854) ;
18551855
1856- QUnit . test ( "jQuery.contains" , function ( assert ) {
1857- assert . expect ( 16 ) ;
1858-
1859- var container = document . getElementById ( "nonnodes" ) ,
1860- element = container . firstChild ,
1861- text = element . nextSibling ,
1862- nonContained = container . nextSibling ,
1863- detached = document . createElement ( "a" ) ;
1864- assert . ok ( element && element . nodeType === 1 , "preliminary: found element" ) ;
1865- assert . ok ( text && text . nodeType === 3 , "preliminary: found text" ) ;
1866- assert . ok ( nonContained , "preliminary: found non-descendant" ) ;
1867- assert . ok ( jQuery . contains ( container , element ) , "child" ) ;
1868- assert . ok ( jQuery . contains ( container . parentNode , element ) , "grandchild" ) ;
1869- assert . ok ( jQuery . contains ( container , text ) , "text child" ) ;
1870- assert . ok ( jQuery . contains ( container . parentNode , text ) , "text grandchild" ) ;
1871- assert . ok ( ! jQuery . contains ( container , container ) , "self" ) ;
1872- assert . ok ( ! jQuery . contains ( element , container ) , "parent" ) ;
1873- assert . ok ( ! jQuery . contains ( container , nonContained ) , "non-descendant" ) ;
1874- assert . ok ( ! jQuery . contains ( container , document ) , "document" ) ;
1875- assert . ok ( ! jQuery . contains ( container , document . documentElement ) , "documentElement (negative)" ) ;
1876- assert . ok ( ! jQuery . contains ( container , null ) , "Passing null does not throw an error" ) ;
1877- assert . ok ( jQuery . contains ( document , document . documentElement ) , "documentElement (positive)" ) ;
1878- assert . ok ( jQuery . contains ( document , element ) , "document container (positive)" ) ;
1879- assert . ok ( ! jQuery . contains ( document , detached ) , "document container (negative)" ) ;
1880- } ) ;
1881-
1882- QUnit . test ( "jQuery.contains in SVG (jQuery trac-10832)" , function ( assert ) {
1883- assert . expect ( 4 ) ;
1884-
1885- var svg = jQuery (
1886- "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='1' width='1'>" +
1887- "<g><circle cx='1' cy='1' r='1' /></g>" +
1888- "</svg>"
1889- ) . appendTo ( "#qunit-fixture" ) [ 0 ] ;
1890-
1891- assert . ok ( jQuery . contains ( svg , svg . firstChild ) , "root child" ) ;
1892- assert . ok ( jQuery . contains ( svg . firstChild , svg . firstChild . firstChild ) , "element child" ) ;
1893- assert . ok ( jQuery . contains ( svg , svg . firstChild . firstChild ) , "root granchild" ) ;
1894- assert . ok ( ! jQuery . contains ( svg . firstChild . firstChild , svg . firstChild ) ,
1895- "parent (negative)" ) ;
1896- } ) ;
1897-
1898- QUnit . testUnlessIE ( "jQuery.contains within <template/> doesn't throw (gh-5147)" , function ( assert ) {
1899- assert . expect ( 1 ) ;
1900-
1901- var template = jQuery ( "<template><div><div class='a'></div></div></template>" ) ,
1902- a = jQuery ( template [ 0 ] . content ) . find ( ".a" ) ;
1903-
1904- template . appendTo ( "#qunit-fixture" ) ;
1905-
1906- jQuery . contains ( a [ 0 ] . ownerDocument , a [ 0 ] ) ;
1907-
1908- assert . ok ( true , "Didn't throw" ) ;
1909- } ) ;
1910-
19111856QUnit . test ( "find in document fragments" , function ( assert ) {
19121857 assert . expect ( 1 ) ;
19131858
0 commit comments