mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make ClientRectList::rects a Vec.
This commit is contained in:
parent
0bfbe06f4b
commit
50ab85f3ee
1 changed files with 4 additions and 4 deletions
|
@ -11,13 +11,13 @@ use dom::window::Window;
|
||||||
#[deriving(Encodable)]
|
#[deriving(Encodable)]
|
||||||
pub struct ClientRectList {
|
pub struct ClientRectList {
|
||||||
pub reflector_: Reflector,
|
pub reflector_: Reflector,
|
||||||
pub rects: ~[JS<ClientRect>],
|
pub rects: Vec<JS<ClientRect>>,
|
||||||
pub window: JS<Window>,
|
pub window: JS<Window>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ClientRectList {
|
impl ClientRectList {
|
||||||
pub fn new_inherited(window: JS<Window>,
|
pub fn new_inherited(window: JS<Window>,
|
||||||
rects: ~[JS<ClientRect>]) -> ClientRectList {
|
rects: Vec<JS<ClientRect>>) -> ClientRectList {
|
||||||
ClientRectList {
|
ClientRectList {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
rects: rects,
|
rects: rects,
|
||||||
|
@ -26,7 +26,7 @@ impl ClientRectList {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(window: &JS<Window>,
|
pub fn new(window: &JS<Window>,
|
||||||
rects: ~[JS<ClientRect>]) -> JS<ClientRectList> {
|
rects: Vec<JS<ClientRect>>) -> JS<ClientRectList> {
|
||||||
reflect_dom_object(~ClientRectList::new_inherited(window.clone(), rects),
|
reflect_dom_object(~ClientRectList::new_inherited(window.clone(), rects),
|
||||||
window, ClientRectListBinding::Wrap)
|
window, ClientRectListBinding::Wrap)
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ impl ClientRectList {
|
||||||
|
|
||||||
pub fn Item(&self, index: u32) -> Option<JS<ClientRect>> {
|
pub fn Item(&self, index: u32) -> Option<JS<ClientRect>> {
|
||||||
if index < self.rects.len() as u32 {
|
if index < self.rects.len() as u32 {
|
||||||
Some(self.rects[index as uint].clone())
|
Some(self.rects.get(index as uint).clone())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue