mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #9652 - nox:lazy-interface-object, r=Ms2ger
Lazily define interface objects on globals (fixes #6419) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9652) <!-- Reviewable:end -->
This commit is contained in:
commit
b188cb542e
14 changed files with 260 additions and 105 deletions
|
@ -79,6 +79,8 @@ libc = "0.2"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
num = "0.1.24"
|
num = "0.1.24"
|
||||||
rand = "0.3"
|
rand = "0.3"
|
||||||
|
phf = "0.7.13"
|
||||||
|
phf_macros = "0.7.13"
|
||||||
ref_slice = "0.1.0"
|
ref_slice = "0.1.0"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
selectors = {version = "0.5", features = ["heap_size"]}
|
selectors = {version = "0.5", features = ["heap_size"]}
|
||||||
|
|
|
@ -1768,17 +1768,21 @@ class CGDOMJSClass(CGThing):
|
||||||
def define(self):
|
def define(self):
|
||||||
args = {
|
args = {
|
||||||
"domClass": DOMClass(self.descriptor),
|
"domClass": DOMClass(self.descriptor),
|
||||||
|
"enumerateHook": "None",
|
||||||
"finalizeHook": FINALIZE_HOOK_NAME,
|
"finalizeHook": FINALIZE_HOOK_NAME,
|
||||||
"flags": "0",
|
"flags": "0",
|
||||||
"name": str_to_const_array(self.descriptor.interface.identifier.name),
|
"name": str_to_const_array(self.descriptor.interface.identifier.name),
|
||||||
"outerObjectHook": self.descriptor.outerObjectHook,
|
"outerObjectHook": self.descriptor.outerObjectHook,
|
||||||
|
"resolveHook": "None",
|
||||||
"slots": "1",
|
"slots": "1",
|
||||||
"traceHook": TRACE_HOOK_NAME,
|
"traceHook": TRACE_HOOK_NAME,
|
||||||
}
|
}
|
||||||
if self.descriptor.isGlobal():
|
if self.descriptor.isGlobal():
|
||||||
assert not self.descriptor.weakReferenceable
|
assert not self.descriptor.weakReferenceable
|
||||||
|
args["enumerateHook"] = "Some(enumerate_global)"
|
||||||
args["flags"] = "JSCLASS_IS_GLOBAL | JSCLASS_DOM_GLOBAL"
|
args["flags"] = "JSCLASS_IS_GLOBAL | JSCLASS_DOM_GLOBAL"
|
||||||
args["slots"] = "JSCLASS_GLOBAL_SLOT_COUNT + 1"
|
args["slots"] = "JSCLASS_GLOBAL_SLOT_COUNT + 1"
|
||||||
|
args["resolveHook"] = "Some(resolve_global)"
|
||||||
args["traceHook"] = "js::jsapi::JS_GlobalObjectTraceHook"
|
args["traceHook"] = "js::jsapi::JS_GlobalObjectTraceHook"
|
||||||
elif self.descriptor.weakReferenceable:
|
elif self.descriptor.weakReferenceable:
|
||||||
args["slots"] = "2"
|
args["slots"] = "2"
|
||||||
|
@ -1793,8 +1797,8 @@ static Class: DOMJSClass = DOMJSClass {
|
||||||
delProperty: None,
|
delProperty: None,
|
||||||
getProperty: None,
|
getProperty: None,
|
||||||
setProperty: None,
|
setProperty: None,
|
||||||
enumerate: None,
|
enumerate: %(enumerateHook)s,
|
||||||
resolve: None,
|
resolve: %(resolveHook)s,
|
||||||
convert: None,
|
convert: None,
|
||||||
finalize: Some(%(finalizeHook)s),
|
finalize: Some(%(finalizeHook)s),
|
||||||
call: None,
|
call: None,
|
||||||
|
@ -2276,11 +2280,8 @@ JS_SetPrototype(cx, obj.handle(), proto.handle());
|
||||||
%(copyUnforgeable)s
|
%(copyUnforgeable)s
|
||||||
(*raw).init_reflector(obj.ptr);
|
(*raw).init_reflector(obj.ptr);
|
||||||
|
|
||||||
let ret = Root::from_ref(&*raw);
|
Root::from_ref(&*raw)\
|
||||||
|
""" % {'copyUnforgeable': unforgeable, 'createObject': create})
|
||||||
RegisterBindings::Register(cx, obj.handle());
|
|
||||||
|
|
||||||
ret""" % {'copyUnforgeable': unforgeable, 'createObject': create})
|
|
||||||
|
|
||||||
|
|
||||||
class CGIDLInterface(CGThing):
|
class CGIDLInterface(CGThing):
|
||||||
|
@ -2375,9 +2376,8 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
properties should be a PropertyArrays instance.
|
properties should be a PropertyArrays instance.
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor, properties):
|
def __init__(self, descriptor, properties):
|
||||||
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'global')]
|
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'global'),
|
||||||
if not descriptor.interface.isCallback():
|
Argument('*mut ProtoOrIfaceArray', 'cache')]
|
||||||
args.append(Argument('*mut ProtoOrIfaceArray', 'cache'))
|
|
||||||
CGAbstractMethod.__init__(self, descriptor, 'CreateInterfaceObjects', 'void', args,
|
CGAbstractMethod.__init__(self, descriptor, 'CreateInterfaceObjects', 'void', args,
|
||||||
unsafe=True)
|
unsafe=True)
|
||||||
self.properties = properties
|
self.properties = properties
|
||||||
|
@ -2387,7 +2387,14 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
if self.descriptor.interface.isCallback():
|
if self.descriptor.interface.isCallback():
|
||||||
assert not self.descriptor.interface.ctor() and self.descriptor.interface.hasConstants()
|
assert not self.descriptor.interface.ctor() and self.descriptor.interface.hasConstants()
|
||||||
return CGGeneric("""\
|
return CGGeneric("""\
|
||||||
create_callback_interface_object(cx, global, sConstants, %s);""" % str_to_const_array(name))
|
let mut interface = RootedObject::new(cx, ptr::null_mut());
|
||||||
|
create_callback_interface_object(cx, global, sConstants, %(name)s, interface.handle_mut());
|
||||||
|
assert!(!interface.ptr.is_null());
|
||||||
|
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.ptr;
|
||||||
|
if <*mut JSObject>::needs_post_barrier(interface.ptr) {
|
||||||
|
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::%(id)s as isize));
|
||||||
|
}
|
||||||
|
""" % {"id": name, "name": str_to_const_array(name)})
|
||||||
|
|
||||||
if len(self.descriptor.prototypeChain) == 1:
|
if len(self.descriptor.prototypeChain) == 1:
|
||||||
if self.descriptor.interface.getExtendedAttribute("ExceptionClass"):
|
if self.descriptor.interface.getExtendedAttribute("ExceptionClass"):
|
||||||
|
@ -2668,14 +2675,14 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
if self.descriptor.interface.isCallback():
|
if self.descriptor.interface.isCallback():
|
||||||
code = "CreateInterfaceObjects(cx, global);"
|
function = "GetConstructorObject"
|
||||||
else:
|
else:
|
||||||
code = """\
|
function = "GetProtoObject"
|
||||||
|
return CGGeneric("""\
|
||||||
|
assert!(!global.get().is_null());
|
||||||
let mut proto = RootedObject::new(cx, ptr::null_mut());
|
let mut proto = RootedObject::new(cx, ptr::null_mut());
|
||||||
GetProtoObject(cx, global, proto.handle_mut());
|
%s(cx, global, proto.handle_mut());
|
||||||
assert!(!proto.ptr.is_null());
|
assert!(!proto.ptr.is_null());""" % function)
|
||||||
"""
|
|
||||||
return CGGeneric("assert!(!global.get().is_null());\n" + code)
|
|
||||||
|
|
||||||
|
|
||||||
def needCx(returnType, arguments, considerTypes):
|
def needCx(returnType, arguments, considerTypes):
|
||||||
|
@ -4952,7 +4959,8 @@ class CGDescriptor(CGThing):
|
||||||
cgThings = []
|
cgThings = []
|
||||||
if not descriptor.interface.isCallback():
|
if not descriptor.interface.isCallback():
|
||||||
cgThings.append(CGGetProtoObjectMethod(descriptor))
|
cgThings.append(CGGetProtoObjectMethod(descriptor))
|
||||||
if descriptor.interface.hasInterfaceObject() and descriptor.hasDescendants():
|
if (descriptor.interface.hasInterfaceObject() and
|
||||||
|
descriptor.shouldHaveGetConstructorObjectMethod()):
|
||||||
cgThings.append(CGGetConstructorObjectMethod(descriptor))
|
cgThings.append(CGGetConstructorObjectMethod(descriptor))
|
||||||
|
|
||||||
for m in descriptor.interface.members:
|
for m in descriptor.interface.members:
|
||||||
|
@ -5277,23 +5285,6 @@ class CGDictionary(CGThing):
|
||||||
return deps
|
return deps
|
||||||
|
|
||||||
|
|
||||||
class CGRegisterProtos(CGAbstractMethod):
|
|
||||||
def __init__(self, config):
|
|
||||||
arguments = [
|
|
||||||
Argument('*mut JSContext', 'cx'),
|
|
||||||
Argument('HandleObject', 'global'),
|
|
||||||
]
|
|
||||||
CGAbstractMethod.__init__(self, None, 'Register', 'void', arguments,
|
|
||||||
unsafe=False, pub=True)
|
|
||||||
self.config = config
|
|
||||||
|
|
||||||
def definition_body(self):
|
|
||||||
return CGList([
|
|
||||||
CGGeneric("codegen::Bindings::%sBinding::DefineDOMInterface(cx, global);" % desc.name)
|
|
||||||
for desc in self.config.getDescriptors(hasInterfaceObject=True, register=True)
|
|
||||||
], "\n")
|
|
||||||
|
|
||||||
|
|
||||||
class CGRegisterProxyHandlersMethod(CGAbstractMethod):
|
class CGRegisterProxyHandlersMethod(CGAbstractMethod):
|
||||||
def __init__(self, descriptors):
|
def __init__(self, descriptors):
|
||||||
docs = "Create the global vtables used by the generated DOM bindings to implement JS proxies."
|
docs = "Create the global vtables used by the generated DOM bindings to implement JS proxies."
|
||||||
|
@ -5436,12 +5427,12 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::bindings::utils::{DOMClass, DOMJSClass}',
|
'dom::bindings::utils::{DOMClass, DOMJSClass}',
|
||||||
'dom::bindings::utils::{DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, JSCLASS_DOM_GLOBAL}',
|
'dom::bindings::utils::{DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, JSCLASS_DOM_GLOBAL}',
|
||||||
'dom::bindings::utils::{ProtoOrIfaceArray, create_dom_global}',
|
'dom::bindings::utils::{ProtoOrIfaceArray, create_dom_global}',
|
||||||
'dom::bindings::utils::{finalize_global, find_enum_string_index, generic_getter}',
|
'dom::bindings::utils::{enumerate_global, finalize_global, find_enum_string_index}',
|
||||||
'dom::bindings::utils::{generic_lenient_getter, generic_lenient_setter}',
|
'dom::bindings::utils::{generic_getter, generic_lenient_getter, generic_lenient_setter}',
|
||||||
'dom::bindings::utils::{generic_method, generic_setter, get_array_index_from_id}',
|
'dom::bindings::utils::{generic_method, generic_setter, get_array_index_from_id}',
|
||||||
'dom::bindings::utils::{get_dictionary_property, get_property_on_prototype}',
|
'dom::bindings::utils::{get_dictionary_property, get_property_on_prototype}',
|
||||||
'dom::bindings::utils::{get_proto_or_iface_array, has_property_on_prototype}',
|
'dom::bindings::utils::{get_proto_or_iface_array, has_property_on_prototype}',
|
||||||
'dom::bindings::utils::{is_platform_object, set_dictionary_property}',
|
'dom::bindings::utils::{is_platform_object, resolve_global, set_dictionary_property}',
|
||||||
'dom::bindings::utils::{throwing_constructor, trace_global}',
|
'dom::bindings::utils::{throwing_constructor, trace_global}',
|
||||||
'dom::bindings::trace::{JSTraceable, RootedTraceable}',
|
'dom::bindings::trace::{JSTraceable, RootedTraceable}',
|
||||||
'dom::bindings::callback::{CallbackContainer,CallbackInterface,CallbackFunction}',
|
'dom::bindings::callback::{CallbackContainer,CallbackInterface,CallbackFunction}',
|
||||||
|
@ -6084,12 +6075,44 @@ class GlobalGenRoots():
|
||||||
call the appropriate define/declare method.
|
call the appropriate define/declare method.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def InterfaceObjectMap(config):
|
||||||
|
mods = [
|
||||||
|
"dom::bindings::codegen",
|
||||||
|
"js::jsapi::{HandleObject, JSContext}",
|
||||||
|
"phf",
|
||||||
|
]
|
||||||
|
imports = CGList([CGGeneric("use %s;" % mod) for mod in mods], "\n")
|
||||||
|
|
||||||
|
pairs = []
|
||||||
|
for d in config.getDescriptors(hasInterfaceObject=True):
|
||||||
|
binding = toBindingNamespace(d.name)
|
||||||
|
pairs.append((d.name, binding))
|
||||||
|
for ctor in d.interface.namedConstructors:
|
||||||
|
pairs.append((ctor.identifier.name, binding))
|
||||||
|
pairs.sort(key=operator.itemgetter(0))
|
||||||
|
mappings = [
|
||||||
|
CGGeneric('b"%s" => codegen::Bindings::%s::DefineDOMInterface as fn(_, _),' % pair)
|
||||||
|
for pair in pairs
|
||||||
|
]
|
||||||
|
mapType = "phf::Map<&'static [u8], fn(*mut JSContext, HandleObject)>"
|
||||||
|
phf = CGWrapper(
|
||||||
|
CGIndenter(CGList(mappings, "\n")),
|
||||||
|
pre="pub static MAP: %s = phf_map! {\n" % mapType,
|
||||||
|
post="\n};\n")
|
||||||
|
|
||||||
|
return CGList([
|
||||||
|
CGGeneric(AUTOGENERATED_WARNING_COMMENT),
|
||||||
|
CGList([imports, phf], "\n\n")
|
||||||
|
])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def PrototypeList(config):
|
def PrototypeList(config):
|
||||||
# Prototype ID enum.
|
# Prototype ID enum.
|
||||||
interfaces = config.getDescriptors(isCallback=False)
|
interfaces = config.getDescriptors(isCallback=False)
|
||||||
protos = [d.name for d in interfaces]
|
protos = [d.name for d in interfaces]
|
||||||
constructors = [d.name for d in interfaces if d.hasDescendants()]
|
constructors = [d.name for d in config.getDescriptors(hasInterfaceObject=True)
|
||||||
|
if d.shouldHaveGetConstructorObjectMethod()]
|
||||||
proxies = [d.name for d in config.getDescriptors(proxy=True)]
|
proxies = [d.name for d in config.getDescriptors(proxy=True)]
|
||||||
|
|
||||||
return CGList([
|
return CGList([
|
||||||
|
@ -6115,15 +6138,12 @@ class GlobalGenRoots():
|
||||||
def RegisterBindings(config):
|
def RegisterBindings(config):
|
||||||
# TODO - Generate the methods we want
|
# TODO - Generate the methods we want
|
||||||
code = CGList([
|
code = CGList([
|
||||||
CGRegisterProtos(config),
|
|
||||||
CGRegisterProxyHandlers(config),
|
CGRegisterProxyHandlers(config),
|
||||||
], "\n")
|
], "\n")
|
||||||
|
|
||||||
return CGImports(code, [], [], [
|
return CGImports(code, [], [], [
|
||||||
'dom::bindings::codegen',
|
'dom::bindings::codegen',
|
||||||
'dom::bindings::codegen::PrototypeList::Proxies',
|
'dom::bindings::codegen::PrototypeList::Proxies',
|
||||||
'js::jsapi::JSContext',
|
|
||||||
'js::jsapi::HandleObject',
|
|
||||||
'libc',
|
'libc',
|
||||||
], ignored_warnings=[])
|
], ignored_warnings=[])
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,10 @@ class Descriptor(DescriptorProvider):
|
||||||
return (self.interface.getUserData("hasConcreteDescendant", False) or
|
return (self.interface.getUserData("hasConcreteDescendant", False) or
|
||||||
self.interface.getUserData("hasProxyDescendant", False))
|
self.interface.getUserData("hasProxyDescendant", False))
|
||||||
|
|
||||||
|
def shouldHaveGetConstructorObjectMethod(self):
|
||||||
|
assert self.interface.hasInterfaceObject()
|
||||||
|
return self.interface.isCallback() or self.hasDescendants()
|
||||||
|
|
||||||
def isGlobal(self):
|
def isGlobal(self):
|
||||||
"""
|
"""
|
||||||
Returns true if this is the primary interface for a global object
|
Returns true if this is the primary interface for a global object
|
||||||
|
|
|
@ -62,6 +62,7 @@ def main():
|
||||||
to_generate = [
|
to_generate = [
|
||||||
('PrototypeList', 'PrototypeList.rs'),
|
('PrototypeList', 'PrototypeList.rs'),
|
||||||
('RegisterBindings', 'RegisterBindings.rs'),
|
('RegisterBindings', 'RegisterBindings.rs'),
|
||||||
|
('InterfaceObjectMap', 'InterfaceObjectMap.rs'),
|
||||||
('InterfaceTypes', 'InterfaceTypes.rs'),
|
('InterfaceTypes', 'InterfaceTypes.rs'),
|
||||||
('InheritTypes', 'InheritTypes.rs'),
|
('InheritTypes', 'InheritTypes.rs'),
|
||||||
('Bindings', os.path.join('Bindings', 'mod.rs')),
|
('Bindings', os.path.join('Bindings', 'mod.rs')),
|
||||||
|
|
|
@ -178,13 +178,14 @@ pub unsafe fn create_callback_interface_object(
|
||||||
cx: *mut JSContext,
|
cx: *mut JSContext,
|
||||||
receiver: HandleObject,
|
receiver: HandleObject,
|
||||||
constants: &'static [ConstantSpec],
|
constants: &'static [ConstantSpec],
|
||||||
name: &'static [u8]) {
|
name: &'static [u8],
|
||||||
|
rval: MutableHandleObject) {
|
||||||
assert!(!constants.is_empty());
|
assert!(!constants.is_empty());
|
||||||
let interface_object = RootedObject::new(cx, JS_NewObject(cx, ptr::null()));
|
rval.set(JS_NewObject(cx, ptr::null()));
|
||||||
assert!(!interface_object.ptr.is_null());
|
assert!(!rval.ptr.is_null());
|
||||||
define_constants(cx, interface_object.handle(), constants);
|
define_constants(cx, rval.handle(), constants);
|
||||||
define_name(cx, interface_object.handle(), name);
|
define_name(cx, rval.handle(), name);
|
||||||
define_on_global_object(cx, receiver, name, interface_object.handle());
|
define_on_global_object(cx, receiver, name, rval.handle());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create the interface prototype object of a non-callback interface.
|
/// Create the interface prototype object of a non-callback interface.
|
||||||
|
|
|
@ -159,6 +159,9 @@ pub mod codegen {
|
||||||
pub mod Bindings {
|
pub mod Bindings {
|
||||||
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
|
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
|
||||||
}
|
}
|
||||||
|
pub mod InterfaceObjectMap {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/InterfaceObjectMap.rs"));
|
||||||
|
}
|
||||||
pub mod InterfaceTypes {
|
pub mod InterfaceTypes {
|
||||||
include!(concat!(env!("OUT_DIR"), "/InterfaceTypes.rs"));
|
include!(concat!(env!("OUT_DIR"), "/InterfaceTypes.rs"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
//! Various utilities to glue JavaScript and the DOM implementation together.
|
//! Various utilities to glue JavaScript and the DOM implementation together.
|
||||||
|
|
||||||
|
use dom::bindings::codegen::InterfaceObjectMap;
|
||||||
use dom::bindings::codegen::PrototypeList;
|
use dom::bindings::codegen::PrototypeList;
|
||||||
use dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH};
|
use dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH};
|
||||||
use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class};
|
use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class};
|
||||||
|
@ -18,17 +19,18 @@ use js;
|
||||||
use js::error::throw_type_error;
|
use js::error::throw_type_error;
|
||||||
use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper};
|
use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper};
|
||||||
use js::glue::{GetCrossCompartmentWrapper, WrapperNew};
|
use js::glue::{GetCrossCompartmentWrapper, WrapperNew};
|
||||||
use js::glue::{RUST_FUNCTION_VALUE_TO_JITINFO, RUST_JSID_IS_INT};
|
use js::glue::{RUST_FUNCTION_VALUE_TO_JITINFO, RUST_JSID_IS_INT, RUST_JSID_IS_STRING};
|
||||||
use js::glue::{RUST_JSID_TO_INT, UnwrapObject};
|
use js::glue::{RUST_JSID_TO_INT, RUST_JSID_TO_STRING, UnwrapObject};
|
||||||
use js::jsapi::{CallArgs, CompartmentOptions, DOMCallbacks, GetGlobalForObjectCrossCompartment};
|
use js::jsapi::{CallArgs, CompartmentOptions, DOMCallbacks, GetGlobalForObjectCrossCompartment};
|
||||||
use js::jsapi::{HandleId, HandleObject, HandleValue, Heap, JSAutoCompartment, JSClass, JSContext};
|
use js::jsapi::{HandleId, HandleObject, HandleValue, Heap, JSAutoCompartment, JSClass, JSContext};
|
||||||
use js::jsapi::{JSJitInfo, JSObject, JSTraceOp, JSTracer, JSVersion, JSWrapObjectCallbacks};
|
use js::jsapi::{JSJitInfo, JSObject, JSTraceOp, JSTracer, JSVersion, JSWrapObjectCallbacks};
|
||||||
use js::jsapi::{JS_DeletePropertyById1, JS_FireOnNewGlobalObject};
|
use js::jsapi::{JS_DeletePropertyById1, JS_EnumerateStandardClasses, JS_FireOnNewGlobalObject};
|
||||||
use js::jsapi::{JS_ForwardGetPropertyTo, JS_GetClass, JS_GetProperty, JS_GetPrototype};
|
use js::jsapi::{JS_ForwardGetPropertyTo, JS_GetClass, JS_GetLatin1StringCharsAndLength};
|
||||||
use js::jsapi::{JS_GetReservedSlot, JS_HasProperty, JS_HasPropertyById, JS_InitStandardClasses};
|
use js::jsapi::{JS_GetProperty, JS_GetPrototype, JS_GetReservedSlot, JS_HasProperty};
|
||||||
use js::jsapi::{JS_IsExceptionPending, JS_NewGlobalObject, JS_ObjectToOuterObject, JS_SetProperty};
|
use js::jsapi::{JS_HasPropertyById, JS_IsExceptionPending, JS_IsGlobalObject, JS_NewGlobalObject};
|
||||||
use js::jsapi::{JS_SetReservedSlot, MutableHandleValue, ObjectOpResult, OnNewGlobalHookOption};
|
use js::jsapi::{JS_ObjectToOuterObject, JS_ResolveStandardClass, JS_SetProperty};
|
||||||
use js::jsapi::{RootedObject};
|
use js::jsapi::{JS_SetReservedSlot, JS_StringHasLatin1Chars, MutableHandleValue, ObjectOpResult};
|
||||||
|
use js::jsapi::{OnNewGlobalHookOption, RootedObject};
|
||||||
use js::jsval::{JSVal};
|
use js::jsval::{JSVal};
|
||||||
use js::jsval::{PrivateValue, UndefinedValue};
|
use js::jsval::{PrivateValue, UndefinedValue};
|
||||||
use js::rust::{GCMethods, ToString};
|
use js::rust::{GCMethods, ToString};
|
||||||
|
@ -38,6 +40,7 @@ use std::default::Default;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::os::raw::c_void;
|
use std::os::raw::c_void;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
use std::slice;
|
||||||
use util::non_geckolib::jsstring_to_str;
|
use util::non_geckolib::jsstring_to_str;
|
||||||
|
|
||||||
/// Proxy handler for a WindowProxy.
|
/// Proxy handler for a WindowProxy.
|
||||||
|
@ -334,7 +337,6 @@ pub fn create_dom_global(cx: *mut JSContext,
|
||||||
PrivateValue(Box::into_raw(proto_array) as *const libc::c_void));
|
PrivateValue(Box::into_raw(proto_array) as *const libc::c_void));
|
||||||
|
|
||||||
let _ac = JSAutoCompartment::new(cx, obj.ptr);
|
let _ac = JSAutoCompartment::new(cx, obj.ptr);
|
||||||
JS_InitStandardClasses(cx, obj.handle());
|
|
||||||
JS_FireOnNewGlobalObject(cx, obj.handle());
|
JS_FireOnNewGlobalObject(cx, obj.handle());
|
||||||
obj.ptr
|
obj.ptr
|
||||||
}
|
}
|
||||||
|
@ -366,6 +368,56 @@ pub unsafe fn trace_global(tracer: *mut JSTracer, obj: *mut JSObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Enumerate lazy properties of a global object.
|
||||||
|
pub unsafe extern "C" fn enumerate_global(cx: *mut JSContext, obj: HandleObject) -> bool {
|
||||||
|
assert!(JS_IsGlobalObject(obj.get()));
|
||||||
|
if !JS_EnumerateStandardClasses(cx, obj) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for init_fun in InterfaceObjectMap::MAP.values() {
|
||||||
|
init_fun(cx, obj);
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Resolve a lazy global property, for interface objects and named constructors.
|
||||||
|
pub unsafe extern "C" fn resolve_global(
|
||||||
|
cx: *mut JSContext,
|
||||||
|
obj: HandleObject,
|
||||||
|
id: HandleId,
|
||||||
|
rval: *mut bool)
|
||||||
|
-> bool {
|
||||||
|
assert!(JS_IsGlobalObject(obj.get()));
|
||||||
|
if !JS_ResolveStandardClass(cx, obj, id, rval) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if *rval {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if !RUST_JSID_IS_STRING(id) {
|
||||||
|
*rval = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let string = RUST_JSID_TO_STRING(id);
|
||||||
|
if !JS_StringHasLatin1Chars(string) {
|
||||||
|
*rval = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
let mut length = 0;
|
||||||
|
let ptr = JS_GetLatin1StringCharsAndLength(cx, ptr::null(), string, &mut length);
|
||||||
|
assert!(!ptr.is_null());
|
||||||
|
let bytes = slice::from_raw_parts(ptr, length as usize);
|
||||||
|
|
||||||
|
if let Some(init_fun) = InterfaceObjectMap::MAP.get(bytes) {
|
||||||
|
init_fun(cx, obj);
|
||||||
|
*rval = true;
|
||||||
|
} else {
|
||||||
|
*rval = false;
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn wrap(cx: *mut JSContext,
|
unsafe extern "C" fn wrap(cx: *mut JSContext,
|
||||||
_existing: HandleObject,
|
_existing: HandleObject,
|
||||||
obj: HandleObject)
|
obj: HandleObject)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#![doc = "The script crate contains all matters DOM."]
|
#![doc = "The script crate contains all matters DOM."]
|
||||||
|
|
||||||
#![plugin(heapsize_plugin)]
|
#![plugin(heapsize_plugin)]
|
||||||
|
#![plugin(phf_macros)]
|
||||||
#![plugin(plugins)]
|
#![plugin(plugins)]
|
||||||
|
|
||||||
extern crate angle;
|
extern crate angle;
|
||||||
|
@ -55,6 +56,7 @@ extern crate msg;
|
||||||
extern crate net_traits;
|
extern crate net_traits;
|
||||||
extern crate num;
|
extern crate num;
|
||||||
extern crate offscreen_gl_context;
|
extern crate offscreen_gl_context;
|
||||||
|
extern crate phf;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate profile_traits;
|
extern crate profile_traits;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
|
39
components/servo/Cargo.lock
generated
39
components/servo/Cargo.lock
generated
|
@ -849,8 +849,8 @@ dependencies = [
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1404,33 +1404,42 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf"
|
name = "phf"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_codegen"
|
name = "phf_codegen"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_generator"
|
name = "phf_generator"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_macros"
|
||||||
|
version = "0.7.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_shared"
|
name = "phf_shared"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1622,6 +1631,8 @@ dependencies = [
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
||||||
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_macros 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1870,8 +1881,8 @@ dependencies = [
|
||||||
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2318,8 +2329,8 @@ source = "git+https://github.com/Ygg01/xml5ever#6c7017063dc1cfd64f08b7701a689e74
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
39
ports/cef/Cargo.lock
generated
39
ports/cef/Cargo.lock
generated
|
@ -779,8 +779,8 @@ dependencies = [
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1308,33 +1308,42 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf"
|
name = "phf"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_codegen"
|
name = "phf_codegen"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_generator"
|
name = "phf_generator"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_macros"
|
||||||
|
version = "0.7.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_shared"
|
name = "phf_shared"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1508,6 +1517,8 @@ dependencies = [
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
||||||
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_macros 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1784,8 +1795,8 @@ dependencies = [
|
||||||
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2204,8 +2215,8 @@ source = "git+https://github.com/Ygg01/xml5ever#6c7017063dc1cfd64f08b7701a689e74
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
10
ports/geckolib/Cargo.lock
generated
10
ports/geckolib/Cargo.lock
generated
|
@ -277,16 +277,16 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_generator"
|
name = "phf_generator"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_shared"
|
name = "phf_shared"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -414,8 +414,8 @@ dependencies = [
|
||||||
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
39
ports/gonk/Cargo.lock
generated
39
ports/gonk/Cargo.lock
generated
|
@ -760,8 +760,8 @@ dependencies = [
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1289,33 +1289,42 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf"
|
name = "phf"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_codegen"
|
name = "phf_codegen"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_generator"
|
name = "phf_generator"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_macros"
|
||||||
|
version = "0.7.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf_shared"
|
name = "phf_shared"
|
||||||
version = "0.7.12"
|
version = "0.7.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1489,6 +1498,8 @@ dependencies = [
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
|
||||||
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_macros 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1763,8 +1774,8 @@ dependencies = [
|
||||||
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_plugin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_generator 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_generator 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_shared 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_shared 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2152,8 +2163,8 @@ source = "git+https://github.com/Ygg01/xml5ever#6c7017063dc1cfd64f08b7701a689e74
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -34494,7 +34494,16 @@
|
||||||
},
|
},
|
||||||
"local_changes": {
|
"local_changes": {
|
||||||
"deleted": [],
|
"deleted": [],
|
||||||
"items": {},
|
"items": {
|
||||||
|
"testharness": {
|
||||||
|
"WebIDL/ecmascript-binding/interface-object.html": [
|
||||||
|
{
|
||||||
|
"path": "WebIDL/ecmascript-binding/interface-object.html",
|
||||||
|
"url": "/WebIDL/ecmascript-binding/interface-object.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"reftest_nodes": {}
|
"reftest_nodes": {}
|
||||||
},
|
},
|
||||||
"reftest_nodes": {
|
"reftest_nodes": {
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Interface objects</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
test(function () {
|
||||||
|
assert_equals(typeof window.Blob, "function")
|
||||||
|
delete window.Blob;
|
||||||
|
assert_equals(window.Blob, undefined);
|
||||||
|
}, "An interface object deleted after it has been accessed is undefined");
|
||||||
|
|
||||||
|
test(function () {
|
||||||
|
delete window.File;
|
||||||
|
assert_equals(window.File, undefined);
|
||||||
|
}, "An interface object deleted before it has been defined is undefined");
|
||||||
|
|
||||||
|
test(function () {
|
||||||
|
delete window.ImageData;
|
||||||
|
assert_equals(Object.getOwnPropertyDescriptor(window, "ImageData"), undefined);
|
||||||
|
delete window.ImageData;
|
||||||
|
assert_equals(Object.getOwnPropertyDescriptor(window, "ImageData"), undefined);
|
||||||
|
}, "Interface objects deleted multiple times stay deleted");
|
||||||
|
|
||||||
|
test(function () {
|
||||||
|
assert_equals(window["abc\udc88"], undefined);
|
||||||
|
}, "Fancy property names don't break the resolve hook on Window");
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue