Backed out changeset baea1f6031e8 (bug 1300996)
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 08 Jun 2017 19:54:53 +0800
changeset 411085 f6e748977f2ef182c591859e0c5d0af5d9d60393
parent 411084 44a4b6a5219e4bc4067330f64f28807d5401161c
child 411086 9819afb3f5235e4bd32a960c57795f2ecb5f4258
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1300996
milestone55.0a1
backs outbaea1f6031e8c57e5f899223e992a56bdd21c30a
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
Backed out changeset baea1f6031e8 (bug 1300996) MozReview-Commit-ID: Cj9pE4QZfvI
browser/extensions/formautofill/content/formautofill.xml
toolkit/components/satchel/test/browser/browser.ini
toolkit/components/satchel/test/browser/browser_popup_mouseover.js
toolkit/content/widgets/autocomplete.xml
toolkit/content/widgets/richlistbox.xml
--- a/browser/extensions/formautofill/content/formautofill.xml
+++ b/browser/extensions/formautofill/content/formautofill.xml
@@ -22,22 +22,16 @@
         </div>
         <div class="profile-comment-col profile-item-col">
           <span anonid="profile-comment" class="profile-comment"></span>
         </div>
       </div>
     </xbl:content>
 
     <implementation implements="nsIDOMXULSelectControlItemElement">
-      <!-- For form autofill, we want to unify the selection no matter by
-      keyboard navigation or mouseover in order not to confuse user which
-      profile preview is being shown. This field is set to true to indicate
-      that selectedIndex of popup should be changed while mouseover item -->
-      <field name="selectedByMouseOver">true</field>
-
       <constructor>
         <![CDATA[
           this._itemBox = document.getAnonymousElementByAttribute(
             this, "anonid", "profile-item-box"
           );
           this._label = document.getAnonymousElementByAttribute(
             this, "anonid", "profile-label"
           );
--- a/toolkit/components/satchel/test/browser/browser.ini
+++ b/toolkit/components/satchel/test/browser/browser.ini
@@ -1,6 +1,5 @@
 [DEFAULT]
 support-files =
   !/toolkit/components/satchel/test/subtst_privbrowsing.html
 
-[browser_popup_mouseover.js]
 [browser_privbrowsing_perwindowpb.js]
deleted file mode 100644
--- a/toolkit/components/satchel/test/browser/browser_popup_mouseover.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const {FormHistory} = Cu.import("resource://gre/modules/FormHistory.jsm", {});
-
-
-add_task(async function test() {
-  const url = `data:text/html,<input type="text" name="field1">`;
-  await BrowserTestUtils.withNewTab({gBrowser, url}, async function(browser) {
-    const {autoCompletePopup, autoCompletePopup: {richlistbox: itemsBox}} = browser;
-    const mockHistory = [
-      {op: "add", fieldname: "field1", value: "value1"},
-      {op: "add", fieldname: "field1", value: "value2"},
-      {op: "add", fieldname: "field1", value: "value3"},
-      {op: "add", fieldname: "field1", value: "value4"},
-    ];
-
-    await new Promise(resolve => FormHistory.update([{op: "remove"}, ...mockHistory], {handleCompletion: resolve}));
-    await ContentTask.spawn(browser, {}, async function() {
-      const input = content.document.querySelector("input");
-
-      input.focus();
-    });
-
-    // show popup
-    await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
-    await BrowserTestUtils.waitForCondition(() => {
-      return autoCompletePopup.popupOpen;
-    });
-    const listItemElems = itemsBox.querySelectorAll(".autocomplete-richlistitem");
-    is(listItemElems.length, mockHistory.length, "ensure result length");
-    is(itemsBox.mousedOverIndex, -1, "mousedOverIndex should be -1");
-
-    // navigate to the firt item
-    await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
-    is(autoCompletePopup.selectedIndex, 0, "selectedIndex should be 0");
-
-    // mouseover the second item
-    EventUtils.synthesizeMouseAtCenter(listItemElems[1], {type: "mouseover"});
-    await BrowserTestUtils.waitForCondition(() => {
-      return itemsBox.mousedOverIndex = 1;
-    });
-    ok(true, "mousedOverIndex changed");
-    is(autoCompletePopup.selectedIndex, 0, "selectedIndex should not be changed by mouseover");
-
-    // close popup
-    await ContentTask.spawn(browser, {}, async function() {
-      const input = content.document.querySelector("input");
-
-      input.blur();
-    });
-  });
-});
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -2585,24 +2585,17 @@ extends="chrome://global/content/binding
         while (item && item.localName != "richlistitem") {
           item = item.parentNode;
         }
 
         if (!item) {
           return;
         }
 
-        let index = this.getIndexOfItem(item);
-
-        this.mousedOverIndex = index;
-
-        if (item.selectedByMouseOver) {
-          this.selectedIndex = index;
-        }
-
+        this.mousedOverIndex = this.getIndexOfItem(item);
         this.mLastMoveTime = Date.now();
       ]]>
       </handler>
     </handlers>
   </binding>
 
   <binding id="autocomplete-treebody">
     <implementation>
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -529,18 +529,16 @@
       <children/>
     </content>
 
     <resources>
       <stylesheet src="chrome://global/skin/richlistbox.css"/>
     </resources>
 
     <implementation>
-      <field name="selectedByMouseOver">false</field>
-
       <destructor>
         <![CDATA[
           var control = this.control;
           if (!control)
             return;
           // When we are destructed and we are current or selected, unselect ourselves
           // so that richlistbox's selection doesn't point to something not in the DOM.
           // We don't want to reset last-selected, so we set _suppressOnSelect.