diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /devtools/client/webconsole/components/Output/message-types/JSTracerTrace.js | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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) { |