Skip to content

Split kitchen-sink "dom channel" into finer-grained channels #503

Closed

Description

@jdm

Gecko suffers from a catch-all event loop that cause spec compatibility issues (such as web-visible things like alert and sync XHR spinning up nested event loops). We can avoid this in Servo by providing multiple channels to the script task that the event loop will prioritize in some fashion when polling for an event to handle. We will also require the ability to freeze individual channels, to enable things like sync XHR blocking page-visible events (similarly, alert should block page-visible changes but not block the user from interacting with the dialog). With separate channels, we can also investigate prioritization of certain types of events over others, such as user input over setTimeout. The easiest selection algorithm to start with is likely round-robin, of course.

Activity

  1. kmcallister commented on Mar 11, 2014

    @kmcallister
    Contributor

    Cool. We could implement a channel type that supports priority and blocking in a generic way; that would keep some of the mechanics of this out of the script task core.

  2. added a commit that references this issue on Sep 7, 2014
  3. jdm commented on Feb 4, 2015

    @jdm
    MemberAuthor

    This is an important step to enable synchronous, blocking operations that require nested events loops (sync XHR, alert, etc.) in order for the browser to remain responsive. See https://groups.google.com/forum/#!topic/mozilla.dev.servo/unG9GxZnpcU for more information.

  4. jdm commented on Feb 4, 2015

    @jdm
    MemberAuthor

    Additionally, I think we're going to have to write our networking consumer code to always process events by enqueuing a runnable, otherwise we'll break the illusion that nested event loops are supposed to provide.

  5. jdm commented on Feb 5, 2015

    @jdm
    MemberAuthor

    I envision having the following:

    • a channel for events from Constellation/Compositor
    • a channel for devtools communication
    • one channel per HTML5 task source (DOM manipulation, user interaction, networking, timers, history traversal, etc.)

    We should add APIs for dispatching events to each of these sources as necessary, rather than have users send messages directly on the Sender object.

  6. nox commented on Oct 10, 2015

    @nox
    Contributor

    @jdm Ain't that done already?

  7. jdm commented on Oct 10, 2015

    @jdm
    MemberAuthor

    I suppose it is. I'll file a separate issue specifically for HTML5 task sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domB-interesting-projectI-refactorI-wrong

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions