Backout Bug 1279771 due to linux test failures
authorMichael Layzell <michael@thelayzells.com>
Tue, 05 Jul 2016 13:48:21 -0400
changeset 303716 c676d55b6b006a2edb37c7c29c64e69f7cb8012a
parent 303715 6172a55a6ae8611317b89f18ca47f785df4ab877
child 303717 279d7b204e96ae99bd010a730930310d174eaf32
child 303756 a22de7d60df7690ea67b4b7573af8f0602c422b1
push id79149
push usermichael@thelayzells.com
push dateTue, 05 Jul 2016 17:48:56 +0000
treeherdermozilla-inbound@c676d55b6b00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1279771
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout Bug 1279771 due to linux test failures
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/tests/mochitest/general/file_bug1279771_chromeScript.js
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/general/test_bug1279771.html
toolkit/modules/SelectContentHelper.jsm
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3991,30 +3991,16 @@ nsDOMWindowUtils::SetNextPaintSyncId(int
 NS_IMETHODIMP
 nsDOMWindowUtils::RespectDisplayPortSuppression(bool aEnabled)
 {
   nsCOMPtr<nsIPresShell> shell(GetPresShell());
   APZCCallbackHelper::RespectDisplayPortSuppression(aEnabled, shell);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsDOMWindowUtils::StartHandlingUserInput()
-{
-  EventStateManager::StartHandlingUserInput();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMWindowUtils::StopHandlingUserInput()
-{
-  EventStateManager::StopHandlingUserInput();
-  return NS_OK;
-}
-
 NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(nsTranslationNodeList)
 NS_IMPL_RELEASE(nsTranslationNodeList)
 
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1911,29 +1911,16 @@ interface nsIDOMWindowUtils : nsISupport
 
   /**
    * Enable or disable displayport suppression. This is intended to be used by
    * testing code, to provide more deterministic behaviour over the displayport
    * suppression during tests. Note that this updates a flag, so whatever value
    * was last provided is what will be used.
    */
   void respectDisplayPortSuppression(in boolean aEnabled);
-
-  /**
-   * Start treating code as running within a user-initiated event callback. Must
-   * be matched by a call to stopHandlingUserInput.
-   */
-  void startHandlingUserInput();
-
-  /**
-   * Stop treating code as running within a user-initiated event callback. Must
-   * be matched by a call to startHandlingUserInput.
-   */
-  void stopHandlingUserInput();
-
 };
 
 [scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]
 interface nsITranslationNodeList : nsISupports {
   readonly attribute unsigned long length;
   nsIDOMNode item(in unsigned long index);
 
   // A translation root is a block element, or an inline element
deleted file mode 100644
--- a/dom/tests/mochitest/general/file_bug1279771_chromeScript.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-// Define these to make EventUtils happy.
-let window = this;
-let parent = {};
-
-let EventUtils = {};
-Services.scriptloader.loadSubScript(
-  "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
-  EventUtils
-);
-
-let label = browserElement.ownerDocument.getElementById(browserElement.getAttribute('selectmenulist')).querySelector("[label=B]");
-EventUtils.synthesizeMouseAtCenter(label, {}, browserElement.ownerDocument.defaultView);
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -136,10 +136,8 @@ skip-if = buildapp == 'b2g' # Bug 118442
 [test_storagePermissionsLimitForeign.html]
 skip-if = buildapp == 'b2g' # Bug 1184427 - no SSL certs on b2g
 [test_selectevents.html]
 skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' # Mouse doesn't select in the same way
 # Disabled on Android, see bug 1230232
 [test_WebKitCSSMatrix.html]
 [test_resource_timing_frameset.html]
 [test_bug1208217.html]
-[test_bug1279771.html]
-support-files = file_bug1279771_chromeScript.js
deleted file mode 100644
--- a/dom/tests/mochitest/general/test_bug1279771.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1279771
--->
-<head>
-  <title>Test for Bug 1279771</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
-  <script src="/tests/SimpleTest/SpawnTask.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-  <select id="select">
-    <option>A</option>
-    <option>B</option>
-    <option>C</option>
-  </select>
-
-<pre id="test">
-  <script type="application/javascript">
-    add_task(function* (){
-      var select = document.querySelector("#select");
-      let done = new Promise(resolve => {
-        select.addEventListener('change',  function() {
-          ok(document.execCommand("copy"), "The copy command is allowed to be executed from this callback");
-          resolve();
-        });
-      })
-
-      // Spin the event loop once so that synthesizeMouseAtCenter works...
-      yield new Promise(resolve => SimpleTest.executeSoon(resolve));
-      synthesizeMouseAtCenter(select, {});
-
-      // Run the chrome script which will close the selectmenulist, firing a change event
-      SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL("file_bug1279771_chromeScript.js"));
-      yield done;
-    });
-  </script>
-</pre>
-</body>
-</html>
--- a/toolkit/modules/SelectContentHelper.jsm
+++ b/toolkit/modules/SelectContentHelper.jsm
@@ -109,46 +109,39 @@ this.SelectContentHelper.prototype = {
     switch (message.name) {
       case "Forms:SelectDropDownItem":
         this.element.selectedIndex = message.data.value;
         break;
 
       case "Forms:DismissedDropDown":
         if (this.initialSelection != this.element.item(this.element.selectedIndex)) {
           let win = this.element.ownerDocument.defaultView;
-          let dwu = win.QueryInterface(Ci.nsIInterfaceRequestor)
-                       .getInterface(Ci.nsIDOMWindowUtils);
-          dwu.startHandlingUserInput();
-          try {
-            let inputEvent = new win.UIEvent("input", {
-              bubbles: true,
-            });
-            this.element.dispatchEvent(inputEvent);
+          let inputEvent = new win.UIEvent("input", {
+            bubbles: true,
+          });
+          this.element.dispatchEvent(inputEvent);
 
-            let changeEvent = new win.Event("change", {
-              bubbles: true,
-            });
-            this.element.dispatchEvent(changeEvent);
+          let changeEvent = new win.Event("change", {
+            bubbles: true,
+          });
+          this.element.dispatchEvent(changeEvent);
 
-            // Going for mostly-Blink parity here, which (at least on Windows)
-            // fires a mouseup and click event after each selection -
-            // even by keyboard. We're firing a mousedown too, since that
-            // seems to make more sense. Unfortunately, the spec on form
-            // control behaviours for these events is really not clear.
-            const MOUSE_EVENTS = ["mousedown", "mouseup", "click"];
-            for (let eventName of MOUSE_EVENTS) {
-              let mouseEvent = new win.MouseEvent(eventName, {
-                view: win,
-                bubbles: true,
-                cancelable: true,
-              });
-              this.element.dispatchEvent(mouseEvent);
-            }
-          } finally {
-            dwu.stopHandlingUserInput();
+          // Going for mostly-Blink parity here, which (at least on Windows)
+          // fires a mouseup and click event after each selection -
+          // even by keyboard. We're firing a mousedown too, since that
+          // seems to make more sense. Unfortunately, the spec on form
+          // control behaviours for these events is really not clear.
+          const MOUSE_EVENTS = ["mousedown", "mouseup", "click"];
+          for (let eventName of MOUSE_EVENTS) {
+            let mouseEvent = new win.MouseEvent(eventName, {
+              view: win,
+              bubbles: true,
+              cancelable: true,
+            });
+            this.element.dispatchEvent(mouseEvent);
           }
         }
 
         this.uninit();
         break;
 
       case "Forms:MouseOver":
         DOMUtils.setContentState(this.element, kStateHover);