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