diff options
Diffstat (limited to 'devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js')
-rw-r--r-- | devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js b/devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js index 7d6ddd2623..241fa15bd1 100644 --- a/devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js +++ b/devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js @@ -62,8 +62,27 @@ function JSTracerTrace(props) { relatedTraceId, // See tracer.jsm FRAME_EXIT_REASONS why, + + // Attributes specific to DOM Mutations + mutationType, + mutationElement, } = message; + let messageBodyConfig; + if (parameters || why || mutationType) { + messageBodyConfig = { + dispatch, + serviceContainer, + maybeScrollToBottom, + setExpanded, + type: "", + useQuotes: true, + + // Disable custom formatter for now in traces + customFormat: false, + }; + } + // When we are logging a DOM event, we have the `eventName` defined. let messageBody; if (eventName) { @@ -73,31 +92,27 @@ function JSTracerTrace(props) { dom.span({ className: "jstracer-io" }, "⟵ "), dom.span({ className: "jstracer-display-name" }, displayName), ]; - } else { + } else if (mutationType) { + messageBody = [ + dom.span( + { className: "jstracer-dom-mutation" }, + // Add an extra space at the end to have nice copy-paste messages + "— DOM Mutation | " + mutationType + " " + ), + formatRep(messageBodyConfig, mutationElement), + ]; + } else if (displayName) { messageBody = [ dom.span({ className: "jstracer-io" }, "⟶ "), dom.span({ className: "jstracer-implementation" }, implementation), // Add a space in order to improve copy paste rendering dom.span({ className: "jstracer-display-name" }, " " + displayName), ]; + } else { + messageBody = [dom.span({ className: "jstracer-io" }, "—")]; } - let messageBodyConfig; - if (parameters || why) { - messageBodyConfig = { - dispatch, - serviceContainer, - maybeScrollToBottom, - setExpanded, - type: "", - useQuotes: true, - - // Disable custom formatter for now in traces - customFormat: false, - }; - } // Arguments will only be passed on-demand - if (parameters) { messageBody.push("(", ...formatReps(messageBodyConfig, parameters), ")"); } @@ -105,9 +120,11 @@ function JSTracerTrace(props) { if (why) { messageBody.push( // Add a spaces in order to improve copy paste rendering - dom.span({ className: "jstracer-exit-frame-reason" }, " " + why + " "), - formatRep(messageBodyConfig, returnedValue) + dom.span({ className: "jstracer-exit-frame-reason" }, " " + why + " ") ); + if (returnedValue !== undefined) { + messageBody.push(formatRep(messageBodyConfig, returnedValue)); + } } if (prefix) { |