mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix($sniffer): ensure older versions of webkit work for animations
This commit is contained in:
parent
b7a54497b5
commit
b1a43cd04e
2 changed files with 38 additions and 0 deletions
|
|
@ -35,6 +35,11 @@ function $SnifferProvider() {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!vendorPrefix) {
|
||||
vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';
|
||||
}
|
||||
|
||||
transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
|
||||
animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,22 @@ describe('$sniffer', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should still work for an older version of Webkit', function() {
|
||||
module(function($provide) {
|
||||
var doc = {
|
||||
body : {
|
||||
style : {
|
||||
WebkitOpacity: '0'
|
||||
}
|
||||
}
|
||||
};
|
||||
$provide.value('$document', jqLite(doc));
|
||||
});
|
||||
inject(function($sniffer) {
|
||||
expect($sniffer.vendorPrefix).toBe('webkit');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('animations', function() {
|
||||
|
|
@ -201,6 +217,23 @@ describe('$sniffer', function() {
|
|||
expect($sniffer.animations).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should be true when an older version of Webkit is used', function() {
|
||||
module(function($provide) {
|
||||
var doc = {
|
||||
body : {
|
||||
style : {
|
||||
WebkitOpacity: '0'
|
||||
}
|
||||
}
|
||||
};
|
||||
$provide.value('$document', jqLite(doc));
|
||||
});
|
||||
inject(function($sniffer) {
|
||||
expect($sniffer.animations).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('transitions', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue