Open majaha opened 1 month ago
cc @domenic
I found this in the Chrome code, it looks like I'm not the only one who's spotted this: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/scheduler/dom_timer.cc;l=272;drc=b0b102b6582fe1fca4a5eb6b156f198113674ec7;bpv=1;bpt=1?q=dom_timer.cc&ss=chromium%2Fchromium%2Fsrc
What is the issue with the HTML Standard?
None of Chrome, Firefox or Safari match the timer initialization steps. In particular, the amount of nesting that is required before the timeout is clamped to 4ms differs.
The issue is demonstrated with this code:
By a close reading of the spec, you can trace the execution like this:
Which means that by the spec, the output should be approximately:
with six 0's before the first 4.
However, both Firefox and Chrome print only four 0's before the first 4. And I think Safari prints five 0's.
So step 5 of the spec doesn't match what implementations are actually doing.