Bug 1217515 - Clean up the way touch event support is configured. r=roc

- all.js now sets dom.w3c_touch_events.enabled to auto-detect on all
  platforms except windows and mac
- auto-detect always returns true for android and b2g
- graphene and tests override the all.js pref with their own value
This commit is contained in:
Botond Ballo 2015-10-26 16:06:27 -04:00
parent 844efd82e7
commit 0215c25618
6 changed files with 9 additions and 21 deletions

View File

@ -344,10 +344,6 @@ pref("image.mem.surfacecache.size_factor", 8); // 1/8 of main memory
pref("image.mem.surfacecache.discard_factor", 2); // Discard 1/2 of the surface cache at a time.
pref("image.mem.surfacecache.min_expiration_ms", 86400000); // 24h, we rely on the out of memory hook
// XXX this isn't a good check for "are touch events supported", but
// we don't really have a better one at the moment.
// enable touch events interfaces
pref("dom.w3c_touch_events.enabled", 1);
pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240"
pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"

View File

@ -486,10 +486,6 @@ pref("dom.disable_window_move_resize", false);
// prevent JS from monkeying with window focus, etc
pref("dom.disable_window_flip", true);
// Disable touch events on Desktop Firefox by default until they are properly
// supported (bug 736048)
pref("dom.w3c_touch_events.enabled", 0);
// popups.policy 1=allow,2=reject
pref("privacy.popups.policy", 1);
pref("privacy.popups.usecustom", true);

View File

@ -181,7 +181,10 @@ TouchEvent::PrefEnabled(JSContext* aCx, JSObject* aGlobal)
int32_t flag = 0;
if (NS_SUCCEEDED(Preferences::GetInt("dom.w3c_touch_events.enabled", &flag))) {
if (flag == 2) {
#if defined(XP_WIN) || MOZ_WIDGET_GTK == 3
#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID)
// Touch support is always enabled on B2G and android.
prefValue = true;
#elif defined(XP_WIN) || MOZ_WIDGET_GTK == 3
static bool sDidCheckTouchDeviceSupport = false;
static bool sIsTouchDeviceSupportPresent = false;
// On Windows and GTK3 we auto-detect based on device support.

View File

@ -605,9 +605,6 @@ pref("image.downscale-during-decode.enabled", true);
pref("shumway.disabled", true);
#endif
// enable touch events interfaces
pref("dom.w3c_touch_events.enabled", 1);
#ifdef MOZ_SAFE_BROWSING
pref("browser.safebrowsing.enabled", true);
pref("browser.safebrowsing.malware.enabled", true);

View File

@ -606,9 +606,6 @@ pref("image.downscale-during-decode.enabled", true);
pref("shumway.disabled", true);
#endif
// enable touch events interfaces
pref("dom.w3c_touch_events.enabled", 1);
#ifdef MOZ_SAFE_BROWSING
pref("browser.safebrowsing.enabled", true);
pref("browser.safebrowsing.malware.enabled", true);

View File

@ -4543,12 +4543,11 @@ pref("dom.mozSettings.enabled", false);
pref("dom.mozPermissionSettings.enabled", false);
// W3C touch events
// 0 - disabled, 1 - enabled, 2 - autodetect (win/gtk3)
#ifdef XP_WIN
pref("dom.w3c_touch_events.enabled", 2);
#endif
#if MOZ_WIDGET_GTK == 3
// 0 - disabled, 1 - enabled, 2 - autodetect
// Enabling it for Windows is tracked by bug 736048.
#if defined(XP_WIN) || defined(XP_MACOSX)
pref("dom.w3c_touch_events.enabled", 0);
#else
pref("dom.w3c_touch_events.enabled", 2);
#endif