diff --git a/devtools/client/inspector/markup/views/markup-container.js b/devtools/client/inspector/markup/views/markup-container.js index a3c3d5656c3c..886fe40c4aaf 100644 --- a/devtools/client/inspector/markup/views/markup-container.js +++ b/devtools/client/inspector/markup/views/markup-container.js @@ -74,6 +74,10 @@ MarkupContainer.prototype = { // Marking the node as shown or hidden this.updateIsDisplayed(); + + if (node.isShadowRoot) { + this.markup.telemetry.scalarSet("devtools.shadowdom.shadow_root_displayed", true); + } }, buildMarkup: function() { @@ -332,6 +336,10 @@ MarkupContainer.prototype = { if (this.showExpander) { this.tagLine.setAttribute("aria-expanded", this.expanded); } + + if (this.node.isShadowRoot) { + this.markup.telemetry.scalarSet("devtools.shadowdom.shadow_root_expanded", true); + } }, /** diff --git a/devtools/client/inspector/markup/views/slotted-node-container.js b/devtools/client/inspector/markup/views/slotted-node-container.js index bdd2a8033c1f..26db9e63b323 100644 --- a/devtools/client/inspector/markup/views/slotted-node-container.js +++ b/devtools/client/inspector/markup/views/slotted-node-container.js @@ -39,9 +39,9 @@ SlottedNodeContainer.prototype = extend(MarkupContainer.prototype, { return; } - this.markup.inspector.selection.setNodeFront(this.node, { - reason: "reveal-from-slot" - }); + const reason = "reveal-from-slot"; + this.markup.inspector.selection.setNodeFront(this.node, { reason }); + this.markup.telemetry.scalarSet("devtools.shadowdom.reveal_link_clicked", true); }, isDraggable: function() { diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml index 08d299c09c45..ae26e8c45346 100644 --- a/toolkit/components/telemetry/Scalars.yaml +++ b/toolkit/components/telemetry/Scalars.yaml @@ -948,6 +948,50 @@ devtools.inspector: record_in_processes: - 'main' +devtools.shadowdom: + shadow_root_displayed: + bug_numbers: + - 1470128 + description: > + Whether the markup view displayed any #shadow-root element in the UI. + expires: "66" + kind: boolean + notification_emails: + - dev-developer-tools@lists.mozilla.org + - jdescottes@mozilla.com + release_channel_collection: opt-out + record_in_processes: + - 'main' + + shadow_root_expanded: + bug_numbers: + - 1470128 + description: > + Whether the user expanded any #shadow-root element. + expires: "66" + kind: boolean + notification_emails: + - dev-developer-tools@lists.mozilla.org + - jdescottes@mozilla.com + release_channel_collection: opt-out + record_in_processes: + - 'main' + + reveal_link_clicked: + bug_numbers: + - 1470128 + description: > + Whether the user clicked on any "reveal" link. "reveal" links are displayed in + shadow dom trees in the markup view. + expires: "66" + kind: boolean + notification_emails: + - dev-developer-tools@lists.mozilla.org + - jdescottes@mozilla.com + release_channel_collection: opt-out + record_in_processes: + - 'main' + devtools: current_theme: bug_numbers: