Closed toddreifsteck closed 7 years ago
| [ run task ] [ update rendering ] ----[ idle period ]----| [run task] [...
Is that what you're thinking? @rmcilroy does that work?
I'd like to still keep the concept of frames in this diagram, since it is meant to be explaining the intention for idle periods between frames. I'm happy to remove the vsync markers from the diagram though. Would the attached diagram for you @toddreifsteck ?
@rmcilroy I think we have to remove "frame commit", per Todd's earlier comment. Also, this diagram is not clear as to when all the other steps run.. Referencing "update rendering" and "run task" maps to the html definition: https://html.spec.whatwg.org/#event-loop-processing-model
Agree with @igrigorik . We need the diagram to match the HTML5 event loop processing model. (And we need this spec to ideally make its way into that processing model as it is adding to it)
Fair enough, how about this:
I also agree Todd, the spec should make it's way into that processing model.
👍
Better.. but I think the diagram needs to be specific. Update Rendering has a number of steps including snapping rendering and I think IdleCallback is before "update UI" and after RAF, isn't it? Does it happen before or after IntesrectionObserver callbacks?
Now I'm looking again.. wow. I think it is after the entire Update Rendering chunk? Am I now reading that accurately?
Yes exactly, I think rIC should be entirely after the Update Rendering chunk. The intention is that the idle period is the time between UI updates for the next frame, but ends before the UA wants to start work on the frame after that (e.g., before the next rAF).
Do you still want more blocks split out or does this work given it's after the entire update rendering chunk?
Yes exactly, I think rIC should be entirely after the Update Rendering chunk.
That's the assumption I was working with too. Well, at least with respect to the HTML spec.. We all understand that the loop described there is a loose approximation of how this code is structured in various implementations.
@rmcilroy what is the src doc for that diagram? Let's add a link to it as an HTML comment above the figure, such that other editors can iterate on it in the future.
K, I'm good with this update. Spent a bit of time reviewing what it would take to implement... and current thinking is that this is doable. (We reserve the right to give feedback when we actually implement, of course. :-))
Sounds good! @rmcilroy can you update the diagram and add the link? Alternatively, if you give me access to the doc with the diagram, I can do it on this end.
Sorry for the delay, just back from vacation. Updated both diagrams and added comments to their source in pull request #52. Please take a look.
Closing, resolved via #52.
IE and Microsoft Edge currently perform a frame commit immediately after vsync rather than immediately before. I've reviewed HTML5 and do not see this is a cross-browser specced behavior. (Perhaps it should be.....) The diagram should probably be in terms of the HTML5 render loop rather than referring to vsync and frame commit.