Bug 1841281 - Disable test_basics.html on mac debug and windows for frequent failures...
[gecko.git] / dom / webidl / File.webidl
blob32cc9b7713803e561a76e61c33f298994e839e8d
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 file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://w3c.github.io/FileAPI/#file
8  * https://wicg.github.io/entries-api
9  */
11 interface nsIFile;
13 [Exposed=(Window,Worker)]
14 interface File : Blob {
15   [Throws]
16   constructor(sequence<BlobPart> fileBits,
17               USVString fileName, optional FilePropertyBag options = {});
19   readonly attribute DOMString name;
21   [GetterThrows]
22   readonly attribute long long lastModified;
25 dictionary FilePropertyBag : BlobPropertyBag {
26   long long lastModified;
29 dictionary ChromeFilePropertyBag : FilePropertyBag {
30   DOMString name = "";
31   boolean existenceCheck = true;
34 // https://wicg.github.io/entries-api
35 partial interface File {
36   [BinaryName="relativePath", Pref="dom.webkitBlink.dirPicker.enabled"]
37   readonly attribute USVString webkitRelativePath;
40 // Mozilla extensions
41 partial interface File {
42   [GetterThrows, ChromeOnly, NeedsCallerType]
43   readonly attribute DOMString mozFullPath;
46 // Mozilla extensions
47 // These 2 methods can be used only in these conditions:
48 // - the main-thread
49 // - parent process OR file process OR, only for testing, with pref
50 //   `dom.file.createInChild' set to true.
51 [Exposed=(Window)]
52 partial interface File {
53   [ChromeOnly, NewObject, NeedsCallerType]
54   static Promise<File> createFromNsIFile(nsIFile file,
55                                          optional ChromeFilePropertyBag options = {});
57   [ChromeOnly, NewObject, NeedsCallerType]
58   static Promise<File> createFromFileName(USVString fileName,
59                                           optional ChromeFilePropertyBag options = {});