mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add Event and EventTarget hierarchy via gross AbstractFoo mechanism.
This commit is contained in:
parent
7ecf5abbbd
commit
bb97fd13f3
9 changed files with 327 additions and 86 deletions
|
@ -768,6 +768,7 @@ pub enum Error {
|
|||
NotFound,
|
||||
HierarchyRequest,
|
||||
InvalidCharacter,
|
||||
NotSupported
|
||||
}
|
||||
|
||||
pub type Fallible<T> = Result<T, Error>;
|
||||
|
@ -841,7 +842,7 @@ pub fn CreateDOMGlobal(cx: *JSContext, class: *JSClass) -> *JSObject {
|
|||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
fn cx_for_dom_wrapper(obj: *JSObject) -> *JSContext {
|
||||
fn cx_for_dom_reflector(obj: *JSObject) -> *JSContext {
|
||||
unsafe {
|
||||
let global = GetGlobalForObjectCrossCompartment(obj);
|
||||
let clasp = JS_GetClass(global);
|
||||
|
@ -860,8 +861,8 @@ fn cx_for_dom_wrapper(obj: *JSObject) -> *JSContext {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn cx_for_dom_object<T: Reflectable>(obj: @mut T) -> *JSContext {
|
||||
cx_for_dom_wrapper(obj.reflector().get_jsobject())
|
||||
pub fn cx_for_dom_object<T: Reflectable>(obj: &mut T) -> *JSContext {
|
||||
cx_for_dom_reflector(obj.reflector().get_jsobject())
|
||||
}
|
||||
|
||||
/// Check if an element name is valid. See http://www.w3.org/TR/xml/#NT-Name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue