Cleanup ClientRectList binding.

This commit is contained in:
Ms2ger 2013-10-23 20:05:14 +02:00
parent f75568e939
commit 6af555ab23
2 changed files with 22 additions and 25 deletions

View file

@ -287,24 +287,21 @@ impl Element {
let node = abstract_self;
assert!(node.is_element());
let (port, chan) = comm::stream();
let (rects, cx, scope) =
let rects =
match win.page.query_layout(ContentBoxesQuery(node, chan), port) {
ContentBoxesResponse(rects) => {
let cx = win.get_cx();
let scope = win.reflector().get_jsobject();
let rects = do rects.map |r| {
do rects.map |r| {
ClientRect::new(
win,
r.origin.y.to_f32().unwrap(),
(r.origin.y + r.size.height).to_f32().unwrap(),
r.origin.x.to_f32().unwrap(),
(r.origin.x + r.size.width).to_f32().unwrap())
};
(rects, cx, scope)
}
},
};
ClientRectList::new(rects, cx, scope)
ClientRectList::new(win, rects)
}
pub fn GetBoundingClientRect(&self, abstract_self: AbstractNode<ScriptView>) -> @mut ClientRect {