diff options
author | lpy <pylaurent1314@gmail.com> | 2014-04-16 22:55:39 +0800 |
---|---|---|
committer | lpy <pylaurent1314@gmail.com> | 2014-04-18 01:30:39 +0800 |
commit | b7dcf62ed00b073cfc7728b23bee5540cd76e2aa (patch) | |
tree | efd4500371d78b61776a84d26c76687d339be505 /src/components/script/script_task.rs | |
parent | 896cadbf625bc6cfe6038645fd2672f7336d15fc (diff) | |
download | servo-b7dcf62ed00b073cfc7728b23bee5540cd76e2aa.tar.gz servo-b7dcf62ed00b073cfc7728b23bee5540cd76e2aa.zip |
Implement Window.set/clearInterval.(fixes #2116)
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index a585c320ad9..096a0d40b6a 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -660,9 +660,15 @@ impl ScriptTask { let frame = page.frame(); let mut window = frame.get_ref().window.clone(); - let timer_handle = window.get_mut().active_timers.pop(&timer_data.handle); - if timer_handle.is_none() { - return; + { + let timer_handle = window.get().active_timers.find(&timer_data.handle); + if timer_handle.is_none() { + return; + } + } + + if !timer_data.is_interval { + window.get_mut().active_timers.remove(&timer_data.handle); } let js_info = page.js_info(); |