aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ng/sniffer.js2
-rw-r--r--test/ng/snifferSpec.js49
2 files changed, 50 insertions, 1 deletions
diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js
index 19877b87..8a2fd44f 100644
--- a/src/ng/sniffer.js
+++ b/src/ng/sniffer.js
@@ -33,7 +33,7 @@ function $SnifferProvider() {
break;
}
}
- transitions = !!(vendorPrefix + 'Transition' in bodyStyle);
+ transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
}
diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js
index d791c17b..3a450e24 100644
--- a/test/ng/snifferSpec.js
+++ b/test/ng/snifferSpec.js
@@ -132,5 +132,54 @@ describe('$sniffer', function() {
});
});
+ it('should be false when there is no transition style', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {}
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(false);
+ });
+ });
+
+ it('should be true with vendor-specific transitions', function() {
+ module(function($provide) {
+ var transitionStyle = '1s linear all';
+ var doc = {
+ body : {
+ style : {
+ WebkitTransition : transitionStyle,
+ MozTransition : transitionStyle,
+ OTransition : transitionStyle
+ }
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(true);
+ });
+ });
+
+ it('should be true with w3c-style transitions', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ transition : '1s linear all'
+ }
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(true);
+ });
+ });
+
});
});