mirror of
https://github.com/servo/servo.git
synced 2025-07-30 18:50:36 +01:00
removed instances of &Root<BrowsingContext>
This commit is contained in:
parent
cbc5ca65a8
commit
9efd214b1e
3 changed files with 30 additions and 30 deletions
|
@ -65,7 +65,7 @@ pub fn handle_evaluate_js(global: &GlobalRef, eval: String, reply: IpcSender<Eva
|
||||||
reply.send(result).unwrap();
|
reply.send(result).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_root_node(context: &Root<BrowsingContext>, pipeline: PipelineId, reply: IpcSender<NodeInfo>) {
|
pub fn handle_get_root_node(context: &BrowsingContext, pipeline: PipelineId, reply: IpcSender<NodeInfo>) {
|
||||||
let context = get_browsing_context(context, pipeline);
|
let context = get_browsing_context(context, pipeline);
|
||||||
let document = context.active_document();
|
let document = context.active_document();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ pub fn handle_get_root_node(context: &Root<BrowsingContext>, pipeline: PipelineI
|
||||||
reply.send(node.summarize()).unwrap();
|
reply.send(node.summarize()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_document_element(context: &Root<BrowsingContext>,
|
pub fn handle_get_document_element(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
reply: IpcSender<NodeInfo>) {
|
reply: IpcSender<NodeInfo>) {
|
||||||
let context = get_browsing_context(context, pipeline);
|
let context = get_browsing_context(context, pipeline);
|
||||||
|
@ -84,7 +84,7 @@ pub fn handle_get_document_element(context: &Root<BrowsingContext>,
|
||||||
reply.send(node.summarize()).unwrap();
|
reply.send(node.summarize()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_node_by_unique_id(context: &Root<BrowsingContext>,
|
fn find_node_by_unique_id(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String)
|
node_id: String)
|
||||||
-> Root<Node> {
|
-> Root<Node> {
|
||||||
|
@ -101,7 +101,7 @@ fn find_node_by_unique_id(context: &Root<BrowsingContext>,
|
||||||
panic!("couldn't find node with unique id {}", node_id)
|
panic!("couldn't find node with unique id {}", node_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_children(context: &Root<BrowsingContext>,
|
pub fn handle_get_children(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
reply: IpcSender<Vec<NodeInfo>>) {
|
reply: IpcSender<Vec<NodeInfo>>) {
|
||||||
|
@ -112,7 +112,7 @@ pub fn handle_get_children(context: &Root<BrowsingContext>,
|
||||||
reply.send(children).unwrap();
|
reply.send(children).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_layout(context: &Root<BrowsingContext>,
|
pub fn handle_get_layout(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
reply: IpcSender<ComputedNodeLayout>) {
|
reply: IpcSender<ComputedNodeLayout>) {
|
||||||
|
@ -202,7 +202,7 @@ pub fn handle_get_cached_messages(_pipeline_id: PipelineId,
|
||||||
reply.send(messages).unwrap();
|
reply.send(messages).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_modify_attribute(context: &Root<BrowsingContext>,
|
pub fn handle_modify_attribute(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
modifications: Vec<Modification>) {
|
modifications: Vec<Modification>) {
|
||||||
|
@ -224,20 +224,20 @@ pub fn handle_wants_live_notifications(global: &GlobalRef, send_notifications: b
|
||||||
global.set_devtools_wants_updates(send_notifications);
|
global.set_devtools_wants_updates(send_notifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_set_timeline_markers(context: &Root<BrowsingContext>,
|
pub fn handle_set_timeline_markers(context: &BrowsingContext,
|
||||||
marker_types: Vec<TimelineMarkerType>,
|
marker_types: Vec<TimelineMarkerType>,
|
||||||
reply: IpcSender<TimelineMarker>) {
|
reply: IpcSender<TimelineMarker>) {
|
||||||
let window = context.active_window();
|
let window = context.active_window();
|
||||||
window.set_devtools_timeline_markers(marker_types, reply);
|
window.set_devtools_timeline_markers(marker_types, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_drop_timeline_markers(context: &Root<BrowsingContext>,
|
pub fn handle_drop_timeline_markers(context: &BrowsingContext,
|
||||||
marker_types: Vec<TimelineMarkerType>) {
|
marker_types: Vec<TimelineMarkerType>) {
|
||||||
let window = context.active_window();
|
let window = context.active_window();
|
||||||
window.drop_devtools_timeline_markers(marker_types);
|
window.drop_devtools_timeline_markers(marker_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_request_animation_frame(context: &Root<BrowsingContext>,
|
pub fn handle_request_animation_frame(context: &BrowsingContext,
|
||||||
id: PipelineId,
|
id: PipelineId,
|
||||||
actor_name: String) {
|
actor_name: String) {
|
||||||
let context = context.find(id).expect("There is no such context");
|
let context = context.find(id).expect("There is no such context");
|
||||||
|
|
|
@ -1665,7 +1665,7 @@ impl ScriptThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reflows non-incrementally, rebuilding the entire layout tree in the process.
|
/// Reflows non-incrementally, rebuilding the entire layout tree in the process.
|
||||||
fn rebuild_and_force_reflow(&self, context: &Root<BrowsingContext>, reason: ReflowReason) {
|
fn rebuild_and_force_reflow(&self, context: &BrowsingContext, reason: ReflowReason) {
|
||||||
let document = context.active_document();
|
let document = context.active_document();
|
||||||
document.dirty_all_nodes();
|
document.dirty_all_nodes();
|
||||||
let window = window_from_node(document.r());
|
let window = window_from_node(document.r());
|
||||||
|
@ -1980,7 +1980,7 @@ impl Drop for ScriptThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shuts down layout for the given browsing context tree.
|
/// Shuts down layout for the given browsing context tree.
|
||||||
fn shut_down_layout(context_tree: &Root<BrowsingContext>) {
|
fn shut_down_layout(context_tree: &BrowsingContext) {
|
||||||
let mut channels = vec!();
|
let mut channels = vec!();
|
||||||
|
|
||||||
for context in context_tree.iter() {
|
for context in context_tree.iter() {
|
||||||
|
@ -2010,7 +2010,7 @@ fn shut_down_layout(context_tree: &Root<BrowsingContext>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_browsing_context(context: &Root<BrowsingContext>,
|
pub fn get_browsing_context(context: &BrowsingContext,
|
||||||
pipeline_id: PipelineId)
|
pipeline_id: PipelineId)
|
||||||
-> Root<BrowsingContext> {
|
-> Root<BrowsingContext> {
|
||||||
context.find(pipeline_id).expect("ScriptThread: received an event \
|
context.find(pipeline_id).expect("ScriptThread: received an event \
|
||||||
|
|
|
@ -36,7 +36,7 @@ use script_thread::get_browsing_context;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::str::DOMString;
|
use util::str::DOMString;
|
||||||
|
|
||||||
fn find_node_by_unique_id(context: &Root<BrowsingContext>,
|
fn find_node_by_unique_id(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String)
|
node_id: String)
|
||||||
-> Option<Root<Node>> {
|
-> Option<Root<Node>> {
|
||||||
|
@ -65,7 +65,7 @@ pub unsafe fn jsval_to_webdriver(cx: *mut JSContext, val: HandleValue) -> WebDri
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
pub fn handle_execute_script(context: &Root<BrowsingContext>,
|
pub fn handle_execute_script(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
eval: String,
|
eval: String,
|
||||||
reply: IpcSender<WebDriverJSResult>) {
|
reply: IpcSender<WebDriverJSResult>) {
|
||||||
|
@ -80,7 +80,7 @@ pub fn handle_execute_script(context: &Root<BrowsingContext>,
|
||||||
reply.send(result).unwrap();
|
reply.send(result).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_execute_async_script(context: &Root<BrowsingContext>,
|
pub fn handle_execute_async_script(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
eval: String,
|
eval: String,
|
||||||
reply: IpcSender<WebDriverJSResult>) {
|
reply: IpcSender<WebDriverJSResult>) {
|
||||||
|
@ -92,7 +92,7 @@ pub fn handle_execute_async_script(context: &Root<BrowsingContext>,
|
||||||
window.evaluate_js_on_global_with_result(&eval, rval.handle_mut());
|
window.evaluate_js_on_global_with_result(&eval, rval.handle_mut());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_frame_id(context: &Root<BrowsingContext>,
|
pub fn handle_get_frame_id(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
webdriver_frame_id: WebDriverFrameId,
|
webdriver_frame_id: WebDriverFrameId,
|
||||||
reply: IpcSender<Result<Option<PipelineId>, ()>>) {
|
reply: IpcSender<Result<Option<PipelineId>, ()>>) {
|
||||||
|
@ -122,7 +122,7 @@ pub fn handle_get_frame_id(context: &Root<BrowsingContext>,
|
||||||
reply.send(frame_id).unwrap()
|
reply.send(frame_id).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_find_element_css(context: &Root<BrowsingContext>, _pipeline: PipelineId, selector: String,
|
pub fn handle_find_element_css(context: &BrowsingContext, _pipeline: PipelineId, selector: String,
|
||||||
reply: IpcSender<Result<Option<String>, ()>>) {
|
reply: IpcSender<Result<Option<String>, ()>>) {
|
||||||
reply.send(match context.active_document().QuerySelector(DOMString::from(selector)) {
|
reply.send(match context.active_document().QuerySelector(DOMString::from(selector)) {
|
||||||
Ok(node) => {
|
Ok(node) => {
|
||||||
|
@ -132,7 +132,7 @@ pub fn handle_find_element_css(context: &Root<BrowsingContext>, _pipeline: Pipel
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_find_elements_css(context: &Root<BrowsingContext>,
|
pub fn handle_find_elements_css(context: &BrowsingContext,
|
||||||
_pipeline: PipelineId,
|
_pipeline: PipelineId,
|
||||||
selector: String,
|
selector: String,
|
||||||
reply: IpcSender<Result<Vec<String>, ()>>) {
|
reply: IpcSender<Result<Vec<String>, ()>>) {
|
||||||
|
@ -152,7 +152,7 @@ pub fn handle_find_elements_css(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_focus_element(context: &Root<BrowsingContext>,
|
pub fn handle_focus_element(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
element_id: String,
|
element_id: String,
|
||||||
reply: IpcSender<Result<(), ()>>) {
|
reply: IpcSender<Result<(), ()>>) {
|
||||||
|
@ -171,18 +171,18 @@ pub fn handle_focus_element(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_active_element(context: &Root<BrowsingContext>,
|
pub fn handle_get_active_element(context: &BrowsingContext,
|
||||||
_pipeline: PipelineId,
|
_pipeline: PipelineId,
|
||||||
reply: IpcSender<Option<String>>) {
|
reply: IpcSender<Option<String>>) {
|
||||||
reply.send(context.active_document().GetActiveElement().map(
|
reply.send(context.active_document().GetActiveElement().map(
|
||||||
|elem| elem.upcast::<Node>().unique_id())).unwrap();
|
|elem| elem.upcast::<Node>().unique_id())).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_title(context: &Root<BrowsingContext>, _pipeline: PipelineId, reply: IpcSender<String>) {
|
pub fn handle_get_title(context: &BrowsingContext, _pipeline: PipelineId, reply: IpcSender<String>) {
|
||||||
reply.send(String::from(context.active_document().Title())).unwrap();
|
reply.send(String::from(context.active_document().Title())).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_rect(context: &Root<BrowsingContext>,
|
pub fn handle_get_rect(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
element_id: String,
|
element_id: String,
|
||||||
reply: IpcSender<Result<Rect<f64>, ()>>) {
|
reply: IpcSender<Result<Rect<f64>, ()>>) {
|
||||||
|
@ -220,7 +220,7 @@ pub fn handle_get_rect(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_text(context: &Root<BrowsingContext>,
|
pub fn handle_get_text(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
reply: IpcSender<Result<String, ()>>) {
|
reply: IpcSender<Result<String, ()>>) {
|
||||||
|
@ -232,7 +232,7 @@ pub fn handle_get_text(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_name(context: &Root<BrowsingContext>,
|
pub fn handle_get_name(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
reply: IpcSender<Result<String, ()>>) {
|
reply: IpcSender<Result<String, ()>>) {
|
||||||
|
@ -244,7 +244,7 @@ pub fn handle_get_name(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_attribute(context: &Root<BrowsingContext>,
|
pub fn handle_get_attribute(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -258,7 +258,7 @@ pub fn handle_get_attribute(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_css(context: &Root<BrowsingContext>,
|
pub fn handle_get_css(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
node_id: String,
|
node_id: String,
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -274,7 +274,7 @@ pub fn handle_get_css(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_url(context: &Root<BrowsingContext>,
|
pub fn handle_get_url(context: &BrowsingContext,
|
||||||
_pipeline: PipelineId,
|
_pipeline: PipelineId,
|
||||||
reply: IpcSender<Url>) {
|
reply: IpcSender<Url>) {
|
||||||
let document = context.active_document();
|
let document = context.active_document();
|
||||||
|
@ -282,7 +282,7 @@ pub fn handle_get_url(context: &Root<BrowsingContext>,
|
||||||
reply.send((*url).clone()).unwrap();
|
reply.send((*url).clone()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_get_window_size(context: &Root<BrowsingContext>,
|
pub fn handle_get_window_size(context: &BrowsingContext,
|
||||||
_pipeline: PipelineId,
|
_pipeline: PipelineId,
|
||||||
reply: IpcSender<Option<WindowSizeData>>) {
|
reply: IpcSender<Option<WindowSizeData>>) {
|
||||||
let window = context.active_window();
|
let window = context.active_window();
|
||||||
|
@ -290,7 +290,7 @@ pub fn handle_get_window_size(context: &Root<BrowsingContext>,
|
||||||
reply.send(size).unwrap();
|
reply.send(size).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_is_enabled(context: &Root<BrowsingContext>,
|
pub fn handle_is_enabled(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
element_id: String,
|
element_id: String,
|
||||||
reply: IpcSender<Result<bool, ()>>) {
|
reply: IpcSender<Result<bool, ()>>) {
|
||||||
|
@ -305,7 +305,7 @@ pub fn handle_is_enabled(context: &Root<BrowsingContext>,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_is_selected(context: &Root<BrowsingContext>,
|
pub fn handle_is_selected(context: &BrowsingContext,
|
||||||
pipeline: PipelineId,
|
pipeline: PipelineId,
|
||||||
element_id: String,
|
element_id: String,
|
||||||
reply: IpcSender<Result<bool, ()>>) {
|
reply: IpcSender<Result<bool, ()>>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue