mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fix: Return error and avoid panicking in SetOpener function (#33002)
* Fix: Return error and avoid panicking in SetOpener function Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * eturn JSFailed onstead of InvalidState Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Update wpt test result Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
a797969efe
commit
df8ccafa7c
5 changed files with 22 additions and 21 deletions
|
@ -418,7 +418,7 @@ impl WindowProxy {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-opener
|
||||
pub fn opener(&self, cx: *mut JSContext, in_realm_proof: InRealm) -> JSVal {
|
||||
pub fn opener(&self, cx: *mut JSContext) -> JSVal {
|
||||
if self.disowned.get() {
|
||||
return NullValue();
|
||||
}
|
||||
|
@ -436,8 +436,11 @@ impl WindowProxy {
|
|||
opener_id,
|
||||
) {
|
||||
Some(opener_top_id) => {
|
||||
let global_to_clone_from =
|
||||
unsafe { GlobalScope::from_context(cx, in_realm_proof) };
|
||||
let in_realm_proof =
|
||||
AlreadyInRealm::assert_for_cx(unsafe { SafeJSContext::from_ptr(cx) });
|
||||
let global_to_clone_from = unsafe {
|
||||
GlobalScope::from_context(cx, InRealm::Already(&in_realm_proof))
|
||||
};
|
||||
let creator =
|
||||
CreatorBrowsingContextInfo::from(parent_browsing_context, None);
|
||||
WindowProxy::new_dissimilar_origin(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue