mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Update codegen for GetOpener:inRealms in Bindings.conf (#33062)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
86c4e014b4
commit
c01b733523
3 changed files with 6 additions and 9 deletions
|
@ -69,7 +69,7 @@ DOMInterfaces = {
|
||||||
},
|
},
|
||||||
|
|
||||||
'Window': {
|
'Window': {
|
||||||
'inRealms': ['Fetch', 'Opener'],
|
'inRealms': ['Fetch', 'GetOpener'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'WorkerGlobalScope': {
|
'WorkerGlobalScope': {
|
||||||
|
|
|
@ -702,7 +702,7 @@ impl WindowMethods for Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-opener
|
// https://html.spec.whatwg.org/multipage/#dom-opener
|
||||||
fn GetOpener(&self, cx: JSContext) -> Fallible<JSVal> {
|
fn GetOpener(&self, cx: JSContext, in_realm_proof: InRealm) -> Fallible<JSVal> {
|
||||||
// Step 1, Let current be this Window object's browsing context.
|
// Step 1, Let current be this Window object's browsing context.
|
||||||
let current = match self.window_proxy.get() {
|
let current = match self.window_proxy.get() {
|
||||||
Some(proxy) => proxy,
|
Some(proxy) => proxy,
|
||||||
|
@ -717,7 +717,7 @@ impl WindowMethods for Window {
|
||||||
return Ok(NullValue());
|
return Ok(NullValue());
|
||||||
}
|
}
|
||||||
// Step 3 to 5.
|
// Step 3 to 5.
|
||||||
Ok(current.opener(*cx))
|
Ok(current.opener(*cx, in_realm_proof))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
|
|
|
@ -418,7 +418,7 @@ impl WindowProxy {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-opener
|
// https://html.spec.whatwg.org/multipage/#dom-opener
|
||||||
pub fn opener(&self, cx: *mut JSContext) -> JSVal {
|
pub fn opener(&self, cx: *mut JSContext, in_realm_proof: InRealm) -> JSVal {
|
||||||
if self.disowned.get() {
|
if self.disowned.get() {
|
||||||
return NullValue();
|
return NullValue();
|
||||||
}
|
}
|
||||||
|
@ -436,11 +436,8 @@ impl WindowProxy {
|
||||||
opener_id,
|
opener_id,
|
||||||
) {
|
) {
|
||||||
Some(opener_top_id) => {
|
Some(opener_top_id) => {
|
||||||
let in_realm_proof =
|
let global_to_clone_from =
|
||||||
AlreadyInRealm::assert_for_cx(unsafe { SafeJSContext::from_ptr(cx) });
|
unsafe { GlobalScope::from_context(cx, in_realm_proof) };
|
||||||
let global_to_clone_from = unsafe {
|
|
||||||
GlobalScope::from_context(cx, InRealm::Already(&in_realm_proof))
|
|
||||||
};
|
|
||||||
let creator =
|
let creator =
|
||||||
CreatorBrowsingContextInfo::from(parent_browsing_context, None);
|
CreatorBrowsingContextInfo::from(parent_browsing_context, None);
|
||||||
WindowProxy::new_dissimilar_origin(
|
WindowProxy::new_dissimilar_origin(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue