As I’m sure you are aware, the devtools team is taking the first steps towards building a JS debugger for Servo.
One of the first questions one needs to answer when building a JS debugger is: what should happen when the debugger is paused? In Gecko, we have a separate debugger for each tab, so the obvious answer is that the tab should pause. However, a tab can also contain iframes. Should pausing a tab also pause all the iframes in that tab? In Gecko, this is the default behaviour. However, we can also target the debugger to a specific iframe, in which cause pausing the debugger only pauses that iframe. (of course, iframes can also contain sub-iframes; I am not sure if those are also included when the debugger is targeted to a specific frame). Things become even more complicated when you add workers to the mix: should pausing a tab also pause all dedicated workers in that tab? What about shared workers? In Gecko, pausing a tab currently does not pause the workers in that tab. More generally, tabs, iframes, workers, etc. all make up a set of browsing contexts. The question then becomes: what set of browsing contexts should be the unit of debugging? Or put differently: what set of browsing contexts should be under control of the debugger, so that pausing the debugger pauses every browsing context in that set? As pointed out to me by Ms2ger, the HTML standard defines the notion of a unit of related browsing contexts: https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-browsing-contexts My understanding is that the goal for Servo is to have a single thread for each unit of related browsing contexts. This seems to make unit of related browsing contexts the natural choice as the unit of debugging as well. Does this sound reasonable to everyone? _______________________________________________ dev-servo mailing list [email protected] https://lists.mozilla.org/listinfo/dev-servo

