Skip to content

Commit

Permalink
script_trask, handle_msgs: factored out handle_msg_from_devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
payload authored and Ms2ger committed Dec 12, 2014
1 parent 1fc4647 commit 31e4003
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions components/script/script_task.rs
Expand Up @@ -541,12 +541,7 @@ impl ScriptTask {
if self.handle_exit_pipeline_msg(id) { return false },
FromConstellation(inner_msg) => self.handle_msg_from_constellation(inner_msg),
FromScript(inner_msg) => self.handle_msg_from_script(inner_msg),
FromDevtools(EvaluateJS(id, s, reply)) => devtools::handle_evaluate_js(&*self.page.borrow(), id, s, reply),
FromDevtools(GetRootNode(id, reply)) => devtools::handle_get_root_node(&*self.page.borrow(), id, reply),
FromDevtools(GetDocumentElement(id, reply)) => devtools::handle_get_document_element(&*self.page.borrow(), id, reply),
FromDevtools(GetChildren(id, node_id, reply)) => devtools::handle_get_children(&*self.page.borrow(), id, node_id, reply),
FromDevtools(GetLayout(id, node_id, reply)) => devtools::handle_get_layout(&*self.page.borrow(), id, node_id, reply),
FromDevtools(ModifyAttribute(id, node_id, modifications)) => devtools::handle_modify_attribute(&*self.page.borrow(), id, node_id, modifications),
FromDevtools(inner_msg) => self.handle_msg_from_devtools(inner_msg),
}
}

Expand Down Expand Up @@ -609,6 +604,23 @@ impl ScriptTask {
}
}

fn handle_msg_from_devtools(&self, msg: DevtoolScriptControlMsg) {
match msg {
EvaluateJS(id, s, reply) =>
devtools::handle_evaluate_js(&*self.page.borrow(), id, s, reply),
GetRootNode(id, reply) =>
devtools::handle_get_root_node(&*self.page.borrow(), id, reply),
GetDocumentElement(id, reply) =>
devtools::handle_get_document_element(&*self.page.borrow(), id, reply),
GetChildren(id, node_id, reply) =>
devtools::handle_get_children(&*self.page.borrow(), id, node_id, reply),
GetLayout(id, node_id, reply) =>
devtools::handle_get_layout(&*self.page.borrow(), id, node_id, reply),
ModifyAttribute(id, node_id, modifications) =>
devtools::handle_modify_attribute(&*self.page.borrow(), id, node_id, modifications),
}
}

fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) {
let NewLayoutInfo {
old_pipeline_id,
Expand Down

11 comments on commit 31e4003

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented on 31e4003 Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=jdm

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at 31e4003

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging servo/servo/msgs = 31e4003 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

servo/servo/msgs = 31e4003 merged ok, testing candidate = ddc6398

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdm
Copy link
Member

@jdm jdm commented on 31e4003 Dec 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at 31e4003

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging servo/servo/msgs = 31e4003 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

servo/servo/msgs = 31e4003 merged ok, testing candidate = ea39b87

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = ea39b87

Please sign in to comment.