Bug 1497599 - Only run re-initialize moz-input-box during attributeChangedCallback if the attribute actually changed;r=paolo

This is unrelated to the other changesets in the bug, just a cleanup based on
patterns that have emerged in other attributeChangedCallbacks like in progressmeter

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Grinstead 2018-10-10 17:12:01 +00:00
Родитель 565e117c8b
Коммит 17658b4fb2
1 изменённых файлов: 2 добавлений и 3 удалений

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

@ -61,18 +61,17 @@ class MozInputBox extends MozXULElement {
}
attributeChangedCallback(name, oldValue, newValue) {
if (name === "spellcheck") {
this.spellcheck = newValue;
if (name === "spellcheck" && oldValue != newValue) {
this._initUI();
}
}
connectedCallback() {
this.spellcheck = this.hasAttribute("spellcheck");
this._initUI();
}
_initUI() {
this.spellcheck = this.hasAttribute("spellcheck");
if (this.menupopup) {
this.menupopup.remove();
}