Merge pull request #2832 from Ms2ger/nodelist-window

Remove the unused window fields from NodeList and HTMLCollection; r=Manishearth
This commit is contained in:
Ms2ger 2014-07-14 18:21:57 +02:00
commit c8760d0228
2 changed files with 4 additions and 9 deletions

View file

@ -34,20 +34,18 @@ pub enum CollectionTypeId {
pub struct HTMLCollection { pub struct HTMLCollection {
collection: CollectionTypeId, collection: CollectionTypeId,
reflector_: Reflector, reflector_: Reflector,
window: JS<Window>,
} }
impl HTMLCollection { impl HTMLCollection {
pub fn new_inherited(window: &JSRef<Window>, collection: CollectionTypeId) -> HTMLCollection { pub fn new_inherited(collection: CollectionTypeId) -> HTMLCollection {
HTMLCollection { HTMLCollection {
collection: collection, collection: collection,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: JS::from_rooted(window),
} }
} }
pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> { pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> {
reflect_dom_object(box HTMLCollection::new_inherited(window, collection), reflect_dom_object(box HTMLCollection::new_inherited(collection),
window, HTMLCollectionBinding::Wrap) window, HTMLCollectionBinding::Wrap)
} }
} }

View file

@ -18,22 +18,19 @@ pub enum NodeListType {
pub struct NodeList { pub struct NodeList {
list_type: NodeListType, list_type: NodeListType,
reflector_: Reflector, reflector_: Reflector,
window: JS<Window>
} }
impl NodeList { impl NodeList {
pub fn new_inherited(window: &JSRef<Window>, pub fn new_inherited(list_type: NodeListType) -> NodeList {
list_type: NodeListType) -> NodeList {
NodeList { NodeList {
list_type: list_type, list_type: list_type,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: JS::from_rooted(window)
} }
} }
pub fn new(window: &JSRef<Window>, pub fn new(window: &JSRef<Window>,
list_type: NodeListType) -> Temporary<NodeList> { list_type: NodeListType) -> Temporary<NodeList> {
reflect_dom_object(box NodeList::new_inherited(window, list_type), reflect_dom_object(box NodeList::new_inherited(list_type),
window, NodeListBinding::Wrap) window, NodeListBinding::Wrap)
} }