mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 15:47:30 +09:00
Issue #2197 - Part 2d: Implement PostMessageOptions for Window
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
This commit is contained in:
parent
4d58139fe1
commit
4174037d8a
4 changed files with 23 additions and 7 deletions
|
|
@ -8904,6 +8904,17 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx,
|
||||||
aSubjectPrincipal, aRv);
|
aSubjectPrincipal, aRv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsGlobalWindow::PostMessageMoz(JSContext* aCx,
|
||||||
|
JS::Handle<JS::Value> aMessage,
|
||||||
|
const WindowPostMessageOptions& aOptions,
|
||||||
|
nsIPrincipal& aSubjectPrincipal,
|
||||||
|
ErrorResult& aRv)
|
||||||
|
{
|
||||||
|
PostMessageMoz(aCx, aMessage, aOptions.mTargetOrigin, aOptions.mTransfer,
|
||||||
|
aSubjectPrincipal, aRv);
|
||||||
|
}
|
||||||
|
|
||||||
class nsCloseEvent : public Runnable {
|
class nsCloseEvent : public Runnable {
|
||||||
|
|
||||||
RefPtr<nsGlobalWindow> mWindow;
|
RefPtr<nsGlobalWindow> mWindow;
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ class TabGroup;
|
||||||
class Timeout;
|
class Timeout;
|
||||||
class U2F;
|
class U2F;
|
||||||
class WakeLock;
|
class WakeLock;
|
||||||
|
struct WindowPostMessageOptions;
|
||||||
class Worklet;
|
class Worklet;
|
||||||
namespace cache {
|
namespace cache {
|
||||||
class CacheStorage;
|
class CacheStorage;
|
||||||
|
|
@ -936,6 +937,11 @@ public:
|
||||||
const mozilla::dom::Sequence<JSObject*>& aTransfer,
|
const mozilla::dom::Sequence<JSObject*>& aTransfer,
|
||||||
nsIPrincipal& aSubjectPrincipal,
|
nsIPrincipal& aSubjectPrincipal,
|
||||||
mozilla::ErrorResult& aRv);
|
mozilla::ErrorResult& aRv);
|
||||||
|
void PostMessageMoz(JSContext* aCx,
|
||||||
|
JS::Handle<JS::Value> aMessage,
|
||||||
|
const mozilla::dom::WindowPostMessageOptions& aOptions,
|
||||||
|
nsIPrincipal& aSubjectPrincipal,
|
||||||
|
mozilla::ErrorResult& aError);
|
||||||
int32_t SetTimeout(JSContext* aCx, mozilla::dom::Function& aFunction,
|
int32_t SetTimeout(JSContext* aCx, mozilla::dom::Function& aFunction,
|
||||||
int32_t aTimeout,
|
int32_t aTimeout,
|
||||||
const mozilla::dom::Sequence<JS::Value>& aArguments,
|
const mozilla::dom::Sequence<JS::Value>& aArguments,
|
||||||
|
|
|
||||||
|
|
@ -383,13 +383,6 @@ var tests =
|
||||||
|
|
||||||
hasWrongReturnOriginBug: true
|
hasWrongReturnOriginBug: true
|
||||||
},
|
},
|
||||||
// 55
|
|
||||||
{
|
|
||||||
args: ["NOT-RECEIVED", undefined],
|
|
||||||
source: "sameDomain",
|
|
||||||
name: "SyntaxError",
|
|
||||||
code: DOMException.SYNTAX_ERR
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
function allTests(callback)
|
function allTests(callback)
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ interface nsIDOMCrypto;
|
||||||
|
|
||||||
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
||||||
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
||||||
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
||||||
|
void postMessage(any message, optional WindowPostMessageOptions options);
|
||||||
|
|
||||||
// also has obsolete members
|
// also has obsolete members
|
||||||
};
|
};
|
||||||
|
|
@ -485,3 +487,7 @@ callback IdleRequestCallback = void (IdleDeadline deadline);
|
||||||
partial interface Window {
|
partial interface Window {
|
||||||
[ChromeOnly] readonly attribute boolean isSecureContextIfOpenerIgnored;
|
[ChromeOnly] readonly attribute boolean isSecureContextIfOpenerIgnored;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
|
||||||
|
USVString targetOrigin = "/";
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue