mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #29079 - jdm:sm107, r=jdm
Upgrade to spidermonkey 107 This successfully loads servo.org and google.com on macOS, so that means it's time for tests!
This commit is contained in:
commit
901b76297d
53 changed files with 384 additions and 646 deletions
65
Cargo.lock
generated
65
Cargo.lock
generated
|
@ -302,15 +302,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bindgen"
|
name = "bindgen"
|
||||||
version = "0.58.1"
|
version = "0.62.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0f8523b410d7187a43085e7e064416ea32ded16bd0a4e6fc025e21616d01258f"
|
checksum = "c6720a8b7b2d39dd533285ed438d458f65b31b5c257e6ac7bb3d7e82844dd722"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cexpr",
|
"cexpr",
|
||||||
"clang-sys",
|
"clang-sys",
|
||||||
"clap",
|
|
||||||
"env_logger",
|
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lazycell",
|
"lazycell",
|
||||||
"log",
|
"log",
|
||||||
|
@ -320,6 +318,7 @@ dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"shlex",
|
"shlex",
|
||||||
|
"syn",
|
||||||
"which",
|
"which",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -672,11 +671,11 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cexpr"
|
name = "cexpr"
|
||||||
version = "0.4.0"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27"
|
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom 5.1.2",
|
"nom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3924,7 +3923,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mozjs"
|
name = "mozjs"
|
||||||
version = "0.14.1"
|
version = "0.14.1"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#a10ab915532bb3e334e564364ed3630561bccacb"
|
source = "git+https://github.com/servo/mozjs#f87705d61015bf1646b33f33664da51f31b23b74"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
@ -3937,7 +3936,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mozjs_sys"
|
name = "mozjs_sys"
|
||||||
version = "0.68.2"
|
version = "0.68.2"
|
||||||
source = "git+https://github.com/servo/mozjs?rev=72ce2c95d24b225e3c87364608822b498b2312fb#72ce2c95d24b225e3c87364608822b498b2312fb"
|
source = "git+https://github.com/servo/mozjs#f87705d61015bf1646b33f33664da51f31b23b74"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"cc",
|
"cc",
|
||||||
|
@ -4216,16 +4215,6 @@ version = "0.1.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nom"
|
|
||||||
version = "5.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
"version_check",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.1"
|
version = "7.1.1"
|
||||||
|
@ -4932,11 +4921,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.37"
|
version = "1.0.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
|
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5209,9 +5198,9 @@ checksum = "2b5ceb840e4009da4841ed22a15eb49f64fdd00a2138945c5beacf506b2fb5ed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.4.5"
|
version = "1.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19"
|
checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -5220,9 +5209,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.23"
|
version = "0.6.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"
|
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "remove_dir_all"
|
name = "remove_dir_all"
|
||||||
|
@ -6452,13 +6441,13 @@ checksum = "e454d048db5527d000bfddb77bd072bbf3a1e2ae785f16d9bd116e07c2ab45eb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.67"
|
version = "1.0.103"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702"
|
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -6939,6 +6928,12 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-normalization"
|
name = "unicode-normalization"
|
||||||
version = "0.1.17"
|
version = "0.1.17"
|
||||||
|
@ -7400,7 +7395,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webxr"
|
name = "webxr"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/webxr#af2e84a28d52521212816584e0553aaf364a9162"
|
source = "git+https://github.com/servo/webxr#4eb957ac4f0e22ac5baded31eb86eea32862d687"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_injected_glue",
|
"android_injected_glue",
|
||||||
"bindgen",
|
"bindgen",
|
||||||
|
@ -7423,7 +7418,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webxr-api"
|
name = "webxr-api"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/webxr#af2e84a28d52521212816584e0553aaf364a9162"
|
source = "git+https://github.com/servo/webxr#4eb957ac4f0e22ac5baded31eb86eea32862d687"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"euclid",
|
"euclid",
|
||||||
"ipc-channel",
|
"ipc-channel",
|
||||||
|
@ -7477,11 +7472,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "which"
|
name = "which"
|
||||||
version = "3.1.1"
|
version = "4.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724"
|
checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"either",
|
||||||
"libc",
|
"libc",
|
||||||
|
"once_cell",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -7679,7 +7676,7 @@ version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7"
|
checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom 7.1.1",
|
"nom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -62,7 +62,7 @@ image = "0.24"
|
||||||
indexmap = { version = "1.0.2", features = ["std"] }
|
indexmap = { version = "1.0.2", features = ["std"] }
|
||||||
ipc-channel = "0.14"
|
ipc-channel = "0.14"
|
||||||
itertools = "0.8"
|
itertools = "0.8"
|
||||||
js = { package = "mozjs", git = "https://github.com/servo/rust-mozjs" }
|
js = { package = "mozjs", git = "https://github.com/servo/mozjs" }
|
||||||
jstraceable_derive = { path = "../jstraceable_derive" }
|
jstraceable_derive = { path = "../jstraceable_derive" }
|
||||||
keyboard-types = "0.6"
|
keyboard-types = "0.6"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
|
|
|
@ -1886,7 +1886,7 @@ class AttrDefiner(PropertyDefiner):
|
||||||
"name": m.identifier.name,
|
"name": m.identifier.name,
|
||||||
"attr": m,
|
"attr": m,
|
||||||
"flags": "JSPROP_ENUMERATE",
|
"flags": "JSPROP_ENUMERATE",
|
||||||
"is_accessor": "true",
|
"kind": "JSPropertySpec_Kind::NativeAccessor",
|
||||||
}
|
}
|
||||||
for m in descriptor.interface.members if
|
for m in descriptor.interface.members if
|
||||||
m.isAttr() and m.isStatic() == static
|
m.isAttr() and m.isStatic() == static
|
||||||
|
@ -1906,7 +1906,7 @@ class AttrDefiner(PropertyDefiner):
|
||||||
"name": "@@toStringTag",
|
"name": "@@toStringTag",
|
||||||
"attr": None,
|
"attr": None,
|
||||||
"flags": "JSPROP_READONLY",
|
"flags": "JSPROP_READONLY",
|
||||||
"is_accessor": "false",
|
"kind": "JSPropertySpec_Kind::Value",
|
||||||
})
|
})
|
||||||
|
|
||||||
def generateArray(self, array, name):
|
def generateArray(self, array, name):
|
||||||
|
@ -1963,13 +1963,13 @@ class AttrDefiner(PropertyDefiner):
|
||||||
|
|
||||||
def specData(attr):
|
def specData(attr):
|
||||||
if attr["name"] == "@@toStringTag":
|
if attr["name"] == "@@toStringTag":
|
||||||
return (attr["name"][2:], attr["flags"], attr["is_accessor"],
|
return (attr["name"][2:], attr["flags"], attr["kind"],
|
||||||
str_to_const_array(self.descriptor.interface.getClassName()))
|
str_to_const_array(self.descriptor.interface.getClassName()))
|
||||||
|
|
||||||
flags = attr["flags"]
|
flags = attr["flags"]
|
||||||
if self.unforgeable:
|
if self.unforgeable:
|
||||||
flags += " | JSPROP_PERMANENT"
|
flags += " | JSPROP_PERMANENT"
|
||||||
return (str_to_const_array(attr["attr"].identifier.name), flags, attr["is_accessor"], getter(attr),
|
return (str_to_const_array(attr["attr"].identifier.name), flags, attr["kind"], getter(attr),
|
||||||
setter(attr))
|
setter(attr))
|
||||||
|
|
||||||
def template(m):
|
def template(m):
|
||||||
|
@ -1977,7 +1977,7 @@ class AttrDefiner(PropertyDefiner):
|
||||||
return """ JSPropertySpec {
|
return """ JSPropertySpec {
|
||||||
name: JSPropertySpec_Name { symbol_: SymbolCode::%s as usize + 1 },
|
name: JSPropertySpec_Name { symbol_: SymbolCode::%s as usize + 1 },
|
||||||
attributes_: (%s) as u8,
|
attributes_: (%s) as u8,
|
||||||
isAccessor_: (%s),
|
kind_: (%s),
|
||||||
u: JSPropertySpec_AccessorsOrValue {
|
u: JSPropertySpec_AccessorsOrValue {
|
||||||
value: JSPropertySpec_ValueWrapper {
|
value: JSPropertySpec_ValueWrapper {
|
||||||
type_: JSPropertySpec_ValueWrapper_Type::String,
|
type_: JSPropertySpec_ValueWrapper_Type::String,
|
||||||
|
@ -1991,7 +1991,7 @@ class AttrDefiner(PropertyDefiner):
|
||||||
return """ JSPropertySpec {
|
return """ JSPropertySpec {
|
||||||
name: JSPropertySpec_Name { string_: %s as *const u8 as *const libc::c_char },
|
name: JSPropertySpec_Name { string_: %s as *const u8 as *const libc::c_char },
|
||||||
attributes_: (%s) as u8,
|
attributes_: (%s) as u8,
|
||||||
isAccessor_: (%s),
|
kind_: (%s),
|
||||||
u: JSPropertySpec_AccessorsOrValue {
|
u: JSPropertySpec_AccessorsOrValue {
|
||||||
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
|
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
|
||||||
getter: JSPropertySpec_Accessor {
|
getter: JSPropertySpec_Accessor {
|
||||||
|
@ -2361,7 +2361,6 @@ static CLASS_OPS: js::jsapi::JSClassOps = js::jsapi::JSClassOps {
|
||||||
mayResolve: None,
|
mayResolve: None,
|
||||||
finalize: Some(%(finalizeHook)s),
|
finalize: Some(%(finalizeHook)s),
|
||||||
call: None,
|
call: None,
|
||||||
hasInstance: None,
|
|
||||||
construct: None,
|
construct: None,
|
||||||
trace: Some(%(traceHook)s),
|
trace: Some(%(traceHook)s),
|
||||||
};
|
};
|
||||||
|
@ -3620,7 +3619,6 @@ let traps = ProxyTraps {
|
||||||
hasOwn: Some(hasOwn),
|
hasOwn: Some(hasOwn),
|
||||||
getOwnEnumerablePropertyKeys: Some(%(getOwnEnumerablePropertyKeys)s),
|
getOwnEnumerablePropertyKeys: Some(%(getOwnEnumerablePropertyKeys)s),
|
||||||
nativeCall: None,
|
nativeCall: None,
|
||||||
hasInstance: None,
|
|
||||||
objectClassIs: None,
|
objectClassIs: None,
|
||||||
className: Some(className),
|
className: Some(className),
|
||||||
fun_toString: None,
|
fun_toString: None,
|
||||||
|
@ -5368,7 +5366,7 @@ class CGProxySpecialOperation(CGPerSignatureCall):
|
||||||
}
|
}
|
||||||
self.cgRoot.prepend(instantiateJSToNativeConversionTemplate(
|
self.cgRoot.prepend(instantiateJSToNativeConversionTemplate(
|
||||||
template, templateValues, declType, argument.identifier.name))
|
template, templateValues, declType, argument.identifier.name))
|
||||||
self.cgRoot.prepend(CGGeneric("rooted!(in(*cx) let value = desc.value);"))
|
self.cgRoot.prepend(CGGeneric("rooted!(in(*cx) let value = desc.value_);"))
|
||||||
|
|
||||||
def getArguments(self):
|
def getArguments(self):
|
||||||
args = [(a, process_arg(a.identifier.name, a)) for a in self.arguments]
|
args = [(a, process_arg(a.identifier.name, a)) for a in self.arguments]
|
||||||
|
@ -5471,7 +5469,8 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('*mut JSContext', 'cx'), Argument('RawHandleObject', 'proxy'),
|
args = [Argument('*mut JSContext', 'cx'), Argument('RawHandleObject', 'proxy'),
|
||||||
Argument('RawHandleId', 'id'),
|
Argument('RawHandleId', 'id'),
|
||||||
Argument('RawMutableHandle<PropertyDescriptor>', 'mut desc')]
|
Argument('RawMutableHandle<PropertyDescriptor>', 'mut desc'),
|
||||||
|
Argument('*mut bool', 'is_none')]
|
||||||
CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor",
|
CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor",
|
||||||
"bool", args)
|
"bool", args)
|
||||||
self.descriptor = descriptor
|
self.descriptor = descriptor
|
||||||
|
@ -5487,12 +5486,12 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
"""
|
"""
|
||||||
if !proxyhandler::is_platform_object_same_origin(cx, proxy) {
|
if !proxyhandler::is_platform_object_same_origin(cx, proxy) {
|
||||||
if !proxyhandler::cross_origin_get_own_property_helper(
|
if !proxyhandler::cross_origin_get_own_property_helper(
|
||||||
cx, proxy, &CROSS_ORIGIN_PROPERTIES, id, desc
|
cx, proxy, &CROSS_ORIGIN_PROPERTIES, id, desc, &mut *is_none
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if desc.obj.is_null() {
|
if *is_none {
|
||||||
return proxyhandler::cross_origin_property_fallback(cx, proxy, id, desc);
|
return proxyhandler::cross_origin_property_fallback(cx, proxy, id, desc, &mut *is_none);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5507,8 +5506,12 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
attrs = "JSPROP_ENUMERATE"
|
attrs = "JSPROP_ENUMERATE"
|
||||||
if self.descriptor.operations['IndexedSetter'] is None:
|
if self.descriptor.operations['IndexedSetter'] is None:
|
||||||
attrs += " | JSPROP_READONLY"
|
attrs += " | JSPROP_READONLY"
|
||||||
fillDescriptor = ("desc.value = result_root.get();\n"
|
fillDescriptor = ("set_property_descriptor(\n"
|
||||||
"fill_property_descriptor(MutableHandle::from_raw(desc), proxy.get(), (%s) as u32);\n"
|
" MutableHandle::from_raw(desc),\n"
|
||||||
|
" result_root.handle(),\n"
|
||||||
|
" (%s) as u32,\n"
|
||||||
|
" &mut *is_none\n"
|
||||||
|
");\n"
|
||||||
"return true;" % attrs)
|
"return true;" % attrs)
|
||||||
templateValues = {
|
templateValues = {
|
||||||
'jsvalRef': 'result_root.handle_mut()',
|
'jsvalRef': 'result_root.handle_mut()',
|
||||||
|
@ -5532,8 +5535,12 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
attrs = " | ".join(attrs)
|
attrs = " | ".join(attrs)
|
||||||
else:
|
else:
|
||||||
attrs = "0"
|
attrs = "0"
|
||||||
fillDescriptor = ("desc.value = result_root.get();\n"
|
fillDescriptor = ("set_property_descriptor(\n"
|
||||||
"fill_property_descriptor(MutableHandle::from_raw(desc), proxy.get(), (%s) as u32);\n"
|
" MutableHandle::from_raw(desc),\n"
|
||||||
|
" result_root.handle(),\n"
|
||||||
|
" (%s) as u32,\n"
|
||||||
|
" &mut *is_none\n"
|
||||||
|
");\n"
|
||||||
"return true;" % attrs)
|
"return true;" % attrs)
|
||||||
templateValues = {
|
templateValues = {
|
||||||
'jsvalRef': 'result_root.handle_mut()',
|
'jsvalRef': 'result_root.handle_mut()',
|
||||||
|
@ -5542,7 +5549,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
}
|
}
|
||||||
|
|
||||||
# See the similar-looking in CGDOMJSProxyHandler_get for the spec quote.
|
# See the similar-looking in CGDOMJSProxyHandler_get for the spec quote.
|
||||||
condition = "RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id)"
|
condition = "id.is_string() || id.is_int()"
|
||||||
if indexedGetter:
|
if indexedGetter:
|
||||||
condition = "index.is_none() && (%s)" % condition
|
condition = "index.is_none() && (%s)" % condition
|
||||||
# Once we start supporting OverrideBuiltins we need to make
|
# Once we start supporting OverrideBuiltins we need to make
|
||||||
|
@ -5569,17 +5576,16 @@ get_expando_object(proxy, expando.handle_mut());
|
||||||
let proxy_lt = Handle::from_raw(proxy);
|
let proxy_lt = Handle::from_raw(proxy);
|
||||||
let id_lt = Handle::from_raw(id);
|
let id_lt = Handle::from_raw(id);
|
||||||
if !expando.is_null() {
|
if !expando.is_null() {
|
||||||
if !JS_GetPropertyDescriptorById(*cx, expando.handle().into(), id, desc) {
|
rooted!(in(*cx) let mut ignored = ptr::null_mut::<JSObject>());
|
||||||
|
if !JS_GetPropertyDescriptorById(*cx, expando.handle().into(), id, desc, ignored.handle_mut().into(), is_none) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if !desc.obj.is_null() {
|
if !*is_none {
|
||||||
// Pretend the property lives on the wrapper.
|
// Pretend the property lives on the wrapper.
|
||||||
desc.obj = proxy.get();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
""" + namedGet + """\
|
""" + namedGet + """\
|
||||||
desc.obj = ptr::null_mut();
|
|
||||||
return true;"""
|
return true;"""
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
|
@ -5628,12 +5634,12 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
||||||
if self.descriptor.hasUnforgeableMembers:
|
if self.descriptor.hasUnforgeableMembers:
|
||||||
raise TypeError("Can't handle a named setter on an interface that has "
|
raise TypeError("Can't handle a named setter on an interface that has "
|
||||||
"unforgeables. Figure out how that should work!")
|
"unforgeables. Figure out how that should work!")
|
||||||
set += ("if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {\n"
|
set += ("if id.is_string() || id.is_int() {\n"
|
||||||
+ CGIndenter(CGProxyNamedSetter(self.descriptor)).define()
|
+ CGIndenter(CGProxyNamedSetter(self.descriptor)).define()
|
||||||
+ " return (*opresult).succeed();\n"
|
+ " return (*opresult).succeed();\n"
|
||||||
+ "}\n")
|
+ "}\n")
|
||||||
elif self.descriptor.operations['NamedGetter']:
|
elif self.descriptor.operations['NamedGetter']:
|
||||||
set += ("if RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id) {\n"
|
set += ("if id.is_string() || id.is_int() {\n"
|
||||||
+ CGIndenter(CGProxyNamedGetter(self.descriptor)).define()
|
+ CGIndenter(CGProxyNamedGetter(self.descriptor)).define()
|
||||||
+ " if result.is_some() {\n"
|
+ " if result.is_some() {\n"
|
||||||
" return (*opresult).failNoNamedSetter();\n"
|
" return (*opresult).failNoNamedSetter();\n"
|
||||||
|
@ -5839,7 +5845,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
||||||
+ "}\n\n")
|
+ "}\n\n")
|
||||||
|
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
condition = "RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id)"
|
condition = "id.is_string() || id.is_int()"
|
||||||
if indexedGetter:
|
if indexedGetter:
|
||||||
condition = "index.is_none() && (%s)" % condition
|
condition = "index.is_none() && (%s)" % condition
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
|
@ -5939,7 +5945,7 @@ if !expando.is_null() {
|
||||||
|
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
condition = "RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id)"
|
condition = "id.is_string() || id.is_int()"
|
||||||
# From step 1:
|
# From step 1:
|
||||||
# If O supports indexed properties and P is an array index, then:
|
# If O supports indexed properties and P is an array index, then:
|
||||||
#
|
#
|
||||||
|
@ -6139,7 +6145,7 @@ class CGClassFinalizeHook(CGAbstractClassHook):
|
||||||
A hook for finalize, used to release our native object.
|
A hook for finalize, used to release our native object.
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('*mut JSFreeOp', '_fop'), Argument('*mut JSObject', 'obj')]
|
args = [Argument('*mut GCContext', '_cx'), Argument('*mut JSObject', 'obj')]
|
||||||
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
|
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
|
||||||
'void', args)
|
'void', args)
|
||||||
|
|
||||||
|
@ -6302,6 +6308,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::jsapi::CallArgs',
|
'js::jsapi::CallArgs',
|
||||||
'js::jsapi::CurrentGlobalOrNull',
|
'js::jsapi::CurrentGlobalOrNull',
|
||||||
'js::rust::wrappers::GetPropertyKeys',
|
'js::rust::wrappers::GetPropertyKeys',
|
||||||
|
'js::jsapi::GCContext',
|
||||||
'js::jsapi::GetWellKnownSymbol',
|
'js::jsapi::GetWellKnownSymbol',
|
||||||
'js::rust::Handle',
|
'js::rust::Handle',
|
||||||
'js::jsapi::Handle as RawHandle',
|
'js::jsapi::Handle as RawHandle',
|
||||||
|
@ -6320,7 +6327,6 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::jsapi::JSCLASS_RESERVED_SLOTS_SHIFT',
|
'js::jsapi::JSCLASS_RESERVED_SLOTS_SHIFT',
|
||||||
'js::jsapi::JSClass',
|
'js::jsapi::JSClass',
|
||||||
'js::jsapi::JSContext',
|
'js::jsapi::JSContext',
|
||||||
'js::jsapi::JSFreeOp',
|
|
||||||
'js::jsapi::JSFunctionSpec',
|
'js::jsapi::JSFunctionSpec',
|
||||||
'js::jsapi::JSITER_HIDDEN',
|
'js::jsapi::JSITER_HIDDEN',
|
||||||
'js::jsapi::JSITER_OWNONLY',
|
'js::jsapi::JSITER_OWNONLY',
|
||||||
|
@ -6345,6 +6351,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::jsapi::JSPropertySpec_Accessor',
|
'js::jsapi::JSPropertySpec_Accessor',
|
||||||
'js::jsapi::JSPropertySpec_AccessorsOrValue',
|
'js::jsapi::JSPropertySpec_AccessorsOrValue',
|
||||||
'js::jsapi::JSPropertySpec_AccessorsOrValue_Accessors',
|
'js::jsapi::JSPropertySpec_AccessorsOrValue_Accessors',
|
||||||
|
'js::jsapi::JSPropertySpec_Kind',
|
||||||
'js::jsapi::JSPropertySpec_Name',
|
'js::jsapi::JSPropertySpec_Name',
|
||||||
'js::jsapi::JSPropertySpec_ValueWrapper',
|
'js::jsapi::JSPropertySpec_ValueWrapper',
|
||||||
'js::jsapi::JSPropertySpec_ValueWrapper_Type',
|
'js::jsapi::JSPropertySpec_ValueWrapper_Type',
|
||||||
|
@ -6414,8 +6421,6 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::glue::SetProxyReservedSlot',
|
'js::glue::SetProxyReservedSlot',
|
||||||
'js::rust::wrappers::NewProxyObject',
|
'js::rust::wrappers::NewProxyObject',
|
||||||
'js::glue::ProxyTraps',
|
'js::glue::ProxyTraps',
|
||||||
'js::glue::RUST_JSID_IS_INT',
|
|
||||||
'js::glue::RUST_JSID_IS_STRING',
|
|
||||||
'js::rust::wrappers::RUST_SYMBOL_TO_JSID',
|
'js::rust::wrappers::RUST_SYMBOL_TO_JSID',
|
||||||
'js::rust::wrappers::int_to_jsid',
|
'js::rust::wrappers::int_to_jsid',
|
||||||
'js::glue::UnwrapObjectDynamic',
|
'js::glue::UnwrapObjectDynamic',
|
||||||
|
@ -6521,7 +6526,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'crate::dom::bindings::inheritance::Castable',
|
'crate::dom::bindings::inheritance::Castable',
|
||||||
'crate::dom::bindings::proxyhandler',
|
'crate::dom::bindings::proxyhandler',
|
||||||
'crate::dom::bindings::proxyhandler::ensure_expando_object',
|
'crate::dom::bindings::proxyhandler::ensure_expando_object',
|
||||||
'crate::dom::bindings::proxyhandler::fill_property_descriptor',
|
'crate::dom::bindings::proxyhandler::set_property_descriptor',
|
||||||
'crate::dom::bindings::proxyhandler::get_expando_object',
|
'crate::dom::bindings::proxyhandler::get_expando_object',
|
||||||
'crate::dom::bindings::record::Record',
|
'crate::dom::bindings::record::Record',
|
||||||
'std::ptr::NonNull',
|
'std::ptr::NonNull',
|
||||||
|
|
|
@ -53,8 +53,6 @@ use js::error::throw_type_error;
|
||||||
use js::glue::GetProxyReservedSlot;
|
use js::glue::GetProxyReservedSlot;
|
||||||
use js::glue::JS_GetReservedSlot;
|
use js::glue::JS_GetReservedSlot;
|
||||||
use js::glue::{IsWrapper, UnwrapObjectDynamic};
|
use js::glue::{IsWrapper, UnwrapObjectDynamic};
|
||||||
use js::glue::{RUST_JSID_IS_INT, RUST_JSID_TO_INT};
|
|
||||||
use js::glue::{RUST_JSID_IS_STRING, RUST_JSID_TO_STRING};
|
|
||||||
use js::jsapi::{Heap, JSContext, JSObject, JSString};
|
use js::jsapi::{Heap, JSContext, JSObject, JSString};
|
||||||
use js::jsapi::{IsWindowProxy, JS_DeprecatedStringHasLatin1Chars, JS_NewStringCopyN};
|
use js::jsapi::{IsWindowProxy, JS_DeprecatedStringHasLatin1Chars, JS_NewStringCopyN};
|
||||||
use js::jsapi::{
|
use js::jsapi::{
|
||||||
|
@ -160,13 +158,13 @@ where
|
||||||
///
|
///
|
||||||
/// Handling of invalid UTF-16 in strings depends on the relevant option.
|
/// Handling of invalid UTF-16 in strings depends on the relevant option.
|
||||||
pub unsafe fn jsid_to_string(cx: *mut JSContext, id: HandleId) -> Option<DOMString> {
|
pub unsafe fn jsid_to_string(cx: *mut JSContext, id: HandleId) -> Option<DOMString> {
|
||||||
let id_raw = id.into();
|
let id_raw = *id;
|
||||||
if RUST_JSID_IS_STRING(id_raw) {
|
if id_raw.is_string() {
|
||||||
return Some(jsstring_to_str(cx, RUST_JSID_TO_STRING(id_raw)));
|
return Some(jsstring_to_str(cx, id_raw.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if RUST_JSID_IS_INT(id_raw) {
|
if id_raw.is_int() {
|
||||||
return Some(RUST_JSID_TO_INT(id_raw).to_string().into());
|
return Some(id_raw.to_int().to_string().into());
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
|
@ -105,7 +105,6 @@ impl InterfaceConstructorBehavior {
|
||||||
finalize: None,
|
finalize: None,
|
||||||
call: Some(invalid_constructor),
|
call: Some(invalid_constructor),
|
||||||
construct: Some(invalid_constructor),
|
construct: Some(invalid_constructor),
|
||||||
hasInstance: None, // heycam/webidl#356
|
|
||||||
trace: None,
|
trace: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -122,7 +121,6 @@ impl InterfaceConstructorBehavior {
|
||||||
finalize: None,
|
finalize: None,
|
||||||
call: Some(non_new_constructor),
|
call: Some(non_new_constructor),
|
||||||
construct: Some(hook),
|
construct: Some(hook),
|
||||||
hasInstance: None, // heycam/webidl#356
|
|
||||||
trace: None,
|
trace: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,12 @@ use js::jsval::ObjectValue;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::wrappers::JS_AlreadyHasOwnPropertyById;
|
use js::rust::wrappers::JS_AlreadyHasOwnPropertyById;
|
||||||
use js::rust::wrappers::JS_NewObjectWithGivenProto;
|
use js::rust::wrappers::JS_NewObjectWithGivenProto;
|
||||||
use js::rust::wrappers::{AppendToIdVector, RUST_INTERNED_STRING_TO_JSID};
|
use js::rust::wrappers::{
|
||||||
use js::rust::{get_context_realm, Handle, HandleObject, MutableHandle, MutableHandleObject};
|
AppendToIdVector, SetDataPropertyDescriptor, RUST_INTERNED_STRING_TO_JSID,
|
||||||
|
};
|
||||||
|
use js::rust::{
|
||||||
|
get_context_realm, Handle, HandleObject, HandleValue, MutableHandle, MutableHandleObject,
|
||||||
|
};
|
||||||
use std::{ffi::CStr, os::raw::c_char, ptr};
|
use std::{ffi::CStr, os::raw::c_char, ptr};
|
||||||
|
|
||||||
/// Determine if this id shadows any existing properties for this proxy.
|
/// Determine if this id shadows any existing properties for this proxy.
|
||||||
|
@ -189,15 +193,16 @@ pub unsafe fn ensure_expando_object(
|
||||||
|
|
||||||
/// Set the property descriptor's object to `obj` and set it to enumerable,
|
/// Set the property descriptor's object to `obj` and set it to enumerable,
|
||||||
/// and writable if `readonly` is true.
|
/// and writable if `readonly` is true.
|
||||||
pub fn fill_property_descriptor(
|
pub fn set_property_descriptor(
|
||||||
mut desc: MutableHandle<PropertyDescriptor>,
|
desc: MutableHandle<PropertyDescriptor>,
|
||||||
obj: *mut JSObject,
|
value: HandleValue,
|
||||||
attrs: u32,
|
attrs: u32,
|
||||||
|
is_none: &mut bool,
|
||||||
) {
|
) {
|
||||||
desc.obj = obj;
|
unsafe {
|
||||||
desc.attrs = attrs;
|
SetDataPropertyDescriptor(desc, value, attrs);
|
||||||
desc.getter = None;
|
}
|
||||||
desc.setter = None;
|
*is_none = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://html.spec.whatwg.org/multipage/#isplatformobjectsameorigin-(-o-)>
|
/// <https://html.spec.whatwg.org/multipage/#isplatformobjectsameorigin-(-o-)>
|
||||||
|
@ -333,12 +338,14 @@ pub unsafe extern "C" fn maybe_cross_origin_set_rawcx(
|
||||||
// OrdinarySet
|
// OrdinarySet
|
||||||
// <https://tc39.es/ecma262/#sec-ordinaryset>
|
// <https://tc39.es/ecma262/#sec-ordinaryset>
|
||||||
rooted!(in(*cx) let mut own_desc = PropertyDescriptor::default());
|
rooted!(in(*cx) let mut own_desc = PropertyDescriptor::default());
|
||||||
|
let mut is_none = false;
|
||||||
if !InvokeGetOwnPropertyDescriptor(
|
if !InvokeGetOwnPropertyDescriptor(
|
||||||
GetProxyHandler(*proxy),
|
GetProxyHandler(*proxy),
|
||||||
*cx,
|
*cx,
|
||||||
proxy,
|
proxy,
|
||||||
id,
|
id,
|
||||||
own_desc.handle_mut().into(),
|
own_desc.handle_mut().into(),
|
||||||
|
&mut is_none,
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -439,26 +446,28 @@ pub unsafe fn cross_origin_get(
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// > 1. Let `desc` be `? O.[[GetOwnProperty]](P)`.
|
// > 1. Let `desc` be `? O.[[GetOwnProperty]](P)`.
|
||||||
rooted!(in(*cx) let mut descriptor = PropertyDescriptor::default());
|
rooted!(in(*cx) let mut descriptor = PropertyDescriptor::default());
|
||||||
|
let mut is_none = false;
|
||||||
if !InvokeGetOwnPropertyDescriptor(
|
if !InvokeGetOwnPropertyDescriptor(
|
||||||
GetProxyHandler(*proxy),
|
GetProxyHandler(*proxy),
|
||||||
*cx,
|
*cx,
|
||||||
proxy,
|
proxy,
|
||||||
id,
|
id,
|
||||||
descriptor.handle_mut().into(),
|
descriptor.handle_mut().into(),
|
||||||
|
&mut is_none,
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// > 2. Assert: `desc` is not undefined.
|
// > 2. Assert: `desc` is not undefined.
|
||||||
assert!(
|
assert!(
|
||||||
!descriptor.obj.is_null(),
|
!is_none,
|
||||||
"Callees should throw in all cases when they are not finding \
|
"Callees should throw in all cases when they are not finding \
|
||||||
a property decriptor"
|
a property decriptor"
|
||||||
);
|
);
|
||||||
|
|
||||||
// > 3. If `! IsDataDescriptor(desc)` is true, then return `desc.[[Value]]`.
|
// > 3. If `! IsDataDescriptor(desc)` is true, then return `desc.[[Value]]`.
|
||||||
if is_data_descriptor(&descriptor) {
|
if is_data_descriptor(&descriptor) {
|
||||||
vp.set(descriptor.value);
|
vp.set(descriptor.value_);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,19 +513,21 @@ pub unsafe fn cross_origin_set(
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// > 1. Let desc be ? O.[[GetOwnProperty]](P).
|
// > 1. Let desc be ? O.[[GetOwnProperty]](P).
|
||||||
rooted!(in(*cx) let mut descriptor = PropertyDescriptor::default());
|
rooted!(in(*cx) let mut descriptor = PropertyDescriptor::default());
|
||||||
|
let mut is_none = false;
|
||||||
if !InvokeGetOwnPropertyDescriptor(
|
if !InvokeGetOwnPropertyDescriptor(
|
||||||
GetProxyHandler(*proxy),
|
GetProxyHandler(*proxy),
|
||||||
*cx,
|
*cx,
|
||||||
proxy,
|
proxy,
|
||||||
id,
|
id,
|
||||||
descriptor.handle_mut().into(),
|
descriptor.handle_mut().into(),
|
||||||
|
&mut is_none,
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// > 2. Assert: desc is not undefined.
|
// > 2. Assert: desc is not undefined.
|
||||||
assert!(
|
assert!(
|
||||||
!descriptor.obj.is_null(),
|
!is_none,
|
||||||
"Callees should throw in all cases when they are not finding \
|
"Callees should throw in all cases when they are not finding \
|
||||||
a property decriptor"
|
a property decriptor"
|
||||||
);
|
);
|
||||||
|
@ -557,32 +568,25 @@ pub unsafe fn cross_origin_set(
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn get_getter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
unsafe fn get_getter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
||||||
if (d.attrs & jsapi::JSPROP_GETTER as u32) != 0 {
|
if d.hasGetter_() {
|
||||||
out.set(std::mem::transmute(d.getter));
|
out.set(std::mem::transmute(d.getter_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn get_setter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
unsafe fn get_setter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
||||||
if (d.attrs & jsapi::JSPROP_SETTER as u32) != 0 {
|
if d.hasSetter_() {
|
||||||
out.set(std::mem::transmute(d.setter));
|
out.set(std::mem::transmute(d.setter_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://tc39.es/ecma262/#sec-isaccessordescriptor>
|
/// <https://tc39.es/ecma262/#sec-isaccessordescriptor>
|
||||||
fn is_accessor_descriptor(d: &PropertyDescriptor) -> bool {
|
fn is_accessor_descriptor(d: &PropertyDescriptor) -> bool {
|
||||||
d.attrs & (jsapi::JSPROP_GETTER as u32 | jsapi::JSPROP_SETTER as u32) != 0
|
d.hasSetter_() || d.hasGetter_()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://tc39.es/ecma262/#sec-isdatadescriptor>
|
/// <https://tc39.es/ecma262/#sec-isdatadescriptor>
|
||||||
fn is_data_descriptor(d: &PropertyDescriptor) -> bool {
|
fn is_data_descriptor(d: &PropertyDescriptor) -> bool {
|
||||||
let is_accessor = is_accessor_descriptor(d);
|
d.hasWritable_() || d.hasValue_()
|
||||||
let is_generic = d.attrs &
|
|
||||||
(jsapi::JSPROP_GETTER as u32 |
|
|
||||||
jsapi::JSPROP_SETTER as u32 |
|
|
||||||
jsapi::JSPROP_IGNORE_READONLY |
|
|
||||||
jsapi::JSPROP_IGNORE_VALUE) ==
|
|
||||||
jsapi::JSPROP_IGNORE_READONLY | jsapi::JSPROP_IGNORE_VALUE;
|
|
||||||
!is_accessor && !is_generic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluate `CrossOriginGetOwnPropertyHelper(proxy, id) != null`.
|
/// Evaluate `CrossOriginGetOwnPropertyHelper(proxy, id) != null`.
|
||||||
|
@ -621,7 +625,8 @@ pub unsafe fn cross_origin_get_own_property_helper(
|
||||||
proxy: RawHandleObject,
|
proxy: RawHandleObject,
|
||||||
cross_origin_properties: &'static CrossOriginProperties,
|
cross_origin_properties: &'static CrossOriginProperties,
|
||||||
id: RawHandleId,
|
id: RawHandleId,
|
||||||
mut desc: RawMutableHandle<PropertyDescriptor>,
|
desc: RawMutableHandle<PropertyDescriptor>,
|
||||||
|
is_none: &mut bool,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
rooted!(in(*cx) let mut holder = ptr::null_mut::<JSObject>());
|
rooted!(in(*cx) let mut holder = ptr::null_mut::<JSObject>());
|
||||||
|
|
||||||
|
@ -632,15 +637,7 @@ pub unsafe fn cross_origin_get_own_property_helper(
|
||||||
holder.handle_mut().into(),
|
holder.handle_mut().into(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if !JS_GetOwnPropertyDescriptorById(*cx, holder.handle().into(), id, desc) {
|
return JS_GetOwnPropertyDescriptorById(*cx, holder.handle().into(), id, desc, is_none);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if !desc.obj.is_null() {
|
|
||||||
desc.obj = proxy.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Implementation of [`CrossOriginPropertyFallback`].
|
/// Implementation of [`CrossOriginPropertyFallback`].
|
||||||
|
@ -651,24 +648,24 @@ pub unsafe fn cross_origin_get_own_property_helper(
|
||||||
/// [`CrossOriginPropertyFallback`]: https://html.spec.whatwg.org/multipage/#crossoriginpropertyfallback-(-p-)
|
/// [`CrossOriginPropertyFallback`]: https://html.spec.whatwg.org/multipage/#crossoriginpropertyfallback-(-p-)
|
||||||
pub unsafe fn cross_origin_property_fallback(
|
pub unsafe fn cross_origin_property_fallback(
|
||||||
cx: SafeJSContext,
|
cx: SafeJSContext,
|
||||||
proxy: RawHandleObject,
|
_proxy: RawHandleObject,
|
||||||
id: RawHandleId,
|
id: RawHandleId,
|
||||||
mut desc: RawMutableHandle<PropertyDescriptor>,
|
desc: RawMutableHandle<PropertyDescriptor>,
|
||||||
|
is_none: &mut bool,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
assert!(desc.obj.is_null(), "why are we being called?");
|
assert!(*is_none, "why are we being called?");
|
||||||
|
|
||||||
// > 1. If P is `then`, `@@toStringTag`, `@@hasInstance`, or
|
// > 1. If P is `then`, `@@toStringTag`, `@@hasInstance`, or
|
||||||
// > `@@isConcatSpreadable`, then return `PropertyDescriptor{ [[Value]]:
|
// > `@@isConcatSpreadable`, then return `PropertyDescriptor{ [[Value]]:
|
||||||
// > undefined, [[Writable]]: false, [[Enumerable]]: false,
|
// > undefined, [[Writable]]: false, [[Enumerable]]: false,
|
||||||
// > [[Configurable]]: true }`.
|
// > [[Configurable]]: true }`.
|
||||||
if is_cross_origin_allowlisted_prop(cx, id) {
|
if is_cross_origin_allowlisted_prop(cx, id) {
|
||||||
*desc = PropertyDescriptor {
|
set_property_descriptor(
|
||||||
getter: None,
|
MutableHandle::from_raw(desc),
|
||||||
setter: None,
|
HandleValue::undefined(),
|
||||||
value: UndefinedValue(),
|
jsapi::JSPROP_READONLY as u32,
|
||||||
attrs: jsapi::JSPROP_READONLY as u32,
|
is_none,
|
||||||
obj: proxy.get(),
|
);
|
||||||
};
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +692,7 @@ unsafe fn is_cross_origin_allowlisted_prop(cx: SafeJSContext, id: RawHandleId) -
|
||||||
);
|
);
|
||||||
// `jsid`s containing `JS::Symbol *` can be compared by
|
// `jsid`s containing `JS::Symbol *` can be compared by
|
||||||
// referential equality
|
// referential equality
|
||||||
allowed_id.get().asBits == id.asBits
|
allowed_id.get().asBits_ == id.asBits_
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ use crate::dom::bindings::conversions::jsid_to_string;
|
||||||
use crate::dom::bindings::str::{ByteString, DOMString, USVString};
|
use crate::dom::bindings::str::{ByteString, DOMString, USVString};
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use js::conversions::{ConversionResult, FromJSValConvertible, ToJSValConvertible};
|
use js::conversions::{ConversionResult, FromJSValConvertible, ToJSValConvertible};
|
||||||
|
use js::jsapi::glue::JS_GetOwnPropertyDescriptorById;
|
||||||
use js::jsapi::HandleId as RawHandleId;
|
use js::jsapi::HandleId as RawHandleId;
|
||||||
use js::jsapi::JSContext;
|
use js::jsapi::JSContext;
|
||||||
use js::jsapi::JS_NewPlainObject;
|
use js::jsapi::JS_NewPlainObject;
|
||||||
|
@ -20,7 +21,6 @@ use js::jsval::ObjectValue;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::wrappers::GetPropertyKeys;
|
use js::rust::wrappers::GetPropertyKeys;
|
||||||
use js::rust::wrappers::JS_DefineUCProperty2;
|
use js::rust::wrappers::JS_DefineUCProperty2;
|
||||||
use js::rust::wrappers::JS_GetOwnPropertyDescriptorById;
|
|
||||||
use js::rust::wrappers::JS_GetPropertyById;
|
use js::rust::wrappers::JS_GetPropertyById;
|
||||||
use js::rust::wrappers::JS_IdToValue;
|
use js::rust::wrappers::JS_IdToValue;
|
||||||
use js::rust::HandleId;
|
use js::rust::HandleId;
|
||||||
|
@ -135,12 +135,18 @@ where
|
||||||
rooted!(in(cx) let id = *id);
|
rooted!(in(cx) let id = *id);
|
||||||
rooted!(in(cx) let mut desc = PropertyDescriptor::default());
|
rooted!(in(cx) let mut desc = PropertyDescriptor::default());
|
||||||
|
|
||||||
if !JS_GetOwnPropertyDescriptorById(cx, object.handle(), id.handle(), desc.handle_mut())
|
let mut is_none = false;
|
||||||
{
|
if !JS_GetOwnPropertyDescriptorById(
|
||||||
|
cx,
|
||||||
|
object.handle().into(),
|
||||||
|
id.handle().into(),
|
||||||
|
desc.handle_mut().into(),
|
||||||
|
&mut is_none,
|
||||||
|
) {
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JSPROP_ENUMERATE as u32) & desc.attrs == 0 {
|
if !desc.enumerable_() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,6 +306,7 @@ pub fn write(
|
||||||
let policy = CloneDataPolicy {
|
let policy = CloneDataPolicy {
|
||||||
allowIntraClusterClonableSharedObjects_: false,
|
allowIntraClusterClonableSharedObjects_: false,
|
||||||
allowSharedMemoryObjects_: false,
|
allowSharedMemoryObjects_: false,
|
||||||
|
allowErrorStackFrames_: false,
|
||||||
};
|
};
|
||||||
let result = JS_WriteStructuredClone(
|
let result = JS_WriteStructuredClone(
|
||||||
*cx,
|
*cx,
|
||||||
|
@ -382,6 +383,7 @@ pub fn read(
|
||||||
&CloneDataPolicy {
|
&CloneDataPolicy {
|
||||||
allowIntraClusterClonableSharedObjects_: false,
|
allowIntraClusterClonableSharedObjects_: false,
|
||||||
allowSharedMemoryObjects_: false,
|
allowSharedMemoryObjects_: false,
|
||||||
|
allowErrorStackFrames_: false,
|
||||||
},
|
},
|
||||||
&STRUCTURED_CLONE_CALLBACKS,
|
&STRUCTURED_CLONE_CALLBACKS,
|
||||||
sc_holder_ptr as *mut raw::c_void,
|
sc_holder_ptr as *mut raw::c_void,
|
||||||
|
|
|
@ -82,7 +82,7 @@ use js::jsapi::{
|
||||||
GCTraceKindToAscii, Heap, JSObject, JSScript, JSString, JSTracer, JobQueue, TraceKind,
|
GCTraceKindToAscii, Heap, JSObject, JSScript, JSString, JSTracer, JobQueue, TraceKind,
|
||||||
};
|
};
|
||||||
use js::jsval::JSVal;
|
use js::jsval::JSVal;
|
||||||
use js::rust::{GCMethods, Handle, Runtime};
|
use js::rust::{GCMethods, Handle, Runtime, Stencil};
|
||||||
use js::typedarray::TypedArray;
|
use js::typedarray::TypedArray;
|
||||||
use js::typedarray::TypedArrayElement;
|
use js::typedarray::TypedArrayElement;
|
||||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||||
|
@ -677,6 +677,7 @@ unsafe_no_jsmanaged_fields!(MediaMetadata);
|
||||||
unsafe_no_jsmanaged_fields!(WebrenderIpcSender);
|
unsafe_no_jsmanaged_fields!(WebrenderIpcSender);
|
||||||
unsafe_no_jsmanaged_fields!(StreamConsumer);
|
unsafe_no_jsmanaged_fields!(StreamConsumer);
|
||||||
unsafe_no_jsmanaged_fields!(DocumentAnimationSet);
|
unsafe_no_jsmanaged_fields!(DocumentAnimationSet);
|
||||||
|
unsafe_no_jsmanaged_fields!(Stencil);
|
||||||
|
|
||||||
unsafe impl<'a> JSTraceable for &'a str {
|
unsafe impl<'a> JSTraceable for &'a str {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -18,11 +18,9 @@ use crate::dom::windowproxy;
|
||||||
use crate::script_runtime::JSContext as SafeJSContext;
|
use crate::script_runtime::JSContext as SafeJSContext;
|
||||||
use js::conversions::ToJSValConvertible;
|
use js::conversions::ToJSValConvertible;
|
||||||
use js::glue::JS_GetReservedSlot;
|
use js::glue::JS_GetReservedSlot;
|
||||||
|
use js::glue::RUST_FUNCTION_VALUE_TO_JITINFO;
|
||||||
use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper};
|
use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper};
|
||||||
use js::glue::{UnwrapObjectDynamic, UnwrapObjectStatic, RUST_JSID_TO_INT, RUST_JSID_TO_STRING};
|
use js::glue::{UnwrapObjectDynamic, UnwrapObjectStatic};
|
||||||
use js::glue::{
|
|
||||||
RUST_FUNCTION_VALUE_TO_JITINFO, RUST_JSID_IS_INT, RUST_JSID_IS_STRING, RUST_JSID_IS_VOID,
|
|
||||||
};
|
|
||||||
use js::jsapi::HandleId as RawHandleId;
|
use js::jsapi::HandleId as RawHandleId;
|
||||||
use js::jsapi::HandleObject as RawHandleObject;
|
use js::jsapi::HandleObject as RawHandleObject;
|
||||||
use js::jsapi::MutableHandleIdVector as RawMutableHandleIdVector;
|
use js::jsapi::MutableHandleIdVector as RawMutableHandleIdVector;
|
||||||
|
@ -192,16 +190,16 @@ pub unsafe fn get_property_on_prototype(
|
||||||
/// Get an array index from the given `jsid`. Returns `None` if the given
|
/// Get an array index from the given `jsid`. Returns `None` if the given
|
||||||
/// `jsid` is not an integer.
|
/// `jsid` is not an integer.
|
||||||
pub unsafe fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId) -> Option<u32> {
|
pub unsafe fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId) -> Option<u32> {
|
||||||
let raw_id = id.into();
|
let raw_id = *id;
|
||||||
if RUST_JSID_IS_INT(raw_id) {
|
if raw_id.is_int() {
|
||||||
return Some(RUST_JSID_TO_INT(raw_id) as u32);
|
return Some(raw_id.to_int() as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
if RUST_JSID_IS_VOID(raw_id) || !RUST_JSID_IS_STRING(raw_id) {
|
if raw_id.is_void() || !raw_id.is_string() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let atom = RUST_JSID_TO_STRING(raw_id) as *mut JSAtom;
|
let atom = raw_id.to_string() as *mut JSAtom;
|
||||||
let s = AtomToLinearString(atom);
|
let s = AtomToLinearString(atom);
|
||||||
if GetLinearStringLength(s) == 0 {
|
if GetLinearStringLength(s) == 0 {
|
||||||
return None;
|
return None;
|
||||||
|
@ -451,12 +449,12 @@ pub unsafe extern "C" fn resolve_global(
|
||||||
if *rval {
|
if *rval {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if !RUST_JSID_IS_STRING(id) {
|
if !id.is_string() {
|
||||||
*rval = false;
|
*rval = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let string = RUST_JSID_TO_STRING(id);
|
let string = id.to_string();
|
||||||
if !JS_DeprecatedStringHasLatin1Chars(string) {
|
if !JS_DeprecatedStringHasLatin1Chars(string) {
|
||||||
*rval = false;
|
*rval = false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -82,7 +82,7 @@ use js::glue::{IsWrapper, UnwrapObjectDynamic};
|
||||||
use js::jsapi::Compile1;
|
use js::jsapi::Compile1;
|
||||||
use js::jsapi::SetScriptPrivate;
|
use js::jsapi::SetScriptPrivate;
|
||||||
use js::jsapi::{CurrentGlobalOrNull, GetNonCCWObjectGlobal};
|
use js::jsapi::{CurrentGlobalOrNull, GetNonCCWObjectGlobal};
|
||||||
use js::jsapi::{HandleObject, Heap};
|
use js::jsapi::{HandleObject, Heap, InstantiateGlobalStencil, InstantiateOptions};
|
||||||
use js::jsapi::{JSContext, JSObject, JSScript};
|
use js::jsapi::{JSContext, JSObject, JSScript};
|
||||||
use js::jsval::PrivateValue;
|
use js::jsval::PrivateValue;
|
||||||
use js::jsval::{JSVal, UndefinedValue};
|
use js::jsval::{JSVal, UndefinedValue};
|
||||||
|
@ -120,6 +120,7 @@ use std::collections::hash_map::Entry;
|
||||||
use std::collections::{HashMap, VecDeque};
|
use std::collections::{HashMap, VecDeque};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ops::Index;
|
use std::ops::Index;
|
||||||
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -2625,7 +2626,18 @@ impl GlobalScope {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SourceCode::Compiled(pre_compiled_script) => {
|
SourceCode::Compiled(pre_compiled_script) => {
|
||||||
compiled_script.set(pre_compiled_script.source_code.get());
|
let options = InstantiateOptions {
|
||||||
|
skipFilenameValidation: false,
|
||||||
|
hideScriptFromDebugger: false,
|
||||||
|
deferDebugMetadata: false,
|
||||||
|
};
|
||||||
|
let script = InstantiateGlobalStencil(
|
||||||
|
*cx,
|
||||||
|
&options,
|
||||||
|
*pre_compiled_script.source_code,
|
||||||
|
ptr::null_mut(),
|
||||||
|
);
|
||||||
|
compiled_script.set(script);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ use crate::dom::bindings::reflector::DomObject;
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
use crate::dom::bindings::settings_stack::AutoEntryScript;
|
use crate::dom::bindings::settings_stack::AutoEntryScript;
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
use crate::dom::bindings::trace::RootedTraceableBox;
|
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::Document;
|
||||||
use crate::dom::element::{
|
use crate::dom::element::{
|
||||||
cors_setting_for_element, referrer_policy_for_element, reflect_cross_origin_attribute,
|
cors_setting_for_element, referrer_policy_for_element, reflect_cross_origin_attribute,
|
||||||
|
@ -43,11 +42,11 @@ use encoding_rs::Encoding;
|
||||||
use html5ever::{LocalName, Prefix};
|
use html5ever::{LocalName, Prefix};
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use js::jsapi::{
|
use js::jsapi::{CanCompileOffThread, CompileToStencilOffThread1, OffThreadToken};
|
||||||
CanCompileOffThread, CompileOffThread1, FinishOffThreadScript, Heap, JSScript, OffThreadToken,
|
|
||||||
};
|
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::{transform_str_to_source_text, CompileOptionsWrapper};
|
use js::rust::{
|
||||||
|
transform_str_to_source_text, CompileOptionsWrapper, FinishOffThreadStencil, Stencil,
|
||||||
|
};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use net_traits::request::{
|
use net_traits::request::{
|
||||||
CorsSettings, CredentialsMode, Destination, ParserMetadata, RequestBuilder,
|
CorsSettings, CredentialsMode, Destination, ParserMetadata, RequestBuilder,
|
||||||
|
@ -66,6 +65,7 @@ use std::io::{Read, Seek, Write};
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use style::str::{StaticStringVec, HTML_SPACE_CHARACTERS};
|
use style::str::{StaticStringVec, HTML_SPACE_CHARACTERS};
|
||||||
|
@ -113,21 +113,16 @@ unsafe extern "C" fn off_thread_compilation_callback(
|
||||||
let cx = global.get_cx();
|
let cx = global.get_cx();
|
||||||
let _ar = enter_realm(&*global);
|
let _ar = enter_realm(&*global);
|
||||||
|
|
||||||
rooted!(in(*cx)
|
let compiled_script = FinishOffThreadStencil(*cx, token.0, ptr::null_mut());
|
||||||
let compiled_script = FinishOffThreadScript(*cx, token.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
let load = if compiled_script.get().is_null() {
|
let load = if compiled_script.is_null() {
|
||||||
Err(NetworkError::Internal(
|
Err(NetworkError::Internal(
|
||||||
"Off-thread compilation failed.".into(),
|
"Off-thread compilation failed.".into(),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
let script_text = DOMString::from(script);
|
let script_text = DOMString::from(script);
|
||||||
let heap = Heap::default();
|
|
||||||
let source_code = RootedTraceableBox::new(heap);
|
|
||||||
source_code.set(compiled_script.get());
|
|
||||||
let code = SourceCode::Compiled(CompiledSourceCode {
|
let code = SourceCode::Compiled(CompiledSourceCode {
|
||||||
source_code: source_code,
|
source_code: compiled_script,
|
||||||
original_text: Rc::new(script_text),
|
original_text: Rc::new(script_text),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -244,7 +239,7 @@ pub enum ScriptType {
|
||||||
#[derive(JSTraceable, MallocSizeOf)]
|
#[derive(JSTraceable, MallocSizeOf)]
|
||||||
pub struct CompiledSourceCode {
|
pub struct CompiledSourceCode {
|
||||||
#[ignore_malloc_size_of = "SM handles JS values"]
|
#[ignore_malloc_size_of = "SM handles JS values"]
|
||||||
pub source_code: RootedTraceableBox<Heap<*mut JSScript>>,
|
pub source_code: Stencil,
|
||||||
#[ignore_malloc_size_of = "Rc is hard"]
|
#[ignore_malloc_size_of = "Rc is hard"]
|
||||||
pub original_text: Rc<DOMString>,
|
pub original_text: Rc<DOMString>,
|
||||||
}
|
}
|
||||||
|
@ -446,7 +441,7 @@ impl FetchResponseListener for ClassicContext {
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
assert!(!CompileOffThread1(
|
assert!(!CompileToStencilOffThread1(
|
||||||
*cx,
|
*cx,
|
||||||
options.ptr as *const _,
|
options.ptr as *const _,
|
||||||
&mut transform_str_to_source_text(&context.script_text) as *mut _,
|
&mut transform_str_to_source_text(&context.script_text) as *mut _,
|
||||||
|
@ -1113,7 +1108,9 @@ impl HTMLScriptElement {
|
||||||
.map(|record| record.handle());
|
.map(|record| record.handle());
|
||||||
|
|
||||||
if let Some(record) = record {
|
if let Some(record) = record {
|
||||||
let evaluated = module_tree.execute_module(global, record);
|
rooted!(in(*global.get_cx()) let mut rval = UndefinedValue());
|
||||||
|
let evaluated =
|
||||||
|
module_tree.execute_module(global, record, rval.handle_mut().into());
|
||||||
|
|
||||||
if let Err(exception) = evaluated {
|
if let Err(exception) = evaluated {
|
||||||
module_tree.set_rethrow_error(exception);
|
module_tree.set_rethrow_error(exception);
|
||||||
|
|
|
@ -18,14 +18,15 @@ use js::glue::{
|
||||||
CreateReadableStreamUnderlyingSource, DeleteReadableStreamUnderlyingSource,
|
CreateReadableStreamUnderlyingSource, DeleteReadableStreamUnderlyingSource,
|
||||||
ReadableStreamUnderlyingSourceTraps,
|
ReadableStreamUnderlyingSourceTraps,
|
||||||
};
|
};
|
||||||
use js::jsapi::{HandleObject, HandleValue, Heap, JSContext, JSObject};
|
|
||||||
use js::jsapi::{
|
use js::jsapi::{
|
||||||
IsReadableStream, NewReadableExternalSourceStreamObject, ReadableStreamClose,
|
AutoRequireNoGC, IsReadableStream, JS_GetArrayBufferViewData,
|
||||||
ReadableStreamDefaultReaderRead, ReadableStreamError, ReadableStreamGetReader,
|
NewReadableExternalSourceStreamObject, ReadableStreamClose, ReadableStreamDefaultReaderRead,
|
||||||
ReadableStreamIsDisturbed, ReadableStreamIsLocked, ReadableStreamIsReadable,
|
ReadableStreamError, ReadableStreamGetReader, ReadableStreamIsDisturbed,
|
||||||
ReadableStreamReaderMode, ReadableStreamReaderReleaseLock, ReadableStreamUnderlyingSource,
|
ReadableStreamIsLocked, ReadableStreamIsReadable, ReadableStreamReaderMode,
|
||||||
|
ReadableStreamReaderReleaseLock, ReadableStreamUnderlyingSource,
|
||||||
ReadableStreamUpdateDataAvailableFromSource, UnwrapReadableStream,
|
ReadableStreamUpdateDataAvailableFromSource, UnwrapReadableStream,
|
||||||
};
|
};
|
||||||
|
use js::jsapi::{HandleObject, HandleValue, Heap, JSContext, JSObject};
|
||||||
use js::jsval::JSVal;
|
use js::jsval::JSVal;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::HandleValue as SafeHandleValue;
|
use js::rust::HandleValue as SafeHandleValue;
|
||||||
|
@ -332,11 +333,18 @@ unsafe extern "C" fn write_into_read_request_buffer(
|
||||||
source: *const c_void,
|
source: *const c_void,
|
||||||
_cx: *mut JSContext,
|
_cx: *mut JSContext,
|
||||||
_stream: HandleObject,
|
_stream: HandleObject,
|
||||||
buffer: *mut c_void,
|
chunk: HandleObject,
|
||||||
length: usize,
|
length: usize,
|
||||||
bytes_written: *mut usize,
|
bytes_written: *mut usize,
|
||||||
) {
|
) {
|
||||||
let source = &*(source as *const ExternalUnderlyingSourceController);
|
let source = &*(source as *const ExternalUnderlyingSourceController);
|
||||||
|
let mut is_shared_memory = false;
|
||||||
|
let buffer = JS_GetArrayBufferViewData(
|
||||||
|
*chunk,
|
||||||
|
&mut is_shared_memory,
|
||||||
|
&AutoRequireNoGC { _address: 0 },
|
||||||
|
);
|
||||||
|
assert!(!is_shared_memory);
|
||||||
let slice = slice::from_raw_parts_mut(buffer as *mut u8, length);
|
let slice = slice::from_raw_parts_mut(buffer as *mut u8, length);
|
||||||
source.write_into_buffer(slice);
|
source.write_into_buffer(slice);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::conversions::{root_from_handleobject, ToJSValConvertible};
|
use crate::dom::bindings::conversions::{root_from_handleobject, ToJSValConvertible};
|
||||||
use crate::dom::bindings::error::{throw_dom_exception, Error, Fallible};
|
use crate::dom::bindings::error::{throw_dom_exception, Error, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::proxyhandler::fill_property_descriptor;
|
use crate::dom::bindings::proxyhandler::set_property_descriptor;
|
||||||
use crate::dom::bindings::reflector::{DomObject, Reflector};
|
use crate::dom::bindings::reflector::{DomObject, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
|
@ -33,7 +33,7 @@ use js::jsapi::HandleValue as RawHandleValue;
|
||||||
use js::jsapi::MutableHandle as RawMutableHandle;
|
use js::jsapi::MutableHandle as RawMutableHandle;
|
||||||
use js::jsapi::MutableHandleObject as RawMutableHandleObject;
|
use js::jsapi::MutableHandleObject as RawMutableHandleObject;
|
||||||
use js::jsapi::MutableHandleValue as RawMutableHandleValue;
|
use js::jsapi::MutableHandleValue as RawMutableHandleValue;
|
||||||
use js::jsapi::{JSAutoRealm, JSContext, JSErrNum, JSFreeOp, JSObject};
|
use js::jsapi::{GCContext, JSAutoRealm, JSContext, JSErrNum, JSObject};
|
||||||
use js::jsapi::{JSTracer, JS_DefinePropertyById, JSPROP_ENUMERATE, JSPROP_READONLY};
|
use js::jsapi::{JSTracer, JS_DefinePropertyById, JSPROP_ENUMERATE, JSPROP_READONLY};
|
||||||
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo};
|
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo};
|
||||||
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_IsExceptionPending};
|
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_IsExceptionPending};
|
||||||
|
@ -901,30 +901,26 @@ unsafe extern "C" fn getOwnPropertyDescriptor(
|
||||||
cx: *mut JSContext,
|
cx: *mut JSContext,
|
||||||
proxy: RawHandleObject,
|
proxy: RawHandleObject,
|
||||||
id: RawHandleId,
|
id: RawHandleId,
|
||||||
mut desc: RawMutableHandle<PropertyDescriptor>,
|
desc: RawMutableHandle<PropertyDescriptor>,
|
||||||
|
is_none: *mut bool,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let window = GetSubframeWindowProxy(cx, proxy, id);
|
let window = GetSubframeWindowProxy(cx, proxy, id);
|
||||||
if let Some((window, attrs)) = window {
|
if let Some((window, attrs)) = window {
|
||||||
rooted!(in(cx) let mut val = UndefinedValue());
|
rooted!(in(cx) let mut val = UndefinedValue());
|
||||||
window.to_jsval(cx, val.handle_mut());
|
window.to_jsval(cx, val.handle_mut());
|
||||||
desc.value = val.get();
|
set_property_descriptor(
|
||||||
fill_property_descriptor(MutableHandle::from_raw(desc), proxy.get(), attrs);
|
MutableHandle::from_raw(desc),
|
||||||
|
val.handle().into(),
|
||||||
|
attrs,
|
||||||
|
&mut *is_none,
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut slot = UndefinedValue();
|
let mut slot = UndefinedValue();
|
||||||
GetProxyPrivate(proxy.get(), &mut slot);
|
GetProxyPrivate(proxy.get(), &mut slot);
|
||||||
rooted!(in(cx) let target = slot.to_object());
|
rooted!(in(cx) let target = slot.to_object());
|
||||||
if !JS_GetOwnPropertyDescriptorById(cx, target.handle().into(), id, desc) {
|
return JS_GetOwnPropertyDescriptorById(cx, target.handle().into(), id, desc, is_none);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert!(desc.obj.is_null() || desc.obj == target.get());
|
|
||||||
if desc.obj == target.get() {
|
|
||||||
desc.obj = proxy.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code, non_snake_case)]
|
#[allow(unsafe_code, non_snake_case)]
|
||||||
|
@ -1062,7 +1058,6 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
||||||
hasOwn: None,
|
hasOwn: None,
|
||||||
getOwnEnumerablePropertyKeys: None,
|
getOwnEnumerablePropertyKeys: None,
|
||||||
nativeCall: None,
|
nativeCall: None,
|
||||||
hasInstance: None,
|
|
||||||
objectClassIs: None,
|
objectClassIs: None,
|
||||||
className: None,
|
className: None,
|
||||||
fun_toString: None,
|
fun_toString: None,
|
||||||
|
@ -1161,10 +1156,11 @@ unsafe extern "C" fn getOwnPropertyDescriptor_xorigin(
|
||||||
proxy: RawHandleObject,
|
proxy: RawHandleObject,
|
||||||
id: RawHandleId,
|
id: RawHandleId,
|
||||||
desc: RawMutableHandle<PropertyDescriptor>,
|
desc: RawMutableHandle<PropertyDescriptor>,
|
||||||
|
is_none: *mut bool,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let mut found = false;
|
let mut found = false;
|
||||||
has_xorigin(cx, proxy, id, &mut found);
|
has_xorigin(cx, proxy, id, &mut found);
|
||||||
found && getOwnPropertyDescriptor(cx, proxy, id, desc)
|
found && getOwnPropertyDescriptor(cx, proxy, id, desc, is_none)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code, non_snake_case)]
|
#[allow(unsafe_code, non_snake_case)]
|
||||||
|
@ -1210,7 +1206,6 @@ static XORIGIN_PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
||||||
hasOwn: Some(has_xorigin),
|
hasOwn: Some(has_xorigin),
|
||||||
getOwnEnumerablePropertyKeys: None,
|
getOwnEnumerablePropertyKeys: None,
|
||||||
nativeCall: None,
|
nativeCall: None,
|
||||||
hasInstance: None,
|
|
||||||
objectClassIs: None,
|
objectClassIs: None,
|
||||||
className: None,
|
className: None,
|
||||||
fun_toString: None,
|
fun_toString: None,
|
||||||
|
@ -1226,7 +1221,7 @@ static XORIGIN_PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
||||||
// How WindowProxy objects are garbage collected.
|
// How WindowProxy objects are garbage collected.
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe extern "C" fn finalize(_fop: *mut JSFreeOp, obj: *mut JSObject) {
|
unsafe extern "C" fn finalize(_fop: *mut GCContext, obj: *mut JSObject) {
|
||||||
let mut slot = UndefinedValue();
|
let mut slot = UndefinedValue();
|
||||||
GetProxyReservedSlot(obj, 0, &mut slot);
|
GetProxyReservedSlot(obj, 0, &mut slot);
|
||||||
let this = slot.to_private() as *mut WindowProxy;
|
let this = slot.to_private() as *mut WindowProxy;
|
||||||
|
|
|
@ -44,15 +44,16 @@ use ipc_channel::router::ROUTER;
|
||||||
use js::jsapi::Handle as RawHandle;
|
use js::jsapi::Handle as RawHandle;
|
||||||
use js::jsapi::HandleObject;
|
use js::jsapi::HandleObject;
|
||||||
use js::jsapi::HandleValue as RawHandleValue;
|
use js::jsapi::HandleValue as RawHandleValue;
|
||||||
|
use js::jsapi::MutableHandleValue;
|
||||||
use js::jsapi::Value;
|
use js::jsapi::Value;
|
||||||
use js::jsapi::{CompileModule1, ExceptionStackBehavior, FinishDynamicModuleImport_NoTLA};
|
use js::jsapi::{CompileModule1, ExceptionStackBehavior, FinishDynamicModuleImport};
|
||||||
use js::jsapi::{DynamicImportStatus, SetModuleDynamicImportHook, SetScriptPrivateReferenceHooks};
|
use js::jsapi::{GetModuleRequestSpecifier, GetRequestedModules, SetModuleMetadataHook};
|
||||||
use js::jsapi::{GetModuleResolveHook, JSRuntime, SetModuleResolveHook};
|
use js::jsapi::{GetModuleResolveHook, JSRuntime, SetModuleResolveHook};
|
||||||
use js::jsapi::{GetRequestedModules, SetModuleMetadataHook};
|
|
||||||
use js::jsapi::{Heap, JSContext, JS_ClearPendingException, SetModulePrivate};
|
use js::jsapi::{Heap, JSContext, JS_ClearPendingException, SetModulePrivate};
|
||||||
use js::jsapi::{JSAutoRealm, JSObject, JSString};
|
use js::jsapi::{JSAutoRealm, JSObject, JSString};
|
||||||
use js::jsapi::{JS_DefineProperty4, JS_IsExceptionPending, JS_NewStringCopyN, JSPROP_ENUMERATE};
|
use js::jsapi::{JS_DefineProperty4, JS_IsExceptionPending, JS_NewStringCopyN, JSPROP_ENUMERATE};
|
||||||
use js::jsapi::{ModuleEvaluate, ModuleInstantiate};
|
use js::jsapi::{ModuleErrorBehaviour, ModuleEvaluate, ModuleLink, ThrowOnModuleEvaluationFailure};
|
||||||
|
use js::jsapi::{SetModuleDynamicImportHook, SetScriptPrivateReferenceHooks};
|
||||||
use js::jsval::{JSVal, PrivateValue, UndefinedValue};
|
use js::jsval::{JSVal, PrivateValue, UndefinedValue};
|
||||||
use js::rust::jsapi_wrapped::{GetArrayLength, JS_GetElement};
|
use js::rust::jsapi_wrapped::{GetArrayLength, JS_GetElement};
|
||||||
use js::rust::jsapi_wrapped::{GetRequestedModuleSpecifier, JS_GetPendingException};
|
use js::rust::jsapi_wrapped::{GetRequestedModuleSpecifier, JS_GetPendingException};
|
||||||
|
@ -71,6 +72,7 @@ use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
@ -475,8 +477,8 @@ impl ModuleTree {
|
||||||
let _ac = JSAutoRealm::new(*global.get_cx(), *global.reflector().get_jsobject());
|
let _ac = JSAutoRealm::new(*global.get_cx(), *global.reflector().get_jsobject());
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
if !ModuleInstantiate(*global.get_cx(), module_record) {
|
if !ModuleLink(*global.get_cx(), module_record) {
|
||||||
warn!("fail to instantiate module");
|
warn!("fail to link & instantiate module");
|
||||||
|
|
||||||
rooted!(in(*global.get_cx()) let mut exception = UndefinedValue());
|
rooted!(in(*global.get_cx()) let mut exception = UndefinedValue());
|
||||||
assert!(JS_GetPendingException(
|
assert!(JS_GetPendingException(
|
||||||
|
@ -501,20 +503,31 @@ impl ModuleTree {
|
||||||
&self,
|
&self,
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
module_record: HandleObject,
|
module_record: HandleObject,
|
||||||
|
eval_result: MutableHandleValue,
|
||||||
) -> Result<(), RethrowError> {
|
) -> Result<(), RethrowError> {
|
||||||
let _ac = JSAutoRealm::new(*global.get_cx(), *global.reflector().get_jsobject());
|
let cx = global.get_cx();
|
||||||
|
let _ac = JSAutoRealm::new(*cx, *global.reflector().get_jsobject());
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
rooted!(in(*global.get_cx()) let mut rval = UndefinedValue());
|
let ok = ModuleEvaluate(*cx, module_record, eval_result);
|
||||||
if !ModuleEvaluate(*global.get_cx(), module_record, rval.handle_mut().into()) {
|
assert!(ok, "module evaluation failed");
|
||||||
|
|
||||||
|
rooted!(in(*cx) let mut evaluation_promise = ptr::null_mut::<JSObject>());
|
||||||
|
if eval_result.is_object() {
|
||||||
|
evaluation_promise.set(eval_result.to_object());
|
||||||
|
}
|
||||||
|
|
||||||
|
let throw_result = ThrowOnModuleEvaluationFailure(
|
||||||
|
*cx,
|
||||||
|
evaluation_promise.handle().into(),
|
||||||
|
ModuleErrorBehaviour::ThrowModuleErrorsSync,
|
||||||
|
);
|
||||||
|
if !throw_result {
|
||||||
warn!("fail to evaluate module");
|
warn!("fail to evaluate module");
|
||||||
|
|
||||||
rooted!(in(*global.get_cx()) let mut exception = UndefinedValue());
|
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||||
assert!(JS_GetPendingException(
|
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||||
*global.get_cx(),
|
JS_ClearPendingException(*cx);
|
||||||
&mut exception.handle_mut()
|
|
||||||
));
|
|
||||||
JS_ClearPendingException(*global.get_cx());
|
|
||||||
|
|
||||||
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||||
exception.get(),
|
exception.get(),
|
||||||
|
@ -973,7 +986,8 @@ impl ModuleOwner {
|
||||||
let network_error = module_tree.get_network_error().borrow().as_ref().cloned();
|
let network_error = module_tree.get_network_error().borrow().as_ref().cloned();
|
||||||
let existing_rethrow_error = module_tree.get_rethrow_error().borrow().as_ref().cloned();
|
let existing_rethrow_error = module_tree.get_rethrow_error().borrow().as_ref().cloned();
|
||||||
|
|
||||||
let execution_err = if network_error.is_none() && existing_rethrow_error.is_none() {
|
rooted!(in(*global.get_cx()) let mut rval = UndefinedValue());
|
||||||
|
if network_error.is_none() && existing_rethrow_error.is_none() {
|
||||||
let record = module_tree
|
let record = module_tree
|
||||||
.get_record()
|
.get_record()
|
||||||
.borrow()
|
.borrow()
|
||||||
|
@ -981,58 +995,53 @@ impl ModuleOwner {
|
||||||
.map(|record| record.handle());
|
.map(|record| record.handle());
|
||||||
|
|
||||||
if let Some(record) = record {
|
if let Some(record) = record {
|
||||||
let evaluated = module_tree.execute_module(&global, record).err();
|
let evaluated = module_tree
|
||||||
|
.execute_module(&global, record, rval.handle_mut().into())
|
||||||
|
.err();
|
||||||
|
|
||||||
if let Some(exception) = evaluated.clone() {
|
if let Some(exception) = evaluated.clone() {
|
||||||
module_tree.set_rethrow_error(exception);
|
module_tree.set_rethrow_error(exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
evaluated
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
// Ensure any failures related to importing this dynamic module are immediately reported.
|
// Ensure any failures related to importing this dynamic module are immediately reported.
|
||||||
let status = match (network_error, existing_rethrow_error, execution_err) {
|
match (network_error, existing_rethrow_error) {
|
||||||
(Some(_), _, _) => unsafe {
|
(Some(_), _) => unsafe {
|
||||||
let err = gen_type_error(&global, "Dynamic import failed".to_owned());
|
let err = gen_type_error(&global, "Dynamic import failed".to_owned());
|
||||||
JS_SetPendingException(*cx, err.handle(), ExceptionStackBehavior::Capture);
|
JS_SetPendingException(*cx, err.handle(), ExceptionStackBehavior::Capture);
|
||||||
DynamicImportStatus::Failed
|
|
||||||
},
|
},
|
||||||
(None, _, Some(execution_err)) => unsafe {
|
(None, Some(rethrow_error)) => unsafe {
|
||||||
JS_SetPendingException(
|
|
||||||
*cx,
|
|
||||||
execution_err.handle(),
|
|
||||||
ExceptionStackBehavior::Capture,
|
|
||||||
);
|
|
||||||
DynamicImportStatus::Failed
|
|
||||||
},
|
|
||||||
(None, Some(rethrow_error), _) => unsafe {
|
|
||||||
JS_SetPendingException(
|
JS_SetPendingException(
|
||||||
*cx,
|
*cx,
|
||||||
rethrow_error.handle(),
|
rethrow_error.handle(),
|
||||||
ExceptionStackBehavior::Capture,
|
ExceptionStackBehavior::Capture,
|
||||||
);
|
);
|
||||||
DynamicImportStatus::Failed
|
|
||||||
},
|
},
|
||||||
// do nothing if there's no errors
|
// do nothing if there's no errors
|
||||||
(None, None, None) => DynamicImportStatus::Ok,
|
(None, None) => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("Finishing dynamic import for {:?}", module_identity);
|
debug!("Finishing dynamic import for {:?}", module_identity);
|
||||||
|
|
||||||
|
rooted!(in(*cx) let mut evaluation_promise = ptr::null_mut::<JSObject>());
|
||||||
|
if rval.is_object() {
|
||||||
|
evaluation_promise.set(rval.to_object());
|
||||||
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
FinishDynamicModuleImport_NoTLA(
|
let ok = FinishDynamicModuleImport(
|
||||||
*cx,
|
*cx,
|
||||||
status,
|
evaluation_promise.handle().into(),
|
||||||
module.referencing_private.handle(),
|
module.referencing_private.handle(),
|
||||||
module.specifier.handle(),
|
module.specifier.handle(),
|
||||||
module.promise.reflector().get_jsobject().into_handle(),
|
module.promise.reflector().get_jsobject().into_handle(),
|
||||||
);
|
);
|
||||||
assert!(!JS_IsExceptionPending(*cx));
|
if ok {
|
||||||
|
assert!(!JS_IsExceptionPending(*cx));
|
||||||
|
} else {
|
||||||
|
warn!("failed to finish dynamic module import");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1249,7 +1258,7 @@ unsafe extern "C" fn host_release_top_level_script(value: *const Value) {
|
||||||
pub unsafe extern "C" fn host_import_module_dynamically(
|
pub unsafe extern "C" fn host_import_module_dynamically(
|
||||||
cx: *mut JSContext,
|
cx: *mut JSContext,
|
||||||
reference_private: RawHandleValue,
|
reference_private: RawHandleValue,
|
||||||
specifier: RawHandle<*mut JSString>,
|
specifier: RawHandle<*mut JSObject>,
|
||||||
promise: RawHandle<*mut JSObject>,
|
promise: RawHandle<*mut JSObject>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
|
@ -1339,14 +1348,16 @@ unsafe fn module_script_from_reference_private<'a>(
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn fetch_an_import_module_script_graph(
|
fn fetch_an_import_module_script_graph(
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
specifier: RawHandle<*mut JSString>,
|
module_request: RawHandle<*mut JSObject>,
|
||||||
reference_private: RawHandleValue,
|
reference_private: RawHandleValue,
|
||||||
base_url: ServoUrl,
|
base_url: ServoUrl,
|
||||||
options: ScriptFetchOptions,
|
options: ScriptFetchOptions,
|
||||||
promise: Rc<Promise>,
|
promise: Rc<Promise>,
|
||||||
) -> Result<(), RethrowError> {
|
) -> Result<(), RethrowError> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let url = ModuleTree::resolve_module_specifier(*global.get_cx(), &base_url, specifier);
|
let cx = global.get_cx();
|
||||||
|
rooted!(in(*cx) let specifier = unsafe { GetModuleRequestSpecifier(*cx, module_request) });
|
||||||
|
let url = ModuleTree::resolve_module_specifier(*cx, &base_url, specifier.handle().into());
|
||||||
|
|
||||||
// Step 2.
|
// Step 2.
|
||||||
if url.is_err() {
|
if url.is_err() {
|
||||||
|
@ -1373,7 +1384,7 @@ fn fetch_an_import_module_script_graph(
|
||||||
referencing_private: Heap::default(),
|
referencing_private: Heap::default(),
|
||||||
id: dynamic_module_id,
|
id: dynamic_module_id,
|
||||||
});
|
});
|
||||||
dynamic_module.specifier.set(specifier.get());
|
dynamic_module.specifier.set(module_request.get());
|
||||||
dynamic_module
|
dynamic_module
|
||||||
.referencing_private
|
.referencing_private
|
||||||
.set(reference_private.get());
|
.set(reference_private.get());
|
||||||
|
@ -1402,7 +1413,7 @@ fn fetch_an_import_module_script_graph(
|
||||||
unsafe extern "C" fn HostResolveImportedModule(
|
unsafe extern "C" fn HostResolveImportedModule(
|
||||||
cx: *mut JSContext,
|
cx: *mut JSContext,
|
||||||
reference_private: RawHandleValue,
|
reference_private: RawHandleValue,
|
||||||
specifier: RawHandle<*mut JSString>,
|
specifier: RawHandle<*mut JSObject>,
|
||||||
) -> *mut JSObject {
|
) -> *mut JSObject {
|
||||||
let in_realm_proof = AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx));
|
let in_realm_proof = AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx));
|
||||||
let global_scope = GlobalScope::from_context(cx, InRealm::Already(&in_realm_proof));
|
let global_scope = GlobalScope::from_context(cx, InRealm::Already(&in_realm_proof));
|
||||||
|
@ -1417,7 +1428,12 @@ unsafe extern "C" fn HostResolveImportedModule(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 5.
|
// Step 5.
|
||||||
let url = ModuleTree::resolve_module_specifier(*global_scope.get_cx(), &base_url, specifier);
|
rooted!(in(*global_scope.get_cx()) let specifier = GetModuleRequestSpecifier(cx, specifier));
|
||||||
|
let url = ModuleTree::resolve_module_specifier(
|
||||||
|
*global_scope.get_cx(),
|
||||||
|
&base_url,
|
||||||
|
specifier.handle().into(),
|
||||||
|
);
|
||||||
|
|
||||||
// Step 6.
|
// Step 6.
|
||||||
assert!(url.is_ok());
|
assert!(url.is_ok());
|
||||||
|
@ -1542,7 +1558,7 @@ struct DynamicModule {
|
||||||
#[ignore_malloc_size_of = "Rc is hard"]
|
#[ignore_malloc_size_of = "Rc is hard"]
|
||||||
promise: Rc<Promise>,
|
promise: Rc<Promise>,
|
||||||
#[ignore_malloc_size_of = "GC types are hard"]
|
#[ignore_malloc_size_of = "GC types are hard"]
|
||||||
specifier: Heap<*mut JSString>,
|
specifier: Heap<*mut JSObject>,
|
||||||
#[ignore_malloc_size_of = "GC types are hard"]
|
#[ignore_malloc_size_of = "GC types are hard"]
|
||||||
referencing_private: Heap<JSVal>,
|
referencing_private: Heap<JSVal>,
|
||||||
#[ignore_malloc_size_of = "Defined in uuid"]
|
#[ignore_malloc_size_of = "Defined in uuid"]
|
||||||
|
|
|
@ -52,8 +52,8 @@ use js::jsapi::StreamConsumer as JSStreamConsumer;
|
||||||
use js::jsapi::{BuildIdCharVector, DisableIncrementalGC, GCDescription, GCProgress};
|
use js::jsapi::{BuildIdCharVector, DisableIncrementalGC, GCDescription, GCProgress};
|
||||||
use js::jsapi::{Dispatchable as JSRunnable, Dispatchable_MaybeShuttingDown};
|
use js::jsapi::{Dispatchable as JSRunnable, Dispatchable_MaybeShuttingDown};
|
||||||
use js::jsapi::{
|
use js::jsapi::{
|
||||||
GCReason, JSGCInvocationKind, JSGCStatus, JS_AddExtraGCRootsTracer,
|
GCOptions, GCReason, JSGCStatus, JS_AddExtraGCRootsTracer, JS_RequestInterruptCallback,
|
||||||
JS_RequestInterruptCallback, JS_SetGCCallback,
|
JS_SetGCCallback,
|
||||||
};
|
};
|
||||||
use js::jsapi::{HandleObject, Heap, JobQueue};
|
use js::jsapi::{HandleObject, Heap, JobQueue};
|
||||||
use js::jsapi::{JSContext as RawJSContext, JSTracer, SetDOMCallbacks, SetGCSliceCallback};
|
use js::jsapi::{JSContext as RawJSContext, JSTracer, SetDOMCallbacks, SetGCSliceCallback};
|
||||||
|
@ -791,14 +791,12 @@ unsafe extern "C" fn gc_slice_callback(
|
||||||
};
|
};
|
||||||
if !desc.is_null() {
|
if !desc.is_null() {
|
||||||
let desc: &GCDescription = &*desc;
|
let desc: &GCDescription = &*desc;
|
||||||
let invocation_kind = match desc.invocationKind_ {
|
let options = match desc.options_ {
|
||||||
JSGCInvocationKind::GC_NORMAL => "GC_NORMAL",
|
GCOptions::Normal => "Normal",
|
||||||
JSGCInvocationKind::GC_SHRINK => "GC_SHRINK",
|
GCOptions::Shrink => "Shrink",
|
||||||
|
GCOptions::Shutdown => "Shutdown",
|
||||||
};
|
};
|
||||||
println!(
|
println!(" isZone={}, options={}", desc.isZone_, options);
|
||||||
" isZone={}, invocation_kind={}",
|
|
||||||
desc.isZone_, invocation_kind
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
let _ = stdout().flush();
|
let _ = stdout().flush();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ unicode-segmentation = "1.0"
|
||||||
void = "1.0.2"
|
void = "1.0.2"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
bindgen = { version = "0.58", optional = true, default-features = false }
|
bindgen = { version = "0.62", optional = true, default-features = false }
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
regex = { version = "1.1", optional = true }
|
regex = { version = "1.1", optional = true }
|
||||||
|
|
|
@ -90,7 +90,6 @@ packages = [
|
||||||
# https://github.com/servo/servo/pull/28236
|
# https://github.com/servo/servo/pull/28236
|
||||||
"dlib",
|
"dlib",
|
||||||
"nix",
|
"nix",
|
||||||
"nom",
|
|
||||||
"strsim",
|
"strsim",
|
||||||
|
|
||||||
# Duplicated by webrender debugger via ws
|
# Duplicated by webrender debugger via ws
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[location-prototype-setting-same-origin-domain.sub.html]
|
||||||
|
[Same-origin-domain: setting the prototype to an empty object via __proto__ should throw a TypeError]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
||||||
|
[location-prototype-setting-same-origin.html]
|
||||||
|
[Same-origin: setting the prototype to an empty object via __proto__ should throw a TypeError]
|
||||||
|
expected: FAIL
|
|
@ -16,4 +16,3 @@
|
||||||
|
|
||||||
[Setting `href` to `http://test:test/` of a `Location` object sans browsing context is a no-op]
|
[Setting `href` to `http://test:test/` of a `Location` object sans browsing context is a no-op]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,37 @@
|
||||||
[same-hash.html]
|
[same-hash.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
[Using location.hash = "#te<st" must not reset scroll position]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Using location.hash = "te<st" must not reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.hash = "#te%3Cst" must not reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.hash = "te%3Cst" must not reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.hash = "#te%3cst" must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.hash = "te%3cst" must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.href = "about:srcdoc#te<st" must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.assign("about:srcdoc#te<st") must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.href = "about:srcdoc#te%3cst" must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.assign("about:srcdoc#te%3cst") must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.href = "about:srcdoc#te%3Cst" must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Using location.assign("about:srcdoc#te%3Cst") must reset scroll position]
|
||||||
|
expected: NOTRUN
|
||||||
|
|
|
@ -53,30 +53,6 @@
|
||||||
[A subclass instance will be received as its closest transferable superclass]
|
[A subclass instance will be received as its closest transferable superclass]
|
||||||
expected: PRECONDITION_FAILED
|
expected: PRECONDITION_FAILED
|
||||||
|
|
||||||
[Empty Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[EvalError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[RangeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReferenceError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[SyntaxError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[TypeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[URIError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Object with a getter that throws]
|
[Object with a getter that throws]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -91,30 +67,6 @@
|
||||||
[A subclass instance will be received as its closest transferable superclass]
|
[A subclass instance will be received as its closest transferable superclass]
|
||||||
expected: PRECONDITION_FAILED
|
expected: PRECONDITION_FAILED
|
||||||
|
|
||||||
[Empty Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[EvalError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[RangeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReferenceError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[SyntaxError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[TypeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[URIError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Object with a getter that throws]
|
[Object with a getter that throws]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[blob-data.https.html]
|
[blob-data.https.html]
|
||||||
expected: ERROR
|
expected: TIMEOUT
|
||||||
[blob worker: self.crossOriginIsolated]
|
[blob worker: self.crossOriginIsolated]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -44,4 +44,3 @@
|
||||||
|
|
||||||
[data worker: self.isSecureContext]
|
[data worker: self.isSecureContext]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
[Bonus: self.crossOriginIsolated]
|
[Bonus: self.crossOriginIsolated]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[SharedArrayBuffer constructor does not exist without COOP+COEP]
|
[SharedArrayBuffer over MessageChannel without COOP+COEP]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[SharedArrayBuffer over BroadcastChannel without COOP+COEP]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +13,13 @@
|
||||||
[Bonus: self.crossOriginIsolated]
|
[Bonus: self.crossOriginIsolated]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[SharedArrayBuffer constructor does not exist without COOP+COEP]
|
[SharedArrayBuffer over MessageChannel without COOP+COEP]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[SharedArrayBuffer over BroadcastChannel without COOP+COEP]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[SharedArrayBuffer over postMessage() without COOP+COEP]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
[no-transferring.https.html]
|
||||||
|
[Trying to transfer a SharedArrayBuffer to this window throws]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Trying to transfer a SharedArrayBuffer to a worker throws]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Trying to transfer a SharedArrayBuffer through a MessagePort throws]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,12 @@
|
||||||
|
[serialization-via-history.https.html]
|
||||||
|
[history.pushState(): simple case]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[history.pushState(): is interleaved correctly]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[history.replaceState(): simple case]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[history.replaceState(): is interleaved correctly]
|
||||||
|
expected: FAIL
|
|
@ -1,5 +1,3 @@
|
||||||
[window-domain-failure.https.sub.html]
|
[window-domain-failure.https.sub.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[SharedArrayBuffer and a same-origin-domain (but not same-origin) iframe]
|
[SharedArrayBuffer and a same-origin-domain (but not same-origin) iframe]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -38,3 +38,8 @@
|
||||||
[postMessaging to a dedicated worker allows them to see each others' modifications with Float32Array]
|
[postMessaging to a dedicated worker allows them to see each others' modifications with Float32Array]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[postMessaging to a dedicated worker allows them to see each others' modifications with BigInt64Array]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[postMessaging to a dedicated worker allows them to see each others' modifications with BigUint64Array]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
[structured-cloning-error-extra.html]
|
[structured-cloning-error-extra.html]
|
||||||
expected: ERROR
|
|
||||||
[Throwing name getter fails serialization]
|
[Throwing name getter fails serialization]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Errors sent across realms should preserve their type]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -6,48 +6,11 @@
|
||||||
[ImageData expandos are not cloned]
|
[ImageData expandos are not cloned]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[ReferenceError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error.message: getter is ignored when cloning]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[DOMException objects created by the UA can be cloned]
|
[DOMException objects created by the UA can be cloned]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[EvalError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[URIError objects from other realms are treated as Error]
|
[URIError objects from other realms are treated as Error]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[DOMException objects can be cloned]
|
[DOMException objects can be cloned]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[URIError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Cloning a modified Error]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[RangeError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Empty Error objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[TypeError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error.message: undefined property is stringified]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[SyntaxError objects can be cloned]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[URIError objects from other realms are treated as URIError]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -53,29 +53,5 @@
|
||||||
[A subclass instance will be received as its closest transferable superclass]
|
[A subclass instance will be received as its closest transferable superclass]
|
||||||
expected: PRECONDITION_FAILED
|
expected: PRECONDITION_FAILED
|
||||||
|
|
||||||
[Empty Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Error object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[EvalError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[RangeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReferenceError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[SyntaxError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[TypeError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[URIError object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Object with a getter that throws]
|
[Object with a getter that throws]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[module-tla-delayed.html]
|
|
||||||
expected: TIMEOUT
|
|
||||||
[document.write in an imported module]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[module-tla-immediate-promise.html]
|
|
||||||
expected: TIMEOUT
|
|
||||||
[document.write in an imported module]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[module-tla-import.html]
|
[module-tla-import.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[document.write in an imported module]
|
[document.write in an imported module]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[no-new-global.window.html]
|
[no-new-global.window.html]
|
||||||
[BarProp maintains its prototype and properties through open()]
|
[BarProp maintains its prototype and properties through open()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
[Location maintains its prototype and properties through open()]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,2 +1,36 @@
|
||||||
[HostEnsureCanAddPrivateElement.window.html]
|
[HostEnsureCanAddPrivateElement.window.html]
|
||||||
expected: ERROR
|
[Same Origin: WindowProxy]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Cross Origin (port): WindowProxy]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Cross Origin (remote): WindowProxy]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Same Origin + document.domain WindowProxy]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[(After document.domain set) Same Origin + document.domain WindowProxy does carry private fields after navigation]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[(After document.domain set) Local navigation (setdomain) WindowProxy does carry private fields after navigation]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Same Origin: Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Cross Origin (remote): Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Cross Origin: Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Same Origin + document.domain: Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[(After document.domain set) Same Origin + document.domain: Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[(After document.domain set) Local navigation (setdomain) Location]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -270,4 +270,3 @@
|
||||||
|
|
||||||
[close() while next() is pending]
|
[close() while next() is pending]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
[Constructing a ReadableStreamDefaultReader directly should fail if the stream is already locked (via direct construction)]
|
[Constructing a ReadableStreamDefaultReader directly should fail if the stream is already locked (via direct construction)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[getReader() should call ToString() on mode]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Second reader can read chunks after first reader was released with pending read requests]
|
[Second reader can read chunks after first reader was released with pending read requests]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -55,8 +52,5 @@
|
||||||
[Constructing a ReadableStreamDefaultReader directly should fail if the stream is already locked (via direct construction)]
|
[Constructing a ReadableStreamDefaultReader directly should fail if the stream is already locked (via direct construction)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[getReader() should call ToString() on mode]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Second reader can read chunks after first reader was released with pending read requests]
|
[Second reader can read chunks after first reader was released with pending read requests]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -8,9 +8,6 @@
|
||||||
[ReadableStream instances should have the correct list of properties]
|
[ReadableStream instances should have the correct list of properties]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[default ReadableStream getReader() should only accept mode:undefined]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReadableStream can't be constructed with an invalid type]
|
[ReadableStream can't be constructed with an invalid type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -22,12 +19,8 @@
|
||||||
[ReadableStream instances should have the correct list of properties]
|
[ReadableStream instances should have the correct list of properties]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[default ReadableStream getReader() should only accept mode:undefined]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReadableStream can't be constructed with an invalid type]
|
[ReadableStream can't be constructed with an invalid type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[ReadableStream: if pull rejects, it should error the stream]
|
[ReadableStream: if pull rejects, it should error the stream]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -2,75 +2,8 @@
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[tee.any.worker.html]
|
[tee.any.worker.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[ReadableStreamTee should not pull more chunks than can fit in the branch queue]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while branch 1 is reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while both branches are reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while branch 2 is reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling branch1 should finish when branch2 reads until end of stream]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling branch1 should finish when original stream errors]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee should only pull enough to fill the emptiest queue]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee should not pull when original is already errored]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling both branches in sequence with delay]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: failing to cancel when canceling both branches in sequence with delay]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: enqueue() and close() while both branches are pulling]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
|
|
||||||
[tee.any.serviceworker.html]
|
[tee.any.serviceworker.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[tee.any.html]
|
[tee.any.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[ReadableStreamTee should not pull more chunks than can fit in the branch queue]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while branch 1 is reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while both branches are reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee stops pulling when original stream errors while branch 2 is reading]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling branch1 should finish when branch2 reads until end of stream]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling branch1 should finish when original stream errors]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee should only pull enough to fill the emptiest queue]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStreamTee should not pull when original is already errored]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: canceling both branches in sequence with delay]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: failing to cancel when canceling both branches in sequence with delay]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
||||||
[ReadableStream teeing: enqueue() and close() while both branches are pulling]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
|
@ -8,9 +8,6 @@
|
||||||
[ReadableStream (empty): instances have the correct methods and properties]
|
[ReadableStream (empty): instances have the correct methods and properties]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[ReadableStream (empty): calling getReader with invalid arguments should throw appropriate errors]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReadableStream (empty) reader: releasing the lock should reject all pending read requests]
|
[ReadableStream (empty) reader: releasing the lock should reject all pending read requests]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -19,8 +16,5 @@
|
||||||
[ReadableStream (empty): instances have the correct methods and properties]
|
[ReadableStream (empty): instances have the correct methods and properties]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[ReadableStream (empty): calling getReader with invalid arguments should throw appropriate errors]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[ReadableStream (empty) reader: releasing the lock should reject all pending read requests]
|
[ReadableStream (empty) reader: releasing the lock should reject all pending read requests]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
[multi-value.any.worker.html]
|
|
||||||
[multiple return values from wasm to js]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[multiple return values inside wasm]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[multiple return values from js to wasm]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[multi-value.any.html]
|
|
||||||
[multiple return values from wasm to js]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[multiple return values inside wasm]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[multiple return values from js to wasm]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,19 +1,4 @@
|
||||||
[basic.tentative.any.worker.html]
|
[basic.tentative.any.worker.html]
|
||||||
[Wasm function throws argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Wasm function throws null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Wasm function throws integer]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Imported JS function throws]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Imported JS function throws, Wasm catches and rethrows]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[basic.tentative.any.sharedworker.html]
|
[basic.tentative.any.sharedworker.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
@ -22,17 +7,3 @@
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[basic.tentative.any.html]
|
[basic.tentative.any.html]
|
||||||
[Wasm function throws argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Wasm function throws null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Wasm function throws integer]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Imported JS function throws]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Imported JS function throws, Wasm catches and rethrows]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
[constructor.tentative.any.worker.html]
|
|
||||||
[name]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[length]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Calling]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[constructor.tentative.any.html]
|
|
||||||
[name]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[length]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Calling]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
|
@ -1,32 +0,0 @@
|
||||||
[getArg.tentative.any.worker.html]
|
|
||||||
[Missing arguments]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Index out of bounds]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Getting out-of-range argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[getArg]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[getArg.tentative.any.html]
|
|
||||||
[Missing arguments]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Index out of bounds]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Getting out-of-range argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[getArg]
|
|
||||||
expected: FAIL
|
|
|
@ -1,20 +0,0 @@
|
||||||
[is.tentative.any.worker.html]
|
|
||||||
[Missing arguments]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[is]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[is.tentative.any.html]
|
|
||||||
[Missing arguments]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Invalid exception argument]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[is]
|
|
||||||
expected: FAIL
|
|
|
@ -1,14 +0,0 @@
|
||||||
[toString.tentative.any.html]
|
|
||||||
[Object.prototype.toString on an Exception]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[@@toStringTag exists on the prototype with the appropriate descriptor]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[toString.tentative.any.worker.html]
|
|
||||||
[Object.prototype.toString on an Exception]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[@@toStringTag exists on the prototype with the appropriate descriptor]
|
|
||||||
expected: FAIL
|
|
|
@ -1,14 +0,0 @@
|
||||||
[constructor.tentative.any.html]
|
|
||||||
[name]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[length]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[constructor.tentative.any.worker.html]
|
|
||||||
[name]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[length]
|
|
||||||
expected: FAIL
|
|
|
@ -1,14 +0,0 @@
|
||||||
[toString.tentative.any.html]
|
|
||||||
[Object.prototype.toString on a Tag]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[@@toStringTag exists on the prototype with the appropriate descriptor]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[toString.tentative.any.worker.html]
|
|
||||||
[Object.prototype.toString on a Tag]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[@@toStringTag exists on the prototype with the appropriate descriptor]
|
|
||||||
expected: FAIL
|
|
|
@ -8,9 +8,6 @@
|
||||||
[Create mew session in end promise - webgl2]
|
[Create mew session in end promise - webgl2]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Create mew session in end promise - webgl]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Create new session in OnSessionEnded event - webgl2]
|
[Create new session in OnSessionEnded event - webgl2]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
[send-data-es-object.any.html]
|
|
||||||
[sending a new ReadableStream instance]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[send-data-es-object.any.worker.html]
|
|
||||||
[sending a new ReadableStream instance]
|
|
||||||
expected: FAIL
|
|
|
@ -1,5 +0,0 @@
|
||||||
[localeCompare.html]
|
|
||||||
bug: https://github.com/servo/servo/issues/25802
|
|
||||||
[localeCompare should return the same as other browsers, even though it's implementation-dependent]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue