]> source.dussan.org Git - jquery.git/commitdiff
Tests: Clean up after the CSS Custom Properties support test
authorMichał Gołębiowski <m.goleb@gmail.com>
Tue, 7 Mar 2017 15:36:28 +0000 (16:36 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Tue, 7 Mar 2017 15:36:28 +0000 (16:36 +0100)
Ref bcec54ee7271e2d0e427bcb246e3d2009a8f84f9
Ref 619bf98d5b479f9582dbc40259b666f1c5a83146

test/unit/css.js

index d080a5fe0500e5ffbb5b61ac6c2ef504096857a6..b6bb9558470f9243e9009af29e166a332367f292 100644 (file)
@@ -1558,10 +1558,12 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
 
 ( function() {
        var supportsCssVars,
-               div = jQuery( "<div>" ).appendTo( "#qunit-fixture" )[ 0 ];
+               elem = jQuery( "<div>" ).appendTo( document.body ),
+               div = elem[ 0 ];
 
        div.style.setProperty( "--prop", "value" );
-       supportsCssVars = getComputedStyle( div ).getPropertyValue( "--prop" );
+       supportsCssVars = !!getComputedStyle( div ).getPropertyValue( "--prop" );
+       elem.remove();
 
        QUnit[ supportsCssVars ? "test" : "skip" ]( "css(--customProperty)", function( assert ) {
                jQuery( "#qunit-fixture" ).append(