Ultralight
Ultralight copied to clipboard
Control over the internal render time / timer.
External control over the internal render timer to allow rendering HTML/CSS animations synchronized with external source.
Specific use case: render HTML/CSS as overlays for the video frames. Since video frames might arrive come in slower or faster then real time (but always have a proper timestamp) it would be nice to be able to precisely control when internal CSS animations timer(s) actually advance to keep HTML/CSS rendering synchronized to the video.
AFAIK WebCore uses a global currentTime()
function to query the current clock (used for both CSS and JavaScript animations)-- https://github.com/ultralight-ux/WebCore/blob/master/Source/WTF/wtf/CurrentTime.cpp#L156
We could allow the user to override the current clock so they can control when it advances-- this may, however, impact some unrelated timers/timeouts throughout the codebase (I'm thinking of network/cache timeouts). Won't know for sure until we try it out :).
I think I might accept "unrelated timers/timeouts throughout the codebase" as an acceptable risk, since I envision a rather controlled use case. It would be awesome to officially allow overwriting this function in the config, as it would avoid the need to hook/trampoline the Windows API calls.
If you need any help / encouragement / support, let me know :). I'm local to SF area as well.
👍 from me to, I also would love an official way to control the time. It would allow to have stable CSS animations while rendering out a video in "not real time".