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 origins of this IDL file are
7 * http://url.spec.whatwg.org/#api
8 * http://dev.w3.org/2006/webapi/FileAPI/#creating-revoking
9 *
10 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
11 * liability, trademark and document use rules apply.
12 */
13
14[Exposed=(Window,Worker,WorkerDebugger),
15 LegacyWindowAlias=webkitURL]
16interface URL {
17  [Throws]
18  constructor(USVString url, optional USVString base);
19
20  [SetterThrows]
21  stringifier attribute USVString href;
22  [GetterThrows]
23  readonly attribute USVString origin;
24  [SetterThrows]
25           attribute USVString protocol;
26           attribute USVString username;
27           attribute USVString password;
28           attribute USVString host;
29           attribute USVString hostname;
30           attribute USVString port;
31           attribute USVString pathname;
32           attribute USVString search;
33  [SameObject]
34  readonly attribute URLSearchParams searchParams;
35           attribute USVString hash;
36
37  USVString toJSON();
38};
39
40[Exposed=(Window,DedicatedWorker,SharedWorker)]
41partial interface URL {
42  [Throws]
43  static DOMString createObjectURL(Blob blob);
44  [Throws]
45  static void revokeObjectURL(DOMString url);
46  [ChromeOnly, Throws]
47  static boolean isValidURL(DOMString url);
48
49  // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
50  [Throws]
51  static DOMString createObjectURL(MediaSource source);
52};
53