Skip to content

Implement HTML5 task sources #7959

Closed
Closed

Description

@jdm

Currently there's a generic script event loop sender for all non-specialized script events (ie. those that do not come from devtools, constellation, etc.) Like #503 we should add additional senders for each task source the spec defines and provide convenient APIs to allow people implementing DOM specs to do the right thing.

Note that this will likely be more complex than the generic select mechanism we currently use in the script event loop, due to ordering concerns about queued events in multiple task sources.

Activity

  1. added
    B-interesting-project
    A-content/script
    on Oct 10, 2015
  2. jdm commented on Oct 10, 2015

    @jdm
    MemberAuthor

    https://html.spec.whatwg.org/multipage/webappapis.html#generic-task-sources
    Then again, the spec says:
    "Select the oldest task on one of the event loop's task queues, if any, ignoring, in the case of a browsing context event loop, tasks whose associated Documents are not fully active. The user agent may pick any task queue."
    Which suggests that only ordering inside of any given queue matters.

  3. self-assigned this
    on Dec 4, 2015
  4. KiChjang commented on Dec 4, 2015

    @KiChjang
    Contributor

    Sounds interesting, I'm taking a look into this.

  5. jdm commented on Dec 4, 2015

    @jdm
    MemberAuthor

    This would be super valuable!

  6. jdm commented on Dec 4, 2015

    @jdm
    MemberAuthor

    I recommend we start by defining methods on Window/ScriptTask/GlobalRef for specific task sources (DOM, network, user input, etc.) and making them return the existing script channel, then finding callers of script_chan() that should be using those specific task sources and having them call the methods to get their channel.

  7. KiChjang commented on Dec 4, 2015

    @KiChjang
    Contributor

    Yes, that sounds like a good first PR with a lot of elbow-grease.

    After that, I was thinking that we may want to create new message enums (similar to the style for the constellation) for each individual task source. Does that sound good to you?

  8. jdm commented on Dec 4, 2015

    @jdm
    MemberAuthor

    Yep!

  9. added
    C-assigned
    on Dec 5, 2015
  10. added 3 commits that reference this issue on Dec 5, 2015
  11. added a commit that references this issue on Jan 1, 2016
  12. added a commit that references this issue on Mar 10, 2016
  13. added 2 commits that reference this issue on May 11, 2016
  14. added a commit that references this issue on Jul 14, 2016
  15. KiChjang commented on Dec 11, 2016

    @KiChjang
    Contributor

    I think this is essentially done except for HistoryTraversalTaskSource (which is still currently a stub using the ScriptChan trait) which is tracked in #10994 and other various small task sources littered around the spec.

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

Metadata

Metadata

Assignees

Labels

A-content/scriptB-interesting-projectC-assigned

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions