commit 1477feb9706f4ccc5bd571c1c215832a6fbb7464
parent f5e10c041cc3a8ec5577990a415870a35f8508af
Author: Lorenz A <me@lorenzackermann.xyz>
Date: Fri, 12 Dec 2025 12:58:12 +0000
Bug 2004280 - [devtools] Turn devtools/client/inspector/markup/views/slotted-node-editor.js into an ES class. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D276124
Diffstat:
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/devtools/client/inspector/markup/views/slotted-node-editor.js b/devtools/client/inspector/markup/views/slotted-node-editor.js
@@ -9,17 +9,16 @@ const INSPECTOR_L10N = new LocalizationHelper(
"devtools/client/locales/inspector.properties"
);
-function SlottedNodeEditor(container, node) {
- this.container = container;
- this.markup = this.container.markup;
- this.buildMarkup();
- this.tag.textContent = "<" + node.nodeName.toLowerCase() + ">";
-
- // Make the "tag" part of this editor focusable.
- this.tag.setAttribute("tabindex", "-1");
-}
-
-SlottedNodeEditor.prototype = {
+class SlottedNodeEditor {
+ constructor(container, node) {
+ this.container = container;
+ this.markup = this.container.markup;
+ this.buildMarkup();
+ this.tag.textContent = "<" + node.nodeName.toLowerCase() + ">";
+
+ // Make the "tag" part of this editor focusable.
+ this.tag.setAttribute("tabindex", "-1");
+ }
buildMarkup() {
const doc = this.markup.doc;
@@ -38,7 +37,7 @@ SlottedNodeEditor.prototype = {
);
this.revealLink.classList.add("reveal-link");
this.elt.appendChild(this.revealLink);
- },
+ }
destroy() {
// We might be already destroyed.
@@ -50,14 +49,14 @@ SlottedNodeEditor.prototype = {
this.elt = null;
this.tag = null;
this.revealLink = null;
- },
+ }
/**
* Stub method for consistency with ElementEditor.
*/
getInfoAtNode() {
return null;
- },
-};
+ }
+}
module.exports = SlottedNodeEditor;