aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/script_task.rs
diff options
context:
space:
mode:
authorJames Graham <james@hoppipolla.co.uk>2013-09-19 00:02:41 +0100
committerJames Graham <james@hoppipolla.co.uk>2013-09-19 00:02:41 +0100
commit29a75daa66cf289cf973cec179edc342114ca726 (patch)
tree4602508dce075b3860aa46395ecfbd87b3616a23 /src/components/script/script_task.rs
parent5be084a3b6fe2557519d4cd8506efb6b026464d3 (diff)
downloadservo-29a75daa66cf289cf973cec179edc342114ca726.tar.gz
servo-29a75daa66cf289cf973cec179edc342114ca726.zip
Add support for clearTimeout.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r--src/components/script/script_task.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 8335ccb5936..5ccdacad9be 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -254,7 +254,7 @@ impl Page {
///
/// This function fails if there is no root frame.
fn reflow(&mut self, goal: ReflowGoal, script_chan: ScriptChan, compositor: @ScriptListener) {
-
+
debug!("script: performing reflow for goal %?", goal);
// Now, join the layout so that they will see the latest changes we have made.
@@ -561,6 +561,10 @@ impl ScriptTask {
fn handle_fire_timer_msg(&mut self, id: PipelineId, timer_data: ~TimerData) {
let page = self.page_tree.find(id).expect("ScriptTask: received fire timer msg for a
pipeline ID not associated with this script task. This is a bug.").page;
+ let window = page.frame.expect("ScriptTask: Expect a timeout to have a document").window;
+ if !window.active_timers.contains(&timer_data.handle) {
+ return;
+ }
unsafe {
let this_value = if timer_data.args.len() > 0 {
RUST_JSVAL_TO_OBJECT(timer_data.args[0])