Yes the intent started as an origin trial, now more details and bullets are 
added in ChromeStatus and I'm about to send "intent to ship".

As for your question about "alignment interval", the alignment interval for 
Chromium would be 32ms. The specification mentions "the 
SetTimeout/SetInterval API does not guarantee that timers will run exactly 
on schedule. Delays due to CPU load, other tasks, etc, are to be expected. 
The wait length of time is implementation-defined, which is intended to 
allow user agents to pad timeouts as needed to optimize the power usage of 
the device".
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html

Actually, different browser vendors do have different implementation about 
the wait length of time. Webkit would align DOM timer of non-interacted 
cross origin frames to 30ms, while in Gecko, all DOM timers of frames (both 
same origin and cross origin) are aligned to 16ms. So web developers cannot 
expect the delay is the same across user agents. I already put this note to 
"interoperability and compatibility risks" of the feature in ChromeStatus.

If the work is related to animation, then requestAnimationFrame is much 
better at scheduling animation work than JavaScript timers. It synchronizes 
with the refresh rate of the device, ensuring you only get one callback per 
displayable frame, and you get the maximum amount of time to construct that 
frame. requestAnimationFrame would not be affected.
https://developer.chrome.com/blog/timer-throttling-in-chrome-88#animation

On Thursday, March 14, 2024 at 12:32:52 AM UTC+8 Daniel Bratell wrote:

This intent has ended up in a strange state in the chromestatus tool, 
missing various flags I would have expected. Is that because the intent 
predates some of the chromestatus updates or because it started as an 
origin trial? If so, maybe the simplest is to refile it, or can it be made 
to be a proper Intent to Ship with all the buttons and bullets?

Another few things though, and I hope I'm not repeating something already 
covered elsewhere.

First, I really like the idea of doing optimizations that have a measurable 
impact on user behaviour and probably also power usage and energy usage so 
I approve of this work. But then I have questions.

The text mentions that WebKit uses an alignment on 30 milliseconds 
intervals, but what is the intention for Chromium? Also 30 milliseconds? 

If the idea is for it to be 30 milliseconds, that would be too sparse to 
allow 60 fps animations run on setTimeout. If so, is that intentional, and 
would that be acceptable?

I ask in particular, because "uninteresting iframe" is vaguely defined so I 
don't know how much content will be misclassified as "uninteresting".

In general, is the answer to my questions above covered by some 
specification we can point people to when they wonder why something behaves 
inexplicably?

/Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d8c084b4-e00f-4784-93b8-d0fbb153d978n%40chromium.org.

Reply via email to