aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/devtools.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2015-08-13 11:55:39 -0400
committerJosh Matthews <josh@joshmatthews.net>2015-08-13 13:44:54 -0400
commit820c74649b8f775b0239b67a16dfc4af4b5411b8 (patch)
treec6c590f4de29a03875f01707de4853c61898af39 /components/script/devtools.rs
parentc81c3a2f70fdc5affe1a50b7b005b302cd306a50 (diff)
downloadservo-820c74649b8f775b0239b67a16dfc4af4b5411b8.tar.gz
servo-820c74649b8f775b0239b67a16dfc4af4b5411b8.zip
Improve documentation for devtools messages a bit more.
Diffstat (limited to 'components/script/devtools.rs')
-rw-r--r--components/script/devtools.rs9
1 files changed, 6 insertions, 3 deletions
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<Page>, pipeline: PipelineId, node_id: Strin
reply.send(children).unwrap();
}
-pub fn handle_get_layout(page: &Rc<Page>, pipeline: PipelineId, node_id: String, reply: IpcSender<(f32, f32)>) {
+pub fn handle_get_layout(page: &Rc<Page>,
+ pipeline: PipelineId,
+ node_id: String,
+ reply: IpcSender<ComputedNodeLayout>) {
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,