Open Bug 1960905 Opened 11 months ago Updated 10 months ago

Logging Request Animation Frame (and other non actual event **listeners**) from Event Listener Breakpoints could be more helpful

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

Details

Steps to reproduce

  1. Navigate to https://nchevobbe.github.io/demo/console-test-app.html
  2. Open the debugger
  3. In the event listeners breakpoints panel, check "Request Animation Frame"
  4. Check the "Log" checkbox in the header
  5. Open the split console
  6. On the page, click on the console.log button

Expected results

In the console, I can see useful logs for each time requestAnimationFrame was called

Actual results

I do see some logs, but they only show a Number, without any other label. I guess this is the requestAnimationFrame return value, but it would be nice to actually see requestAnimationFrame 2601102.92 , or maybe the reference to the callback function?


This is because in https://searchfox.org/mozilla-central/rev/08b2a1a770688df19a5a43fd89fb63b34bb2d6a6/devtools/server/actors/thread.js#902-908

return logEvent({
  threadActor: this,
  frame,
  level: "logPoint",
  expression: `[_event]`,
  bindings: { _event: frame.arguments[0] },
});

We assume that we have an event, which is not the case here.
There's probably similar issue with other events breakpoints which are not actually event listeners breakpoint (e.g. cancel animation frame, script first statement, …)

The minimum is to add a label showing why the log was created (eg RequestAnimationFrame).

We can file a follow up to log more information if we have additional details we can consistently log here.

Severity: -- → S3
Priority: -- → P3
See Also: → 1965743
You need to log in before you can comment on or make changes to this bug.