Bug 1003836 - Don't use createEvent("TouchEvent") to check if TouchEvents are supported r=smaug

This commit is contained in:
Fabrice Desré 2014-05-02 14:56:18 -07:00
Родитель 3e74521bd5
Коммит 9eb8169458
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -50,9 +50,9 @@ const ContentPanning = {
},
_setupListenersForPanning: function cp_setupListenersForPanning() {
var events;
try {
content.document.createEvent('TouchEvent');
let events;
if (content.TouchEvent) {
events = ['touchstart', 'touchend', 'touchmove'];
this.watchedEventsType = 'touch';
#ifdef MOZ_WIDGET_GONK
@ -65,7 +65,7 @@ const ContentPanning = {
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
this.hybridEvents = isParentProcess;
#endif
} catch(e) {
} else {
// Touch events aren't supported, so fall back on mouse.
events = ['mousedown', 'mouseup', 'mousemove'];
this.watchedEventsType = 'mouse';