Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ENYO-1306: add silk browser detection separate from Android version, …

…add workaround for Silk 2 elementFromPoint error that matches Android Chrome

Enyo-DCO-1.1-Signed-Off-By: Ben Combee (ben.combee@palm.com)
  • Loading branch information...
commit b4ec121f34356a7df0e27c4c10f4e49cdefa2268 1 parent cb056d1
authored November 15, 2012
7  source/dom/platform.js
@@ -41,10 +41,10 @@ enyo.platform = {
41 41
 		{platform: "android", regex: /Android (\d+)/},
42 42
 		// Kindle Fire
43 43
 		// Force version to 2, (desktop mode does not list android version)
44  
-		{platform: "android", regex: /Silk\/1./, forceVersion: 2},
  44
+		{platform: "android", regex: /Silk\/1./, forceVersion: 2, extra: {silk: 1}},
45 45
 		// Kindle Fire HD
46 46
 		// Force version to 4
47  
-		{platform: "android", regex: /Silk\/2./, forceVersion: 4},
  47
+		{platform: "android", regex: /Silk\/2./, forceVersion: 4, extra: {silk: 2}},
48 48
 		// IE 8 - 10
49 49
 		{platform: "ie", regex: /MSIE (\d+)/},
50 50
 		// iOS 3 - 5
@@ -70,6 +70,9 @@ enyo.platform = {
70 70
 				v = Number(m[1]);
71 71
 			}
72 72
 			ep[p.platform] = v;
  73
+			if (p.extra) {
  74
+				enyo.mixin(ep, p.extra);
  75
+			}
73 76
 			break;
74 77
 		}
75 78
 	}
3  source/touch/touch.js
@@ -119,9 +119,10 @@ enyo.requiresWindow(function() {
119 119
 				document[e] = enyo.dispatch;
120 120
 			});
121 121
 			// use proper target finding technique based on feature detection.
122  
-			if (enyo.platform.androidChrome <= 18) {
  122
+			if (enyo.platform.androidChrome <= 18 || enyo.platform.silk === 2) {
123 123
 				// HACK: on Chrome for Android v18 on devices with higher density displays,
124 124
 				// document.elementFromPoint expects screen coordinates, not document ones
  125
+				// bug also appears on Kindle Fire HD
125 126
 				this.findTarget = function(e) {
126 127
 					return document.elementFromPoint(e.screenX, e.screenY);
127 128
 				};

0 notes on commit b4ec121

Please sign in to comment.
Something went wrong with that request. Please try again.