Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / webidl / DOMRequest.webidl
blobe7e40cfd6d604fc4b0496067404a66041c97221c
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 enum DOMRequestReadyState { "pending", "done" };
8 [Exposed=(Window,Worker)]
9 interface mixin DOMRequestShared {
10   readonly attribute DOMRequestReadyState readyState;
12   readonly attribute any result;
13   readonly attribute DOMException? error;
15   attribute EventHandler onsuccess;
16   attribute EventHandler onerror;
19 [Exposed=(Window,Worker)]
20 interface DOMRequest : EventTarget {
21   // The [TreatNonCallableAsNull] annotation is required since then() should do
22   // nothing instead of throwing errors when non-callable arguments are passed.
23   // See documentation for Promise.then to see why we return "any".
24   [NewObject, Throws]
25   any then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null,
26            [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
28   [ChromeOnly]
29   undefined fireDetailedError(DOMException aError);
32 DOMRequest includes DOMRequestShared;