Skip to content

Commit

Permalink
fix ie10 caniuse comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkettner committed Feb 27, 2015
1 parent 3bebb8d commit 7e6bd80
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions test/browser/integration/caniuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,35 @@ window.caniusecb = function(caniuse) {
o.result = o.result.valueOf();
}

// change the *documented* false positives
if (!ciubool && (o.feature == 'textshadow' && o.browser == 'firefox' && o.version == 3)) {
ciubool = o.fp = true;
}

// 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);
}

// 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);
}

// caniuse bundles viewport units, all of which work in IE 9+, save for vmax
// we skip this comparison with a version gate, hoping its fixed in later versions.
if (o.feature === 'cssvmaxunit' && o.browser == 'IE' && o.version < 12) {
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 All @@ -160,11 +189,6 @@ window.caniusecb = function(caniuse) {
}


// change the *documented* false positives
if (!ciubool && (o.feature == 'textshadow' && o.browser == 'firefox' && o.version == 3)) {
ciubool = o.fp = true;
}

// where we actually do most our assertions
it(o.browser + o.version + ': Caniuse result for ' + o.ciufeature + ' matches Modernizr\'s ' + (o.fp ? '*false positive*' : 'result') + ' for ' + o.feature, function() {
var modernizrResult = o.result instanceof Boolean ? o.result.valueOf() : !!o.result;
Expand Down

0 comments on commit 7e6bd80

Please sign in to comment.