mirror of
https://github.com/servo/servo.git
synced 2025-10-02 17:49:16 +01:00
Implement fetchLater
(#39547)
Allows fetches to be deferred, only in a secure context. It does not yet implement quota computation, since we don't have a concept of document quota yet. Also update the `fetch/api/idlharness` test to run in a secure context, since this API is only available there. Positive Mozilla position: https://github.com/mozilla/standards-positions/issues/703 Positive WebKit position: https://github.com/WebKit/standards-positions/issues/85 Closes whatwg/fetch#1858 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
19c498af16
commit
680a780552
39 changed files with 403 additions and 228 deletions
|
@ -659,7 +659,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'Window': {
|
||||
'canGc': ['CreateImageBitmap', 'CreateImageBitmap_', 'CookieStore', 'Fetch', 'Open', 'SetInterval', 'SetTimeout', 'Stop', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'canGc': ['CreateImageBitmap', 'CreateImageBitmap_', 'CookieStore', 'Fetch', 'FetchLater', 'Open', 'SetInterval', 'SetTimeout', 'Stop', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'inRealms': ['Fetch', 'GetOpener', 'WebdriverCallback', 'WebdriverException'],
|
||||
'additionalTraits': ['crate::interfaces::WindowHelpers'],
|
||||
},
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-method
|
||||
[Exposed=Window]
|
||||
interface FetchLaterResult {
|
||||
readonly attribute boolean activated;
|
||||
};
|
|
@ -189,3 +189,12 @@ partial interface Window {
|
|||
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
|
||||
USVString targetOrigin = "/";
|
||||
};
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-method
|
||||
dictionary DeferredRequestInit : RequestInit {
|
||||
DOMHighResTimeStamp activateAfter;
|
||||
};
|
||||
|
||||
partial interface Window {
|
||||
[NewObject, SecureContext, Throws] FetchLaterResult fetchLater(RequestInfo input, optional DeferredRequestInit init = {});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue