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[Constructor(USVString url, optional USVString base),
15 Exposed=(Window,Worker,WorkerDebugger)]
16interface URL {
17  // Bug 824857: no support for stringifier attributes yet.
18  //  stringifier attribute USVString href;
19
20  // Bug 824857 should remove this.
21  stringifier;
22
23  [SetterThrows]
24  attribute USVString href;
25  [GetterThrows]
26  readonly attribute USVString origin;
27  [SetterThrows]
28           attribute USVString protocol;
29           attribute USVString username;
30           attribute USVString password;
31           attribute USVString host;
32           attribute USVString hostname;
33           attribute USVString port;
34           attribute USVString pathname;
35           attribute USVString search;
36  [SameObject]
37  readonly attribute URLSearchParams searchParams;
38           attribute USVString hash;
39
40  USVString toJSON();
41};
42
43partial interface URL {
44  [Throws]
45  static DOMString createObjectURL(Blob blob);
46  [Throws]
47  static undefined revokeObjectURL(DOMString url);
48  [ChromeOnly, Throws]
49  static boolean isValidURL(DOMString url);
50};
51
52// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
53partial interface URL {
54  [Throws]
55  static DOMString createObjectURL(MediaSource source);
56};
57