зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1003836 - Don't use createEvent("TouchEvent") to check if TouchEvents are supported r=smaug
This commit is contained in:
Родитель
3e74521bd5
Коммит
9eb8169458
|
@ -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';
|
||||||
|
|
Загрузка…
Ссылка в новой задаче