Skip to content

Commit

Permalink
Merge pull request #1540 from patrickkettner/ie-9-fixes
Browse files Browse the repository at this point in the history
fix IE 9 caniuse mappings
  • Loading branch information
patrickkettner committed Feb 27, 2015
2 parents 780dc82 + fe34314 commit 74847dd
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions test/browser/integration/caniuse.js
Expand Up @@ -59,6 +59,8 @@ window.caniusecb = function(caniuse) {
filereader: 'fileapi',
filesystem: 'filesystem',
flexbox: 'flexbox',
flexboxtweener: 'flexbox',
flexboxlegacy: 'flexbox',
fontface: 'fontface',
formvalidation: 'form-validation',
fullscreen: 'fullscreen',
Expand Down Expand Up @@ -156,22 +158,37 @@ window.caniusecb = function(caniuse) {
ciubool = o.fp = true;
}

// caniuse bundles forms into one big wad of detects. we check to see if their result matches
// atleast some of our inputtypes.
if (o.ciufeature === 'forms') {
return it('Caniuse result for forms matches Modernizr\'s result for inputtypes', function() {
return expect(ciubool).to.be(_.some(Modernizr.inputtypes, function(modernizrResult) {
return modernizrResult;
}));
});
}


// we breakout flexbox sniffing into three seperate detects, which borks the caniuse mappings,
// since no browser supports all three
if (o.feature === 'flexbox') {
return expect([
Modernizr.flexbox,
Modernizr.flexboxlegacy,
Modernizr.flexboxtweener
]).to.contain(ciubool);
if (o.ciufeature === 'flexbox') {
return it('Caniuse result for flexbox matches Modernizr\'s result for flexbox', function() {
return expect([
Modernizr.flexbox,
Modernizr.flexboxlegacy,
Modernizr.flexboxtweener
]).to.contain(ciubool);
});
}

// caniuse bundles progress and meter elements, so we do too.
if (_.contains(['meter','progressbar'], o.feature)) {
return expect([
Modernizr.meter,
Modernizr.progressmeter
]).to.contain(ciubool);
return it('Caniuse result for ' + o.ciufeature + ' matches Modernizr\'s result for ' + o.feature, function() {
return expect([
Modernizr.meter,
Modernizr.progressmeter
]).to.contain(ciubool);
});
}

// caniuse bundles viewport units, all of which work in IE 9+, save for vmax
Expand All @@ -180,6 +197,12 @@ window.caniusecb = function(caniuse) {
return;
}

// caniuse counts a partial support for CORS via the XDomainRequest,
// but thats not really cors - so skip the comparison.
if (o.feature === 'cors' && o.browser == 'IE' && o.version < 10) {
return;
}

// if caniuse gave us a 'partial', lets let it pass with a note.
if (o.caniuseResult.indexOf('a') === 0) {
return it(o.browser + o.version + ': Caniuse reported partial support for ' + o.ciufeature, function() {
Expand Down

0 comments on commit 74847dd

Please sign in to comment.