On Mon, Sep 5, 2016 at 11:42 AM, Eddy Bruel <[email protected]> wrote:
> As I’m sure you are aware, the devtools team is taking the first steps > towards building a JS debugger for Servo. > \o/ (Yes, I'm aware, still excited.) > 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? > I think this is the obvious choice for the default unit of debugging, yes. I don't think it makes too much sense to be able to pause completely independent browsing contexts that can't possibly interact with each other. That's good, because if we use multiple content processes we'll use that same boundary for what can or can't be in different processes. (Though I don't know what Service Workers do to all of this.) OTOH, it would be amazing to have the ability to also pause all workers that can possibly interact with the current browsing context, and perhaps even step them individually or all at once with the same UI. _______________________________________________ dev-servo mailing list [email protected] https://lists.mozilla.org/listinfo/dev-servo

