From 3d9edb32bc4abfb33a4029edab80099e1bfdaedc Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Wed, 2 Jan 2013 17:47:30 -0500 Subject: [PATCH] Remove stranded support.js checks for oldIE. --- src/support.js | 23 ----------------------- test/unit/css.js | 42 +----------------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/src/support.js b/src/support.js index ceb3ddc84..68aed661d 100644 --- a/src/support.js +++ b/src/support.js @@ -21,25 +21,6 @@ jQuery.support = (function() { a.style.cssText = "float:left;opacity:.5"; support = { - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType === 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.5/.test( a.style.opacity ), - // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, @@ -51,10 +32,6 @@ jQuery.support = (function() { // Support: IE9, IE10 optSelected: opt.selected, - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode boxModel: document.compatMode === "CSS1Compat", diff --git a/test/unit/css.js b/test/unit/css.js index e7ada8bf9..abc625933 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -3,7 +3,7 @@ if ( jQuery.css ) { module("css", { teardown: moduleTeardown }); test("css(String|Hash)", function() { - expect( 46 ); + expect( 45 ); equal( jQuery("#qunit-fixture").css("display"), "block", "Check for css property \"display\"" ); @@ -66,9 +66,6 @@ test("css(String|Hash)", function() { equal( jQuery("#empty").css("opacity"), "0", "Assert opacity is accessible via filter property set in stylesheet in IE" ); jQuery("#empty").css({ "opacity": "1" }); equal( jQuery("#empty").css("opacity"), "1", "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" ); - jQuery.support.opacity ? - ok(true, "Requires the same number of tests"): - ok( ~jQuery("#empty")[0].currentStyle.filter.indexOf("gradient"), "Assert setting opacity doesn't overwrite other filters of the stylesheet in IE" ); div = jQuery("#nothiddendiv"); var child = jQuery("#nothiddendivchild"); @@ -273,43 +270,6 @@ test( "css(Array)", function() { deepEqual( elem.css( expectedSingle ).css([ "width" ]), expectedSingle, "Getting single element array" ); }); -if ( !jQuery.support.opacity ) { - test("css(String, Object) for MSIE", function() { - expect( 5 ); - // for #1438, IE throws JS error when filter exists but doesn't have opacity in it - jQuery("#foo").css("filter", "progid:DXImageTransform.Microsoft.Chroma(color='red');"); - equal( jQuery("#foo").css("opacity"), "1", "Assert opacity is 1 when a different filter is set in IE, #1438" ); - - var filterVal = "progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"; - var filterVal2 = "progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"; - var filterVal3 = "progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"; - jQuery("#foo").css("filter", filterVal); - equal( jQuery("#foo").css("filter"), filterVal, "css('filter', val) works" ); - jQuery("#foo").css("opacity", 1); - equal( jQuery("#foo").css("filter"), filterVal2, "Setting opacity in IE doesn't duplicate opacity filter" ); - equal( jQuery("#foo").css("opacity"), 1, "Setting opacity in IE with other filters works" ); - jQuery("#foo").css("filter", filterVal3).css("opacity", 1); - ok( jQuery("#foo").css("filter").indexOf(filterVal3) !== -1, "Setting opacity in IE doesn't clobber other filters" ); - }); - - test( "Setting opacity to 1 properly removes filter: style (#6652)", function() { - var rfilter = /filter:[^;]*/i, - test = jQuery( "#t6652" ).css( "opacity", 1 ), - test2 = test.find( "div" ).css( "opacity", 1 ); - - function hasFilter( elem ) { - var match = rfilter.exec( elem[0].style.cssText ); - if ( match ) { - return true; - } - return false; - } - expect( 2 ); - ok( !hasFilter( test ), "Removed filter attribute on element without filter in stylesheet" ); - ok( hasFilter( test2 ), "Filter attribute remains on element that had filter in stylesheet" ); - }); -} - test("css(String, Function)", function() { expect(3); -- 2.39.5