Bug 1357458 - After Customization - typed text in the Awesome bar doesn't correspond with the text from One-Off-Searches bar. r?florian
MozReview-Commit-ID: KHAoxS1CsWj
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -119,16 +119,22 @@ file, You can obtain one at http://mozil
this._prefs = null;
this.inputField.controllers.removeController(this._copyCutController);
this.inputField.removeEventListener("paste", this);
this.inputField.removeEventListener("mousedown", this);
this.inputField.removeEventListener("mousemove", this);
this.inputField.removeEventListener("mouseout", this);
this.inputField.removeEventListener("overflow", this);
this.inputField.removeEventListener("underflow", this);
+
+ // Null out the one-offs' popup and textbox so that it cleans up its
+ // internal state for both. Most importantly, it removes the event
+ // listeners that it added to both.
+ this.popup.oneOffSearchButtons.popup = null;
+ this.popup.oneOffSearchButtons.textbox = null;
]]></destructor>
<field name="_value">""</field>
<field name="gotResultForCurrentQuery">false</field>
<!--
This is set around HandleHenter so it can be used in handleCommand.
It is also used to track whether we must handle a delayed handleEnter,
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -1231,20 +1231,16 @@
<!-- The popup that contains the one-offs. This is required, so it should
never be null or undefined, except possibly before the one-offs are
used. -->
<property name="popup">
<getter><![CDATA[
return this._popup;
]]></getter>
<setter><![CDATA[
- if (this._popup == val) {
- return val;
- }
-
let events = [
"popupshowing",
"popuphidden",
];
if (this._popup) {
for (let event of events) {
this._popup.removeEventListener(event, this);
}
@@ -1272,19 +1268,16 @@
automatically keep the related one-offs UI up to date. Otherwise you
can leave it null/undefined, and in that case you should update the
query property manually. -->
<property name="textbox">
<getter><![CDATA[
return this._textbox;
]]></getter>
<setter><![CDATA[
- if (this._textbox == val) {
- return val;
- }
if (this._textbox) {
this._textbox.removeEventListener("input", this);
}
if (val) {
val.addEventListener("input", this);
}
return this._textbox = val;
]]></setter>