Backed out changeset 3b0468c92157 (bug 891882) for breaking a test in gaia-ui-test
authorWes Kocher <wkocher@mozilla.com>
Wed, 06 Nov 2013 14:45:57 -0800
changeset 153838 ed53f428d0f26a8aa83ba208fa85be4f9ece7014
parent 153837 1ecaea226a35e6d5f9b7ec2c877eef9a752af025
child 153839 8233d40249e06cb7a9c3d9f3dc6e8148d104d282
child 153932 70de5e24d79bee41171616753e4d5dc3d35140b4
push id2167
push userkwierso@gmail.com
push dateWed, 06 Nov 2013 22:46:33 +0000
treeherderb2g-inbound@ed53f428d0f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs891882
milestone28.0a1
backs out3b0468c921573af5275076e27cb8a133eacfee9d
Backed out changeset 3b0468c92157 (bug 891882) for breaking a test in gaia-ui-test
b2g/app/b2g.js
b2g/chrome/content/shell.js
toolkit/devtools/touch-events.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -282,20 +282,24 @@ pref("media.video-queue.default-size", 3
 
 // optimize images' memory usage
 pref("image.mem.decodeondraw", true);
 pref("image.mem.allow_locking_in_content_processes", false); /* don't allow image locking */
 pref("image.mem.min_discard_timeout_ms", 86400000); /* 24h, we rely on the out of memory hook */
 pref("image.mem.max_decoded_image_kb", 30000); /* 30MB seems reasonable */
 pref("image.onload.decode.limit", 24); /* don't decode more than 24 images eagerly */
 
+// XXX this isn't a good check for "are touch events supported", but
+// we don't really have a better one at the moment.
+#ifdef MOZ_WIDGET_GONK
 // 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"
+#endif
 
 #ifdef MOZ_SAFE_BROWSING
 // Safe browsing does nothing unless this pref is set
 pref("browser.safebrowsing.enabled", true);
 
 // Prevent loading of pages identified as malware
 pref("browser.safebrowsing.malware.enabled", true);
 
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -623,37 +623,16 @@ var shell = {
       shell.isHomeLoaded = true;
 
 #ifdef MOZ_WIDGET_GONK
       libcutils.property_set('sys.boot_completed', '1');
 #endif
 
       Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
 
-#ifndef MOZ_WIDGET_GONK
-      let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {})
-                      .devtools.require;
-      let { TouchEventHandler } = require("devtools/touch-events");
-      let frame = content.QueryInterface(Ci.nsIInterfaceRequestor)
-                         .getInterface(Ci.nsIWebNavigation)
-                         .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
-      let scope = {
-        addEventListener:
-          function(type, fun, capture) {
-            frame.addEventListener(type, fun, capture);
-          },
-        removeEventListener:
-          function(type, fun) {
-            frame.removeEventListener(type, fun);
-          }
-      };
-      let touchEventHandler = new TouchEventHandler(scope);
-      touchEventHandler.start();
-#endif
-
       if ('pendingChromeEvents' in shell) {
         shell.pendingChromeEvents.forEach((shell.sendChromeEvent).bind(shell));
       }
       delete shell.pendingChromeEvents;
     });
   }
 };
 
--- a/toolkit/devtools/touch-events.js
+++ b/toolkit/devtools/touch-events.js
@@ -154,28 +154,16 @@ function TouchEventHandler (window) {
       let timeout = content.setTimeout((function contextMenu() {
         target.dispatchEvent(evt);
         this.cancelClick = true;
       }).bind(this), delay);
 
       return timeout;
     },
     sendTouchEvent: function teh_sendTouchEvent(evt, target, name) {
-      // When running OOP b2g desktop, we need to send the touch events
-      // using the mozbrowser api on the unwrapped frame.
-      if (target.localName == "iframe" && target.mozbrowser === true) {
-        let unwraped = XPCNativeWrapper.unwrap(target);
-        unwraped.sendTouchEvent(name, [0],                // event type, id
-                                [evt.pageX], [evt.pageY], // x, y
-                                [1], [1],                 // rx, ry
-                                [0], [0],                 // rotation, force
-                                1);                       // count
-        return;
-      }
-
       let document = target.ownerDocument;
       let content = this.getContent(target);
 
       let touchEvent = document.createEvent('touchevent');
       let point = document.createTouch(content, target, 0,
                                        evt.pageX, evt.pageY,
                                        evt.screenX, evt.screenY,
                                        evt.clientX, evt.clientY,