Bug 1492516 - Delete badge properties when removing badge element from the DOM;r=gl

This commit is contained in:
Julian Descottes 2018-09-19 18:52:04 +02:00
Родитель 85dcd1534f
Коммит 5f4566daa5
2 изменённых файлов: 20 добавлений и 0 удалений

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

@ -45,6 +45,23 @@ const TEST_DATA = [
visible: false
}
},
{
desc: "Reusing the 'grid' node, updating the display to 'grid again",
selector: "#grid",
before: {
visible: false
},
changeStyle: async function(testActor) {
await testActor.eval(`
let node = document.getElementById("grid");
node.style.display = "grid";
`);
},
after: {
textContent: "grid",
visible: true
}
},
{
desc: "Showing a 'grid' node by changing its style property",
selector: "#block",

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

@ -282,6 +282,7 @@ ElementEditor.prototype = {
const showEventBadge = this.node.hasEventListeners;
if (this._eventBadge && !showEventBadge) {
this._eventBadge.remove();
this._eventBadge = null;
} else if (showEventBadge && !this._eventBadge) {
this._createEventBadge();
}
@ -304,6 +305,7 @@ ElementEditor.prototype = {
const showDisplayBadge = this.node.displayType in DISPLAY_TYPES;
if (this._displayBadge && !showDisplayBadge) {
this._displayBadge.remove();
this._displayBadge = null;
} else if (showDisplayBadge) {
if (!this._displayBadge) {
this._createDisplayBadge();
@ -339,6 +341,7 @@ ElementEditor.prototype = {
const showCustomBadge = !!this.node.customElementLocation;
if (this._customBadge && !showCustomBadge) {
this._customBadge.remove();
this._customBadge = null;
} else if (!this._customBadge && showCustomBadge) {
this._createCustomBadge();
}