mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Move the call to RegisterBindings::Register into WindowBinding::Wrap.
This commit is contained in:
parent
5baff0cc2c
commit
ac5a2767bf
2 changed files with 4 additions and 6 deletions
|
@ -1821,9 +1821,12 @@ Temporary::new(raw)""" % CreateBindingJSObject(self.descriptor, "scope"))
|
||||||
with_compartment(aCx, obj, || {
|
with_compartment(aCx, obj, || {
|
||||||
let proto = GetProtoObject(aCx, obj, obj);
|
let proto = GetProtoObject(aCx, obj, obj);
|
||||||
JS_SetPrototype(aCx, obj, proto);
|
JS_SetPrototype(aCx, obj, proto);
|
||||||
});
|
|
||||||
raw.reflector().set_jsobject(obj);
|
raw.reflector().set_jsobject(obj);
|
||||||
|
|
||||||
|
RegisterBindings::Register(aCx, obj);
|
||||||
|
});
|
||||||
|
|
||||||
Temporary::new(raw)""" % CreateBindingJSObject(self.descriptor))
|
Temporary::new(raw)""" % CreateBindingJSObject(self.descriptor))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
//! The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing
|
//! The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing
|
||||||
//! and layout tasks.
|
//! and layout tasks.
|
||||||
|
|
||||||
use dom::bindings::codegen::RegisterBindings;
|
|
||||||
use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, EventCast};
|
use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, EventCast};
|
||||||
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable};
|
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable};
|
||||||
use dom::bindings::js::OptionalRootable;
|
use dom::bindings::js::OptionalRootable;
|
||||||
|
@ -548,10 +547,6 @@ impl ScriptTask {
|
||||||
let document = Document::new(&*window, Some(url.clone()), HTMLDocument, None).root();
|
let document = Document::new(&*window, Some(url.clone()), HTMLDocument, None).root();
|
||||||
window.deref().init_browser_context(&*document);
|
window.deref().init_browser_context(&*document);
|
||||||
|
|
||||||
with_compartment((**cx).ptr, window.reflector().get_jsobject(), || {
|
|
||||||
RegisterBindings::Register(window.get_cx(), window.reflector().get_jsobject());
|
|
||||||
});
|
|
||||||
|
|
||||||
self.compositor.set_ready_state(Loading);
|
self.compositor.set_ready_state(Loading);
|
||||||
// Parse HTML.
|
// Parse HTML.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue