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

Implement Window.set/clearInterval #2116

Closed
jdm opened this issue Apr 15, 2014 · 3 comments
Closed

Implement Window.set/clearInterval #2116

jdm opened this issue Apr 15, 2014 · 3 comments
Labels
A-content/dom Interacting with the DOM from web content C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor.

Comments

@jdm
Copy link
Member

jdm commented Apr 15, 2014

http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-setinterval

It should be fairly easy to build on the existing setTimer infrastructure in dom/window.rs to make it repeating.

@lpy
Copy link
Contributor

lpy commented Apr 16, 2014

I am working on it.

@jdm jdm added the C-assigned label Apr 16, 2014
@lpy
Copy link
Contributor

lpy commented Apr 16, 2014

Each time handle_fire_timer_msg is called, it will pop the timer_handler from active_timers. I suggest that we add a is_interval field in TimerData.

@jdm
Copy link
Member Author

jdm commented Apr 16, 2014

That sounds reasonable.

bors-servo pushed a commit that referenced this issue Apr 17, 2014
see #2116
I add an `is_interval` field, so that when the `TimerData` is passed by `SetInterval`, we will not delete it from `active_timers`.
Also I think maybe we can extract the code in `ClearTimeout` and `ClearInterval` into another method to avoid duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/dom Interacting with the DOM from web content C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor.
Projects
None yet
Development

No branches or pull requests

2 participants