mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Merge BindingObject and Reflectable.
This commit is contained in:
parent
f585d218cb
commit
321e0373fa
23 changed files with 62 additions and 200 deletions
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLCollectionBinding;
|
||||
use dom::bindings::utils::{Reflectable, BindingObject, Reflector};
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use script_task::page_from_context;
|
||||
|
@ -57,16 +57,6 @@ impl HTMLCollection {
|
|||
}
|
||||
}
|
||||
|
||||
impl BindingObject for HTMLCollection {
|
||||
fn GetParentObject(&self, cx: *JSContext) -> Option<@mut Reflectable> {
|
||||
let page = page_from_context(cx);
|
||||
// TODO(tkuehn): This only handles the top-level frame. Need to grab subframes.
|
||||
unsafe {
|
||||
Some((*page).frame.get_ref().window as @mut Reflectable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Reflectable for HTMLCollection {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
&self.reflector_
|
||||
|
@ -79,4 +69,12 @@ impl Reflectable for HTMLCollection {
|
|||
fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
|
||||
HTMLCollectionBinding::Wrap(cx, scope, self)
|
||||
}
|
||||
|
||||
fn GetParentObject(&self, cx: *JSContext) -> Option<@mut Reflectable> {
|
||||
let page = page_from_context(cx);
|
||||
// TODO(tkuehn): This only handles the top-level frame. Need to grab subframes.
|
||||
unsafe {
|
||||
Some((*page).frame.get_ref().window as @mut Reflectable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue