mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
DOM bindings: Autogenerate list of prototypes and binding registration goop.
This commit is contained in:
parent
65f9aefb78
commit
4f24ef1619
12 changed files with 262 additions and 84 deletions
|
@ -2,8 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache};
|
||||
use script_task::global_script_context;
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject};
|
||||
use script_task::{global_script_context, task_from_context};
|
||||
|
||||
use js::jsapi::{JSContext, JSObject};
|
||||
|
||||
|
@ -28,6 +28,15 @@ impl WindowProxy {
|
|||
}
|
||||
}
|
||||
|
||||
impl BindingObject for WindowProxy {
|
||||
fn GetParentObject(&self, cx: *JSContext) -> @mut CacheableWrapper {
|
||||
let script_context = task_from_context(cx);
|
||||
unsafe {
|
||||
(*script_context).root_frame.get_ref().window as @mut CacheableWrapper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CacheableWrapper for WindowProxy {
|
||||
fn get_wrappercache(&mut self) -> &mut WrapperCache {
|
||||
return self.get_wrappercache()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue