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

--HG--
extra : source : a9d8eb075f383d39d96d283825fe432417b3e01a
extra : intermediate-source : 9764f77b64e4a9c7914b539e61c412f838c09093
This commit is contained in:
Botond Ballo 2015-10-26 16:06:27 -04:00
Родитель 711e819f92
Коммит 94f0bf5241
6 изменённых файлов: 9 добавлений и 21 удалений

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

@ -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.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 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.safetyX", 0); // escape borders in units of 1/240"
pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240" pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"

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

@ -486,10 +486,6 @@ pref("dom.disable_window_move_resize", false);
// prevent JS from monkeying with window focus, etc // prevent JS from monkeying with window focus, etc
pref("dom.disable_window_flip", true); 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 // popups.policy 1=allow,2=reject
pref("privacy.popups.policy", 1); pref("privacy.popups.policy", 1);
pref("privacy.popups.usecustom", true); pref("privacy.popups.usecustom", true);

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

@ -181,7 +181,10 @@ TouchEvent::PrefEnabled(JSContext* aCx, JSObject* aGlobal)
int32_t flag = 0; int32_t flag = 0;
if (NS_SUCCEEDED(Preferences::GetInt("dom.w3c_touch_events.enabled", &flag))) { if (NS_SUCCEEDED(Preferences::GetInt("dom.w3c_touch_events.enabled", &flag))) {
if (flag == 2) { 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 sDidCheckTouchDeviceSupport = false;
static bool sIsTouchDeviceSupportPresent = false; static bool sIsTouchDeviceSupportPresent = false;
// On Windows and GTK3 we auto-detect based on device support. // On Windows and GTK3 we auto-detect based on device support.

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

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

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

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

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

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