mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
script_trask, handle_msgs: factored out handle_msg_from_devtools
This commit is contained in:
parent
1fc46471ff
commit
31e40038cd
1 changed files with 18 additions and 6 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue