commit 9f62a93cb66dc40d3679792cd35be142a9bfbef8
parent 0897c305401cacf6aaf165d10985fdddeed869d7
Author: Lorenz A <me@lorenzackermann.xyz>
Date: Fri, 12 Dec 2025 09:36:01 +0000
Bug 2004282 - [devtools] Turn devtools/client/inspector/markup/views/root-container.js into an ES class. r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D276122
Diffstat:
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/devtools/client/inspector/markup/views/root-container.js b/devtools/client/inspector/markup/views/root-container.js
@@ -7,24 +7,24 @@
/**
* Dummy container node used for the root document element.
*/
-function RootContainer(markupView, node) {
- this.doc = markupView.doc;
- this.elt = this.doc.createElement("ul");
- // Root container has tree semantics for accessibility.
- this.elt.setAttribute("role", "tree");
- this.elt.setAttribute("tabindex", "0");
- this.elt.setAttribute("aria-dropeffect", "none");
- this.elt.container = this;
- this.children = this.elt;
- this.node = node;
- this.toString = () => "[root container]";
-}
-
-RootContainer.prototype = {
- hasChildren: true,
- expanded: true,
- update() {},
- destroy() {},
+class RootContainer {
+ constructor(markupView, node) {
+ this.doc = markupView.doc;
+ this.elt = this.doc.createElement("ul");
+ // Root container has tree semantics for accessibility.
+ this.elt.setAttribute("role", "tree");
+ this.elt.setAttribute("tabindex", "0");
+ this.elt.setAttribute("aria-dropeffect", "none");
+ this.elt.container = this;
+ this.children = this.elt;
+ this.node = node;
+ this.toString = () => "[root container]";
+ }
+
+ hasChildren = true;
+ expanded = true;
+ update() {}
+ destroy() {}
/**
* If the node has children, return the list of containers for all these children.
@@ -35,28 +35,28 @@ RootContainer.prototype = {
return [...this.children.children]
.filter(node => node.container)
.map(node => node.container);
- },
+ }
/**
* Set the expanded state of the container node.
*
* @param {boolean} value
*/
- setExpanded() {},
+ setExpanded() {}
/**
* Set an appropriate role of the container's children node.
*/
- setChildrenRole() {},
+ setChildrenRole() {}
/**
* Set an appropriate DOM tree depth level for a node and its subtree.
*/
- updateLevel() {},
+ updateLevel() {}
isSlotted() {
return false;
- },
-};
+ }
+}
module.exports = RootContainer;