aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ng/sniffer.js5
-rw-r--r--test/ng/snifferSpec.js44
2 files changed, 49 insertions, 0 deletions
diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js
index 86c8dd00..54e6e083 100644
--- a/src/ng/sniffer.js
+++ b/src/ng/sniffer.js
@@ -37,6 +37,11 @@ function $SnifferProvider() {
}
transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
+
+ if (android && (!transitions||!animations)) {
+ transitions = isString(document.body.style.webkitTransition);
+ animations = isString(document.body.style.webkitAnimation);
+ }
}
diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js
index 5cdc8fd9..c9d0d5a8 100644
--- a/test/ng/snifferSpec.js
+++ b/test/ng/snifferSpec.js
@@ -179,6 +179,28 @@ describe('$sniffer', function() {
expect($sniffer.animations).toBe(true);
});
});
+
+ it('should be true on android with older body style properties', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ webkitAnimation: ''
+ }
+ }
+ };
+ var win = {
+ navigator: {
+ userAgent: 'android 2'
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ $provide.value('$window', win);
+ });
+ inject(function($sniffer) {
+ expect($sniffer.animations).toBe(true);
+ });
+ });
});
describe('transitions', function() {
@@ -238,5 +260,27 @@ describe('$sniffer', function() {
});
});
+ it('should be true on android with older body style properties', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ webkitTransition: ''
+ }
+ }
+ };
+ var win = {
+ navigator: {
+ userAgent: 'android 2'
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ $provide.value('$window', win);
+ });
+ inject(function($sniffer) {
+ expect($sniffer.transitions).toBe(true);
+ });
+ });
+
});
});