Bug 1680218 - [devtools] Remove handling of old markup mutations. r=rcaliman.

frameLoad and documentUnload aren't emitted anymore (since 81),
so we can remove the code that was handling them.

Differential Revision: https://phabricator.services.mozilla.com/D98495
This commit is contained in:
Nicolas Chevobbe 2020-12-09 06:25:07 +00:00
Родитель 882badf682
Коммит a2b70b69db
2 изменённых файлов: 2 добавлений и 48 удалений

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

@ -12,12 +12,6 @@ const {
const { walkerSpec } = require("devtools/shared/specs/walker");
const { safeAsyncMethod } = require("devtools/shared/async-utils");
loader.lazyRequireGetter(
this,
"nodeConstants",
"devtools/shared/dom-node-constants"
);
/**
* Client side of the DOM walker.
*/
@ -328,33 +322,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
if ("numChildren" in change) {
targetFront._form.numChildren = change.numChildren;
}
} else if (change.type === "frameLoad") {
// @backward-compat { version 81 } The frameLoad mutation was removed in favor
// of the root-node resource.
// Nothing we need to do here, except verify that we don't have any
// document children, because we should have gotten a documentUnload
// first.
for (const child of targetFront.treeChildren()) {
if (child.nodeType === nodeConstants.DOCUMENT_NODE) {
console.warn(
"Got an unexpected frameLoad in the inspector, " +
"please file a bug on bugzilla.mozilla.org!"
);
console.trace();
}
}
} else if (change.type === "documentUnload") {
// @backward-compat { version 81 } The documentUnload mutation was removed in
// favor of the root-node resource.
// We try to give fronts instead of actorIDs, but these fronts need
// to be destroyed now.
emittedMutation.target = targetFront.actorID;
emittedMutation.targetParent = targetFront.parentNode();
// Release the document node and all of its children, even retained.
this._releaseFront(targetFront, true);
} else if (change.type === "shadowRootAttached") {
targetFront._form.isShadowHost = true;
} else if (change.type === "customElementDefined") {

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

@ -1407,21 +1407,8 @@ MarkupView.prototype = {
*/
_onWalkerMutations: function(mutations) {
for (const mutation of mutations) {
let type = mutation.type;
let target = mutation.target;
if (mutation.type === "documentUnload") {
// @backward-compat { version 81 } The documentUnload mutation was removed in
// favor of the root-node resource.
// Treat this as a childList change of the child (maybe the protocol
// should do this).
type = "childList";
target = mutation.targetParent;
if (!target) {
continue;
}
}
const type = mutation.type;
const target = mutation.target;
const container = this.getContainer(target);
if (!container) {