Open Bug 1968387 Opened 5 months ago Updated 2 days ago

Figure out if we want to partially pause rendering for devtools debugger

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: emilio, Unassigned)

References

(Blocks 1 open bug)

Details

As of right now, rendering and such is completely paused on DevTools, including painting. Bug 1967931 will undo this allowing DevTools to run the rendering loop.

This causes a regression in a test that expected scroll events to be paused (from bug 1044074).

We should decide if we want to break the spec rendering loop model for a document paused by the DevTools debugger. i.e., of all these phases, do we want to make DevTools do some but not others? That'd be a bit weird, but...

Summary: Figure out if we want to partially pause rendering for devtoos debugger → Figure out if we want to partially pause rendering for devtools debugger

Chrome actually pauses all the following listeners, whereas Firefox doesn't:

  • requestAnimationFrame: data:text/html,<script>requestAnimationFrame(() => console.log("rAF"));debugger; </script>
  • scroll: data:text/html,<div style="height:100000px"></div><script>window.onscroll=()=>{console.log("scroll")};debugger</script>
  • resize: data:text/html,<script>window.onresize = () => console.log("resize");debugger; </script>
  • media query listener: data:text/html,<script>window.matchMedia("(width < 800px)").addEventListener("change", ()=>console.log("MQL")); debugger;</script>
  • ResizeObserver: data:text/html,<script>window.onload=()=>{new ResizeObserver(() => console.log("resize observer")).observe(document.body); debugger;}</script><body></body>
  • IntersectionObserver: data:text/html,<script>window.onload=()=>{new IntersectionObserver(() => console.log("intersection observer")).observe(document.body); debugger;}</script><body></body>
    Each individual of these examples could be an independent bug blocking meta bug 1074448.
    We should be pausing them all. No JavaScript code from the web page should run once the debugger paused.
    I don't think we want any exception to this rule. This can lead to very frustrating debugging experience.

There is one exception to this in Chrome: CSS Animations.
The following example highlights that animationiteration listeners run while paused:
https://bug1513727.bmoattachments.org/attachment.cgi?id=9030936
(Same behavior on Firefox)
I agree with Bryan on bug 1513727, this is a run-to-completion bug, and the listener should not be called while paused.
I tried searching on chromium issues, but couldn't find any ticket related to pausing animations (but I may not be good at using their bug tracker)
But to me it sounds like a miss rather than a feature.

Having said that, DevTools should still be able to modify the page while being paused, as listed in bug 1967931 comment 16.
Would that be enough to keep running Paint and Layout?
Fixing all these run to completion bugs all at once would be a significant improvement for Firefox debugging experience!

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