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 * http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
8 * http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
9 *
10 * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
11 * Opera Software ASA. You are granted a license to use, reproduce
12 * and create derivative works of this document.
13 */
14
15// http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
16[NeedResolve,
17 Exposed=Window]
18interface HTMLObjectElement : HTMLElement {
19  [HTMLConstructor] constructor();
20
21  [CEReactions, Pure, SetterThrows]
22           attribute DOMString data;
23  [CEReactions, Pure, SetterThrows]
24           attribute DOMString type;
25  [CEReactions, Pure, SetterThrows]
26           attribute DOMString name;
27  [CEReactions, Pure, SetterThrows]
28           attribute DOMString useMap;
29  [Pure]
30  readonly attribute HTMLFormElement? form;
31  [CEReactions, Pure, SetterThrows]
32           attribute DOMString width;
33  [CEReactions, Pure, SetterThrows]
34           attribute DOMString height;
35  // Not pure: can trigger about:blank instantiation
36  [NeedsSubjectPrincipal]
37  readonly attribute Document? contentDocument;
38  // Not pure: can trigger about:blank instantiation
39  [NeedsSubjectPrincipal]
40  readonly attribute WindowProxy? contentWindow;
41
42  readonly attribute boolean willValidate;
43  readonly attribute ValidityState validity;
44  [Throws]
45  readonly attribute DOMString validationMessage;
46  boolean checkValidity();
47  boolean reportValidity();
48  void setCustomValidity(DOMString error);
49};
50
51// http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
52partial interface HTMLObjectElement {
53  [CEReactions, Pure, SetterThrows]
54           attribute DOMString align;
55  [CEReactions, Pure, SetterThrows]
56           attribute DOMString archive;
57  [CEReactions, Pure, SetterThrows]
58           attribute DOMString code;
59  [CEReactions, Pure, SetterThrows]
60           attribute boolean declare;
61  [CEReactions, Pure, SetterThrows]
62           attribute unsigned long hspace;
63  [CEReactions, Pure, SetterThrows]
64           attribute DOMString standby;
65  [CEReactions, Pure, SetterThrows]
66           attribute unsigned long vspace;
67  [CEReactions, Pure, SetterThrows]
68           attribute DOMString codeBase;
69  [CEReactions, Pure, SetterThrows]
70           attribute DOMString codeType;
71
72  [CEReactions, Pure, SetterThrows]
73           attribute [LegacyNullToEmptyString] DOMString border;
74};
75
76partial interface HTMLObjectElement {
77  // GetSVGDocument
78  [NeedsSubjectPrincipal]
79  Document? getSVGDocument();
80};
81
82interface mixin MozObjectLoadingContent {
83  // Mirrored chrome-only scriptable nsIObjectLoadingContent methods.  Please
84  // make sure to update this list if nsIObjectLoadingContent changes.  Also,
85  // make sure everything on here is [ChromeOnly].
86  [ChromeOnly]
87  const unsigned long TYPE_LOADING     = 0;
88  [ChromeOnly]
89  const unsigned long TYPE_IMAGE       = 1;
90  [ChromeOnly]
91  const unsigned long TYPE_FALLBACK    = 2;
92  [ChromeOnly]
93  const unsigned long TYPE_FAKE_PLUGIN = 3;
94  [ChromeOnly]
95  const unsigned long TYPE_DOCUMENT    = 4;
96  [ChromeOnly]
97  const unsigned long TYPE_NULL        = 5;
98
99  /**
100   * The actual mime type (the one we got back from the network
101   * request) for the element.
102   */
103  [ChromeOnly]
104  readonly attribute DOMString actualType;
105
106  /**
107   * Gets the type of the content that's currently loaded. See
108   * the constants above for the list of possible values.
109   */
110  [ChromeOnly]
111  readonly attribute unsigned long displayedType;
112
113  /**
114   * Gets the content type that corresponds to the give MIME type.  See the
115   * constants above for the list of possible values.  If nothing else fits,
116   * TYPE_NULL will be returned.
117   */
118  [ChromeOnly]
119  unsigned long getContentTypeForMIMEType(DOMString aMimeType);
120
121
122  [ChromeOnly]
123  sequence<MozPluginParameter> getPluginAttributes();
124
125  [ChromeOnly]
126  sequence<MozPluginParameter> getPluginParameters();
127
128  /**
129   * Forces a re-evaluation and reload of the tag, optionally invalidating its
130   * click-to-play state.  This can be used when the MIME type that provides a
131   * type has changed, for instance, to force the tag to re-evalulate the
132   * handler to use.
133   */
134  [ChromeOnly, Throws]
135  void reload(boolean aClearActivation);
136
137  /**
138   * The URL of the data/src loaded in the object. This may be null (i.e.
139   * an <embed> with no src).
140   */
141  [ChromeOnly]
142  readonly attribute URI? srcURI;
143
144  /**
145   * Disable the use of fake plugins and reload the tag if necessary
146   */
147  [ChromeOnly, Throws]
148  void skipFakePlugins();
149
150  [ChromeOnly, Throws, NeedsCallerType]
151  readonly attribute unsigned long runID;
152};
153
154/**
155 * Name:Value pair type used for passing parameters to NPAPI or javascript
156 * plugins.
157 */
158dictionary MozPluginParameter {
159  DOMString name = "";
160  DOMString value = "";
161};
162
163HTMLObjectElement includes MozImageLoadingContent;
164HTMLObjectElement includes MozFrameLoaderOwner;
165HTMLObjectElement includes MozObjectLoadingContent;
166