mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update for language changes
This commit is contained in:
parent
a01f6b97f2
commit
56e5ba1b82
109 changed files with 1182 additions and 988 deletions
|
@ -8,13 +8,15 @@ use dom::node::{AbstractNode, ScriptView};
|
|||
|
||||
use js::jsapi::{JSObject, JSContext};
|
||||
|
||||
use std::ptr;
|
||||
|
||||
pub struct HTMLCollection {
|
||||
elements: ~[AbstractNode<ScriptView>],
|
||||
wrapper: WrapperCache
|
||||
}
|
||||
|
||||
pub impl HTMLCollection {
|
||||
fn new(elements: ~[AbstractNode<ScriptView>]) -> @mut HTMLCollection {
|
||||
impl HTMLCollection {
|
||||
pub fn new(elements: ~[AbstractNode<ScriptView>]) -> @mut HTMLCollection {
|
||||
let collection = @mut HTMLCollection {
|
||||
elements: elements,
|
||||
wrapper: WrapperCache::new()
|
||||
|
@ -23,11 +25,11 @@ pub impl HTMLCollection {
|
|||
collection
|
||||
}
|
||||
|
||||
fn Length(&self) -> u32 {
|
||||
pub fn Length(&self) -> u32 {
|
||||
self.elements.len() as u32
|
||||
}
|
||||
|
||||
fn Item(&self, index: u32) -> Option<AbstractNode<ScriptView>> {
|
||||
pub fn Item(&self, index: u32) -> Option<AbstractNode<ScriptView>> {
|
||||
if index < self.Length() {
|
||||
Some(self.elements[index])
|
||||
} else {
|
||||
|
@ -35,12 +37,12 @@ pub impl HTMLCollection {
|
|||
}
|
||||
}
|
||||
|
||||
fn NamedItem(&self, _cx: *JSContext, _name: DOMString, rv: &mut ErrorResult) -> *JSObject {
|
||||
pub fn NamedItem(&self, _cx: *JSContext, _name: DOMString, rv: &mut ErrorResult) -> *JSObject {
|
||||
*rv = Ok(());
|
||||
ptr::null()
|
||||
}
|
||||
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<AbstractNode<ScriptView>> {
|
||||
pub fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<AbstractNode<ScriptView>> {
|
||||
*found = true;
|
||||
self.Item(index)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue