Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / dom / webidl / Directory.webidl
blob942d50c7cba78302b7f4d8f4bb4811948fda8d3b
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  */
7 /*
8  * All functions on Directory that accept DOMString arguments for file or
9  * directory names only allow relative path to current directory itself. The
10  * path should be a descendent path like "path/to/file.txt" and not contain a
11  * segment of ".." or ".". So the paths aren't allowed to walk up the directory
12  * tree. For example, paths like "../foo", "..", "/foo/bar" or "foo/../bar" are
13  * not allowed.
14  *
15  * http://w3c.github.io/filesystem-api/#idl-def-Directory
16  * https://microsoftedge.github.io/directory-upload/proposal.html#directory-interface
17  */
19 // This chromeConstructor is used by the MockFilePicker for testing only.
20 [ChromeConstructor(DOMString path),
21  Exposed=(Window,Worker)]
22 interface Directory {
23   /*
24    * The leaf name of the directory.
25    */
26   [Throws]
27   readonly attribute DOMString name;
30 [Exposed=(Window,Worker)]
31 partial interface Directory {
32   // Already defined in the main interface declaration:
33   //readonly attribute DOMString name;
35   /*
36    * The path of the Directory (includes both its basename and leafname).
37    * The path begins with the name of the ancestor Directory that was
38    * originally exposed to content (say via a directory picker) and traversed
39    * to obtain this Directory.  Full filesystem paths are not exposed to
40    * unprivilaged content.
41    */
42   [Throws]
43   readonly attribute DOMString path;
45   /*
46    * Getter for the immediate children of this directory.
47    */
48   [Throws]
49   Promise<sequence<(File or Directory)>> getFilesAndDirectories();
51   [Throws]
52   Promise<sequence<File>> getFiles(optional boolean recursiveFlag = false);