Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per the spec, calling clearInterval in the interval's callback has no effect #7356

Closed
andreubotella opened this issue Nov 22, 2021 · 0 comments · Fixed by #7359
Closed

Per the spec, calling clearInterval in the interval's callback has no effect #7356

andreubotella opened this issue Nov 22, 2021 · 0 comments · Fixed by #7359

Comments

@andreubotella
Copy link
Member

In every browser, clearing an interval in that very interval's callback correctly cancels it, but the spec has a bug that makes that not work:

  1. After running the callback or evaling the string, if the repeat flag is true, the timer initialization steps run again (timer initialization steps 6.3). This happens whether or not handle has been removed from the map of active timers since step 6.1.
  2. Step 14 in the timer initialization steps will add an entry with handle to the map of active timers.

Step 6.3 should check whether handle is in the map of active timers, as 6.1 does, before running the timer initialization steps again.

andreubotella pushed a commit to web-platform-tests/wpt that referenced this issue Nov 22, 2021
andreubotella pushed a commit to web-platform-tests/wpt that referenced this issue Nov 23, 2021
domenic added a commit that referenced this issue Nov 23, 2021
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 30, 2021
…he interval's callback, a=testonly

Automatic update from web-platform-tests
Test that `clearInterval` works inside the interval's callback (#31698)

Ref: whatwg/html#7356
--

wpt-commits: 2948653c47c2d84d14fbac0706d2b86ada41323a
wpt-pr: 31698
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Nov 30, 2021
…he interval's callback, a=testonly

Automatic update from web-platform-tests
Test that `clearInterval` works inside the interval's callback (#31698)

Ref: whatwg/html#7356
--

wpt-commits: 2948653c47c2d84d14fbac0706d2b86ada41323a
wpt-pr: 31698
mfreed7 pushed a commit to mfreed7/html that referenced this issue Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant