mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove window field from domrectlist
This commit is contained in:
parent
e06eaa0064
commit
c90be8e1dc
1 changed files with 2 additions and 4 deletions
|
@ -14,22 +14,20 @@ use dom::window::Window;
|
||||||
pub struct DOMRectList {
|
pub struct DOMRectList {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
rects: Vec<JS<DOMRect>>,
|
rects: Vec<JS<DOMRect>>,
|
||||||
window: JS<Window>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DOMRectList {
|
impl DOMRectList {
|
||||||
fn new_inherited<T>(window: &Window, rects: T) -> DOMRectList
|
fn new_inherited<T>(rects: T) -> DOMRectList
|
||||||
where T: Iterator<Item=Root<DOMRect>> {
|
where T: Iterator<Item=Root<DOMRect>> {
|
||||||
DOMRectList {
|
DOMRectList {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
rects: rects.map(|r| JS::from_rooted(&r)).collect(),
|
rects: rects.map(|r| JS::from_rooted(&r)).collect(),
|
||||||
window: JS::from_ref(window),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new<T>(window: &Window, rects: T) -> Root<DOMRectList>
|
pub fn new<T>(window: &Window, rects: T) -> Root<DOMRectList>
|
||||||
where T: Iterator<Item=Root<DOMRect>> {
|
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)
|
GlobalRef::Window(window), DOMRectListBinding::Wrap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue