зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
565e117c8b
Коммит
17658b4fb2
|
@ -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();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче