mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Merge pull request #2832 from Ms2ger/nodelist-window
Remove the unused window fields from NodeList and HTMLCollection; r=Manishearth
This commit is contained in:
commit
c8760d0228
2 changed files with 4 additions and 9 deletions
|
@ -34,20 +34,18 @@ pub enum CollectionTypeId {
|
|||
pub struct HTMLCollection {
|
||||
collection: CollectionTypeId,
|
||||
reflector_: Reflector,
|
||||
window: JS<Window>,
|
||||
}
|
||||
|
||||
impl HTMLCollection {
|
||||
pub fn new_inherited(window: &JSRef<Window>, collection: CollectionTypeId) -> HTMLCollection {
|
||||
pub fn new_inherited(collection: CollectionTypeId) -> HTMLCollection {
|
||||
HTMLCollection {
|
||||
collection: collection,
|
||||
reflector_: Reflector::new(),
|
||||
window: JS::from_rooted(window),
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,22 +18,19 @@ pub enum NodeListType {
|
|||
pub struct NodeList {
|
||||
list_type: NodeListType,
|
||||
reflector_: Reflector,
|
||||
window: JS<Window>
|
||||
}
|
||||
|
||||
impl NodeList {
|
||||
pub fn new_inherited(window: &JSRef<Window>,
|
||||
list_type: NodeListType) -> NodeList {
|
||||
pub fn new_inherited(list_type: NodeListType) -> NodeList {
|
||||
NodeList {
|
||||
list_type: list_type,
|
||||
reflector_: Reflector::new(),
|
||||
window: JS::from_rooted(window)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(window: &JSRef<Window>,
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue