Commit 038d8b15 authored by Ryan VanderMeulen's avatar Ryan VanderMeulen
Browse files

Merge m-c to inbound.

parents 1e2a2525 044738c1
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -802,10 +802,7 @@ pref("dom.datastore.enabled", true);
#endif

// DOM Inter-App Communication API.
#ifdef MOZ_WIDGET_GONK
// Enable this only for gonk-specific build but not for desktop build.
pref("dom.inter-app-communication-api.enabled", true);
#endif

// Allow ADB to run for this many hours before disabling
// (only applies when marionette is disabled)
+1 −1
Original line number Diff line number Diff line
{
    "revision": "36aa3e5d226a844b07b3e4b2219f54b549456ec1", 
    "revision": "86e06b1db110e34eb66826d3b1bdee3a5d57b3a7", 
    "repo_path": "/integration/gaia-central"
}
+19 −4
Original line number Diff line number Diff line
@@ -307,6 +307,9 @@ let SessionStoreInternal = {
  // states for all currently opened windows
  _windows: {},

  // counter for creating unique window IDs
  _nextWindowID: 0,

  // states for all recently closed windows
  _closedWindows: [],

@@ -682,6 +685,15 @@ let SessionStoreInternal = {
    this._clearRestoringWindows();
  },

  /**
   * Generate a unique window identifier
   * @return string
   *         A unique string to identify a window
   */
  _generateWindowID: function ssi_generateWindowID() {
    return "window" + (this._nextWindowID++);
  },

  /**
   * If it's the first window load since app start...
   * - determine if we're reloading after a crash or a forced-restart
@@ -703,8 +715,9 @@ let SessionStoreInternal = {
        this._loadState == STATE_QUITTING)
      return;

    // assign it a unique identifier (timestamp)
    aWindow.__SSi = "window" + Date.now();
    // Assign the window a unique identifier we can use to reference
    // internal data about the window.
    aWindow.__SSi = this._generateWindowID();

    // and create its data object
    this._windows[aWindow.__SSi] = { tabs: [], selected: 0, _closedTabs: [], busy: false };
@@ -880,8 +893,10 @@ let SessionStoreInternal = {
    // this window was about to be restored - conserve its original data, if any
    let isFullyLoaded = this._isWindowLoaded(aWindow);
    if (!isFullyLoaded) {
      if (!aWindow.__SSi)
        aWindow.__SSi = "window" + Date.now();
      if (!aWindow.__SSi) {
        aWindow.__SSi = this._generateWindowID();
      }

      this._windows[aWindow.__SSi] = this._statesToRestore[aWindow.__SS_restoreID];
      delete this._statesToRestore[aWindow.__SS_restoreID];
      delete aWindow.__SS_restoreID;
+9 −33
Original line number Diff line number Diff line
@@ -1037,14 +1037,10 @@ var GestureModule = {
 */
var InputSourceHelper = {
  isPrecise: false,
  touchIsActive: false,

  init: function ish_init() {
    window.addEventListener("mousemove", this, true);
    window.addEventListener("mousedown", this, true);
    window.addEventListener("touchstart", this, true);
    window.addEventListener("touchend", this, true);
    window.addEventListener("touchcancel", this, true);
    Services.obs.addObserver(this, "metro_precise_input", false);
    Services.obs.addObserver(this, "metro_imprecise_input", false);
  },

  _precise: function () {
@@ -1061,33 +1057,13 @@ var InputSourceHelper = {
    }
  },

  handleEvent: function ish_handleEvent(aEvent) {
    switch(aEvent.type) {
      case "touchstart":
        this._imprecise();
        this.touchIsActive = true;
        break;
      case "touchend":
      case "touchcancel":
        this.touchIsActive = false;
        break;
      default:
        // Ignore mouse movement when touch is active. Prevents both mouse scrollbars
        // and touch scrollbars from displaying at the same time. Also works around
        // odd win8 bug involving an erant mousemove event after a touch sequence
        // starts (bug 896017).
        if (this.touchIsActive) {
          return;
        }

        switch (aEvent.mozInputSource) {
          case Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE:
          case Ci.nsIDOMMouseEvent.MOZ_SOURCE_PEN:
          case Ci.nsIDOMMouseEvent.MOZ_SOURCE_ERASER:
          case Ci.nsIDOMMouseEvent.MOZ_SOURCE_CURSOR:
  observe: function BrowserUI_observe(aSubject, aTopic, aData) {
    switch (aTopic) {
      case "metro_precise_input":
        this._precise();
        break;
        }
      case "metro_imprecise_input":
        this._imprecise();
        break;
    }
  },
+11 −27
Original line number Diff line number Diff line
@@ -32,44 +32,28 @@ function testState(aState) {
  }
}

function sendMouseMoves() {
  let utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                      .getInterface(Components.interfaces.nsIDOMWindowUtils);
  for (let deg = 0; deg < 180; deg++) {
    let coord = Math.sin((deg * Math.PI)/180) * 750;
    utils.sendMouseEventToWindow("mousemove", coord, coord, 2, 1, 0, true,
                                  1, Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE);
  }
}

function sendTouchStart() {
  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchstart" }, window);
}

function sendTouchMove() {
  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchmove" }, window);
function notifyPrecise()
{
  Services.obs.notifyObservers(null, "metro_precise_input", null);
}

function sendTouchEnd() {
  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchend" }, window);
function notifyImprecise()
{
  Services.obs.notifyObservers(null, "metro_imprecise_input", null);
}

gTests.push({
  desc: "precise/imprecise input switcher",
  setUp: setUp,
  run: function () {
    sendMouseMoves();
    notifyPrecise();
    testState("precise");
    sendTouchStart();
    notifyImprecise();
    testState("imprecise");
    sendMouseMoves();
    testState("imprecise");
    sendTouchMove();
    testState("imprecise");
    sendTouchEnd();
    testState("imprecise");
    sendMouseMoves();
    notifyPrecise();
    testState("precise");
    notifyImprecise();
    testState("imprecise");
  }
});
Loading