Bug 1312244 - Autocomplete popup does not close when anchor clicked a second time. r=enndeakin+6102
authorMike Conley <mconley@mozilla.com>
Mon, 24 Oct 2016 11:32:10 -0400
changeset 319308 38ac5c0d5d5579c2322b538ba510b411aaa159dd
parent 319307 5eaae2fa6a52510608aa15afaa614840d8f94cac
child 319309 f7a9e4b0905510c33b214386122516819edd6349
push id30869
push userphilringnalda@gmail.com
push dateWed, 26 Oct 2016 04:57:48 +0000
treeherdermozilla-central@9471b3c49b2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1312244, 1183037
milestone52.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
Bug 1312244 - Autocomplete popup does not close when anchor clicked a second time. r=enndeakin+6102 The popuphiding / popuphidden events are fired synchronously when the popup manager decides we're doing a "rollup" (closing the popups due to "outside" events). In the case of this bug, the "outside" event is a click on the input element in content. Here's the kicker though: we handle that popuphidden event and queue a message to content _before_ the mouse event that caused the roll-up is dispatched to content. This means that browser-content.js hears that the popup closed due to popuphidden first, sets its internal state of popupClosed to true, and then the MouseDown on the input field is processed. The nsFormFillController then queries browser-content's AutoCompletePopup, sees its closed, and tells the parent to open it again. This patch adds the norolluponanchor attribute to the panel, which causes us to ignore the rollup event if it happens to be targeted within the anchor rect. This means that we need to trust content to tell us to close the autocomplete popup if the input is clicked when the popup is open (and this is what bug 1183037, which this bug depends on, does). MozReview-Commit-ID: 4A9qVfTYIUz
browser/base/content/browser.xul
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -136,17 +136,22 @@
     <menupopup id="backForwardMenu"
                onpopupshowing="return FillHistoryMenu(event.target);"
                oncommand="gotoHistoryIndex(event); event.stopPropagation();"
                onclick="checkForMiddleClick(this, event);"/>
     <tooltip id="aHTMLTooltip" page="true"/>
     <tooltip id="remoteBrowserTooltip"/>
 
     <!-- for search and content formfill/pw manager -->
-    <panel type="autocomplete-richlistbox" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
+
+    <panel type="autocomplete-richlistbox"
+           id="PopupAutoComplete"
+           noautofocus="true"
+           hidden="true"
+           norolluponanchor="true" />
 
     <!-- for search with one-off buttons -->
     <panel type="autocomplete" id="PopupSearchAutoComplete" noautofocus="true" hidden="true"/>
 
     <!-- for url bar autocomplete -->
     <panel type="autocomplete-richlistbox"
            id="PopupAutoCompleteRichResult"
            noautofocus="true"