From 820c74649b8f775b0239b67a16dfc4af4b5411b8 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 13 Aug 2015 11:55:39 -0400 Subject: Improve documentation for devtools messages a bit more. --- components/script/devtools.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'components/script/devtools.rs') diff --git a/components/script/devtools.rs b/components/script/devtools.rs index 13f1614462c..06a2141d3b1 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -4,7 +4,7 @@ use devtools_traits::{CachedConsoleMessage, CachedConsoleMessageTypes, PAGE_ERROR, CONSOLE_API}; use devtools_traits::{EvaluateJSReply, NodeInfo, Modification, TimelineMarker, TimelineMarkerType}; -use devtools_traits::{ConsoleAPI, PageError, ScriptToDevtoolsControlMsg}; +use devtools_traits::{ConsoleAPI, PageError, ScriptToDevtoolsControlMsg, ComputedNodeLayout}; use dom::bindings::conversions::jsstring_to_str; use dom::bindings::conversions::FromJSValConvertible; use dom::bindings::js::Root; @@ -97,13 +97,16 @@ pub fn handle_get_children(page: &Rc, pipeline: PipelineId, node_id: Strin reply.send(children).unwrap(); } -pub fn handle_get_layout(page: &Rc, pipeline: PipelineId, node_id: String, reply: IpcSender<(f32, f32)>) { +pub fn handle_get_layout(page: &Rc, + pipeline: PipelineId, + node_id: String, + reply: IpcSender) { let node = find_node_by_unique_id(&*page, pipeline, node_id); let elem = ElementCast::to_ref(node.r()).expect("should be getting layout of element"); let rect = elem.GetBoundingClientRect(); let width = *rect.r().Width(); let height = *rect.r().Height(); - reply.send((width, height)).unwrap(); + reply.send(ComputedNodeLayout { width: width, height: height }).unwrap(); } pub fn handle_get_cached_messages(_pipeline_id: PipelineId, -- cgit v1.2.3