author | Marco Bonardo <mbonardo@mozilla.com> |
Wed, 07 Jun 2017 11:35:30 +0200 | |
changeset 362941 | a9e45f56795b5c5cc64da28b64fdf72d45b8cce0 |
parent 362940 | 47f43b453c2d66958de80486d851ea85d31c0756 |
child 362942 | 189df493159bb85b1bfe566ce609ceb0ed254c43 |
push id | 44335 |
push user | mak77@bonardo.net |
push date | Thu, 08 Jun 2017 13:09:25 +0000 |
treeherder | autoland@a9e45f56795b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | past |
bugs | 1368470 |
milestone | 55.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
|
--- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -1850,17 +1850,24 @@ file, You can obtain one at http://mozil // Reset the alignment so that the site icons are positioned // according to whatever's in the CSS. this.siteIconStart = undefined; } try { let whichNotification = aInput.whichSearchSuggestionsNotification; if (whichNotification != "none") { - aInput.updateSearchSuggestionsNotificationImpressions(whichNotification); + // Update the impressions count on real popupshown, since there's + // no guarantee openPopup will be respected by the platform. + // Though, we must ensure the handled event is the expected one. + let impressionId = this._searchSuggestionsImpressionId = {}; + this.addEventListener("popupshown", () => { + if (this._searchSuggestionsImpressionId == impressionId) + aInput.updateSearchSuggestionsNotificationImpressions(whichNotification); + }, {once: true}); this._showSearchSuggestionsNotification(whichNotification, popupDirection); } else if (this.classList.contains("showSearchSuggestionsNotification")) { this._hideSearchSuggestionsNotification(); } } catch (ex) { // Not critical for the urlbar functionality, just report the error. Components.utils.reportError(ex); }