aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/devtools.rs
diff options
context:
space:
mode:
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,