aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/element.rs
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-10-11 07:51:59 -0700
committerbors-servo <release+servo@mozilla.com>2013-10-11 07:51:59 -0700
commitfc9fdf30a6b4b4437cfe7a624c52c9a8b5e5a645 (patch)
tree81e44e4c34830ca94d5dd7d21f4e5e19f85f43ad /src/components/script/dom/element.rs
parentbc3eeb6f1c1b643df72b787ef772f20bcc094856 (diff)
parent9fe9145be4386ae38facc029946678fb0a54c2f7 (diff)
downloadservo-fc9fdf30a6b4b4437cfe7a624c52c9a8b5e5a645.tar.gz
servo-fc9fdf30a6b4b4437cfe7a624c52c9a8b5e5a645.zip
auto merge of #1018 : ttaubert/servo/nodelist, r=jdm
This should fix #652 and #775. I'm not sure if that's all that is needed to properly implement NodeList? Should we add tests somewhere? Sorry for any stupid stuff I might have done :) r? @jdm
Diffstat (limited to 'src/components/script/dom/element.rs')
-rw-r--r--src/components/script/dom/element.rs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index 7f0857894b9..51d7c609c98 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -192,14 +192,6 @@ impl<'self> Element {
}
}
}
-
- fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) {
- let doc = self.node.owner_doc;
- let win = doc.with_base(|doc| doc.window.unwrap());
- let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
- let scope = win.reflector().get_jsobject();
- (scope, cx)
- }
}
impl Element {
@@ -251,17 +243,17 @@ impl Element {
}
pub fn GetElementsByTagName(&self, _localname: &DOMString) -> @mut HTMLCollection {
- let (scope, cx) = self.get_scope_and_cx();
+ let (scope, cx) = self.node.get_scope_and_cx();
HTMLCollection::new(~[], cx, scope)
}
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString) -> Fallible<@mut HTMLCollection> {
- let (scope, cx) = self.get_scope_and_cx();
+ let (scope, cx) = self.node.get_scope_and_cx();
Ok(HTMLCollection::new(~[], cx, scope))
}
pub fn GetElementsByClassName(&self, _names: &DOMString) -> @mut HTMLCollection {
- let (scope, cx) = self.get_scope_and_cx();
+ let (scope, cx) = self.node.get_scope_and_cx();
HTMLCollection::new(~[], cx, scope)
}