Skip to content

Commit

Permalink
Remove window field from domrectlist
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwu committed Jul 15, 2015
1 parent e06eaa0 commit c90be8e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/script/dom/domrectlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,20 @@ use dom::window::Window;
pub struct DOMRectList {
reflector_: Reflector,
rects: Vec<JS<DOMRect>>,
window: JS<Window>,
}

impl DOMRectList {
fn new_inherited<T>(window: &Window, rects: T) -> DOMRectList
fn new_inherited<T>(rects: T) -> DOMRectList
where T: Iterator<Item=Root<DOMRect>> {
DOMRectList {
reflector_: Reflector::new(),
rects: rects.map(|r| JS::from_rooted(&r)).collect(),
window: JS::from_ref(window),
}
}

pub fn new<T>(window: &Window, rects: T) -> Root<DOMRectList>
where T: Iterator<Item=Root<DOMRect>> {
reflect_dom_object(box DOMRectList::new_inherited(window, rects),
reflect_dom_object(box DOMRectList::new_inherited(rects),
GlobalRef::Window(window), DOMRectListBinding::Wrap)
}
}
Expand Down

0 comments on commit c90be8e

Please sign in to comment.