Skip to content
Permalink
Browse files

Remove stranded support.js checks for oldIE.

  • Loading branch information...
dmethvin committed Jan 2, 2013
1 parent 445dbd9 commit 3d9edb32bc4abfb33a4029edab80099e1bfdaedc
Showing with 1 addition and 64 deletions.
  1. +0 −23 src/support.js
  2. +1 −41 test/unit/css.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></:nav>",

// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",

@@ -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);

0 comments on commit 3d9edb3

Please sign in to comment.
You can’t perform that action at this time.