This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21632 - Clarify the relationship between task sources and event loops
Summary: Clarify the relationship between task sources and event loops
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-08 21:33 UTC by Michael Dyck
Modified: 2013-06-18 23:44 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Dyck 2013-04-08 21:33:36 UTC
Can two different event loops both have tasks from the same task source?

The definition of task source says:
     All the tasks from one particular task source ... must always be added
     to the same task queue ...
which implies that the answer is no, since that task queue can only belong to one event loop. (At least, I assume it can't be shared.)

But I'm wondering if that definition should be interpreted as "within the context of a particular event loop", in which case the answer would be yes.

Either way, the spec should probably be clearer.
Comment 1 Ian 'Hixie' Hickson 2013-05-30 22:21:04 UTC
I've tried updating the text. How is it now?
Comment 2 contributor 2013-05-30 22:22:13 UTC
Checked in as WHATWG revision r7874.
Check-in comment: Try to clarify event loop terminology.
http://html5.org/tools/web-apps-tracker?from=7873&to=7874
Comment 3 Michael Dyck 2013-05-31 01:58:15 UTC
Much clearer now.


However, the new sentence:
    A task is intended for a specific event loop: the event loop
    that is handling tasks for the task's associated Document.
implies that, for any given document, there is exactly one associated
event loop (handling tasks for that document), but I'm not sure that's
established anywhere. (E.g., what's the event loop for a document that
doesn't have a browsing context? What prevents a document from having
multiple associated event loops?)


(Also, in the phrase:
    but tasks from different task sources may be placed in different task queues.
the word "tasks" is marked up thusly:
    <span concept-task="" title="title=">tasks</span>
which I'm guessing should be:
    <a href=#concept-task title=concept-task>task</a>
)
Comment 4 Ian 'Hixie' Hickson 2013-06-12 18:13:28 UTC
> However, the new sentence:
>
>     A task is intended for a specific event loop: the event loop
>     that is handling tasks for the task's associated Document.
>
> implies that, for any given document, there is exactly one associated
> event loop (handling tasks for that document), but I'm not sure that's
> established anywhere. (E.g., what's the event loop for a document that
> doesn't have a browsing context? What prevents a document from having
> multiple associated event loops?)

It's established (near the definition of "event loop") that "there must be [...] at most one event loop per unit of related similar-origin browsing contexts", and I don't think it's possible for a Document, even one without a browsing context, to span multiple units of related similar-origin browsing contexts.

Is that convincing enough?
Comment 5 Ian 'Hixie' Hickson 2013-06-18 23:44:32 UTC
Michael Dyck: I'm going to assume it is; please don't hesitate to reopen the bug if you disagree! Thanks!