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 28001 - Formalize rendering tasks
Summary: Formalize rendering tasks
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other All
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#run-the...
Whiteboard:
Keywords:
Depends on: 28876
Blocks: 26440
  Show dependency treegraph
 
Reported: 2015-02-12 10:11 UTC by contributor
Modified: 2017-05-04 10:07 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2015-02-12 10:11:06 UTC
Specification: https://html.spec.whatwg.org/multipage/webappapis.html
Multipage: https://html.spec.whatwg.org/multipage/#run-the-fullscreen-rendering-steps
Complete: https://html.spec.whatwg.org/#run-the-fullscreen-rendering-steps
Referrer: 

Comment:
Instead of running a set of steps. Could we formalize the idea that these
steps run a "fullscreen rendertask" (or some such) if queued and do nothing
otherwise. Formalizing a bit more clearly what is going seems better than
having each hook reivent some kind of task concept.

Posted from: 77.57.115.157 by annevk@annevk.nl
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0
Comment 1 Philip Jägenstedt 2015-02-12 10:15:51 UTC
When I was working on the Fullscreen implementation a while ago, I added an "animation frame task" concept and had the fullscreen code add tasks on that task queue. I agree that a callback that just looks at its own usually-empty task queue is bit odd.
Comment 2 Ian 'Hixie' Hickson 2015-03-04 19:38:42 UTC
I'm not sure I follow what the problem is here.
Comment 3 Philip Jägenstedt 2015-03-05 05:53:46 UTC
There is no serious problem, the current arrangement will work. Fullscreen can define its own queue of pending tasks for the next animation frame and go through this queue on every call to the "run the fullscreen rendering steps" hook.

This bug is asking if instead this queue of tasks could be moved to HTML, so that Fullscreen can simply say "queue an animation frame task"? This means that two specs could both do this, but as long as the algorithm which invokes "queue an animation frame task" runs at a well-defined time, it should not lead to undefined task order.
Comment 4 Anne 2015-10-06 07:05:01 UTC
Provided bug 28876 does not end up changing all of this, I think we could generalize this into "render tasks of type /type/". And then you can "queue a render task of type /type/". And we'll have "render task queues of type /type/". And we'll have a list of "render task types" ("fullscreen" being one of them) that step 8 of the event loop iterates over to empty all their respective render task queues of type /type/, etc.
Comment 5 Anne 2016-03-25 10:53:48 UTC
So I tried to redo this by giving fullscreen a queue of its own. Elsewhere Domenic and I established that not all specifications need a queue here and might need their own logic for such a queue anyway.

However, isn't it still problematic that HTML effectively runs a set of steps on a per-document basis whereas fullscreen needs a callback for a top-level browsing context?
Comment 6 Philip Jägenstedt 2016-03-29 06:49:38 UTC
Could the top-level browsing context's document (ignoring all others) be used as an approximation of what you want?
Comment 7 Anne 2016-03-29 08:31:24 UTC
We could ignore all other documents, sure, but that seems very inefficient and an unlikely match for how this would be implemented.
Comment 8 Philip Jägenstedt 2016-03-29 11:44:08 UTC
I think that it might be implemented using the same mechanism that's used to sync events to animation frames. In Blink there's a Document::enqueueAnimationFrameEvent, and when I was looking at this some generalization of that was my thinking.

Given the possibility of out-of-process iframes I don't think a single top-level callback would actually work. Maybe registering per-document callbacks in a specific order would end up doing the right thing.
Comment 9 Anne 2016-03-29 12:10:14 UTC
So we'd rephrase https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen and https://fullscreen.spec.whatwg.org/#exit-fullscreen to iterate over the documents and then queue a task for each of them to fullscreen/unfullscreen and dispatch events? Maybe that is actually fairly reasonable.

Would be quite a rewrite though.
Comment 10 Philip Jägenstedt 2016-03-29 12:41:37 UTC
I'm hesitant to say yay or nay without going deeper into the implementation. Xidorn, maybe this is implemented more like the spec in Gecko? WDYT?
Comment 11 Xidorn Quan 2016-03-30 23:45:12 UTC
In Gecko, the current implementation is that, when the browser window enters fullscreen, the state of the document is changed immediately, and then events are put in an event queue which is currently only used for fullscreen (though has a generalized name). And events in the queue are dispatched in the next animation frame, after animation events and before animation frame callbacks.

It sounds like it is something similiar to Blink's implementation? I guess it is good to standardize this queue with a generalized name.

The document state change being synced with window change (async with the events) is a bit different with what the spec currently says, but that's an issue for the Fullscreen spec.
Comment 12 Philip Jägenstedt 2017-05-04 10:07:46 UTC
Treating this as moved to https://github.com/whatwg/html/issues/707