Bug 1500080 - UrlbarInput::value getter should return the untrimmed value. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D9088

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2018-10-19 11:36:40 +00:00
Родитель 7c665c8ac4
Коммит 87a039786e
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -52,6 +52,7 @@ class UrlbarInput {
this.valueIsTyped = false; this.valueIsTyped = false;
this.userInitiatedFocus = false; this.userInitiatedFocus = false;
this.isPrivate = PrivateBrowsingUtils.isWindowPrivate(this.window); this.isPrivate = PrivateBrowsingUtils.isWindowPrivate(this.window);
this._untrimmedValue = "";
// Forward textbox methods and properties. // Forward textbox methods and properties.
const METHODS = ["addEventListener", "removeEventListener", const METHODS = ["addEventListener", "removeEventListener",
@ -245,10 +246,12 @@ class UrlbarInput {
} }
get value() { get value() {
return this.inputField.value; return this._untrimmedValue;
} }
set value(val) { set value(val) {
this._untrimmedValue = val;
val = this.trimValue(val); val = this.trimValue(val);
this.valueIsTyped = false; this.valueIsTyped = false;
@ -427,11 +430,14 @@ class UrlbarInput {
} }
_on_input(event) { _on_input(event) {
let value = event.target.value;
this.valueIsTyped = true; this.valueIsTyped = true;
this._untrimmedValue = value;
this.window.gBrowser.userTypedValue = value;
// XXX Fill in lastKey, and add anything else we need. // XXX Fill in lastKey, and add anything else we need.
this.controller.startQuery(new QueryContext({ this.controller.startQuery(new QueryContext({
searchString: event.target.value, searchString: value,
lastKey: "", lastKey: "",
maxResults: UrlbarPrefs.get("maxRichResults"), maxResults: UrlbarPrefs.get("maxRichResults"),
isPrivate: this.isPrivate, isPrivate: this.isPrivate,