Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 */
15 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
16 [NeedNewResolve]
17 interface HTMLObjectElement : HTMLElement {
18 [Pure, SetterThrows]
19 attribute DOMString data;
20 [Pure, SetterThrows]
21 attribute DOMString type;
22 [Pure, SetterThrows]
23 attribute boolean typeMustMatch;
24 [Pure, SetterThrows]
25 attribute DOMString name;
26 [Pure, SetterThrows]
27 attribute DOMString useMap;
28 [Pure]
29 readonly attribute HTMLFormElement? form;
30 [Pure, SetterThrows]
31 attribute DOMString width;
32 [Pure, SetterThrows]
33 attribute DOMString height;
34 // Not pure: can trigger about:blank instantiation
35 readonly attribute Document? contentDocument;
36 // Not pure: can trigger about:blank instantiation
37 readonly attribute WindowProxy? contentWindow;
39 readonly attribute boolean willValidate;
40 readonly attribute ValidityState validity;
41 readonly attribute DOMString validationMessage;
42 boolean checkValidity();
43 void setCustomValidity(DOMString error);
45 [Throws]
46 legacycaller any (any... arguments);
47 };
49 // http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
50 partial interface HTMLObjectElement {
51 [Pure, SetterThrows]
52 attribute DOMString align;
53 [Pure, SetterThrows]
54 attribute DOMString archive;
55 [Pure, SetterThrows]
56 attribute DOMString code;
57 [Pure, SetterThrows]
58 attribute boolean declare;
59 [Pure, SetterThrows]
60 attribute unsigned long hspace;
61 [Pure, SetterThrows]
62 attribute DOMString standby;
63 [Pure, SetterThrows]
64 attribute unsigned long vspace;
65 [Pure, SetterThrows]
66 attribute DOMString codeBase;
67 [Pure, SetterThrows]
68 attribute DOMString codeType;
70 [TreatNullAs=EmptyString, Pure, SetterThrows]
71 attribute DOMString border;
72 };
74 partial interface HTMLObjectElement {
75 // GetSVGDocument
76 Document? getSVGDocument();
77 };
79 [NoInterfaceObject]
80 interface MozObjectLoadingContent {
81 // Mirrored chrome-only scriptable nsIObjectLoadingContent methods. Please
82 // make sure to update this list if nsIObjectLoadingContent changes. Also,
83 // make sure everything on here is [ChromeOnly].
84 [ChromeOnly]
85 const unsigned long TYPE_LOADING = 0;
86 [ChromeOnly]
87 const unsigned long TYPE_IMAGE = 1;
88 [ChromeOnly]
89 const unsigned long TYPE_PLUGIN = 2;
90 [ChromeOnly]
91 const unsigned long TYPE_DOCUMENT = 3;
92 [ChromeOnly]
93 const unsigned long TYPE_NULL = 4;
95 // The content type is not supported (e.g. plugin not installed)
96 [ChromeOnly]
97 const unsigned long PLUGIN_UNSUPPORTED = 0;
98 // Showing alternate content
99 [ChromeOnly]
100 const unsigned long PLUGIN_ALTERNATE = 1;
101 // The plugin exists, but is disabled
102 [ChromeOnly]
103 const unsigned long PLUGIN_DISABLED = 2;
104 // The plugin is blocklisted and disabled
105 [ChromeOnly]
106 const unsigned long PLUGIN_BLOCKLISTED = 3;
107 // The plugin is considered outdated, but not disabled
108 [ChromeOnly]
109 const unsigned long PLUGIN_OUTDATED = 4;
110 // The plugin has crashed
111 [ChromeOnly]
112 const unsigned long PLUGIN_CRASHED = 5;
113 // Suppressed by security policy
114 [ChromeOnly]
115 const unsigned long PLUGIN_SUPPRESSED = 6;
116 // Blocked by content policy
117 [ChromeOnly]
118 const unsigned long PLUGIN_USER_DISABLED = 7;
119 /// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
120 /// would be replaced by a real plugin if activated (playPlugin())
121 /// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
122 /// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
123 // The plugin is disabled until the user clicks on it
124 [ChromeOnly]
125 const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
126 // The plugin is vulnerable (update available)
127 [ChromeOnly]
128 const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
129 // The plugin is vulnerable (no update available)
130 [ChromeOnly]
131 const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
132 // The plugin is in play preview mode
133 [ChromeOnly]
134 const unsigned long PLUGIN_PLAY_PREVIEW = 11;
136 /**
137 * The actual mime type (the one we got back from the network
138 * request) for the element.
139 */
140 [ChromeOnly]
141 readonly attribute DOMString actualType;
143 /**
144 * Gets the type of the content that's currently loaded. See
145 * the constants above for the list of possible values.
146 */
147 [ChromeOnly]
148 readonly attribute unsigned long displayedType;
150 /**
151 * Gets the content type that corresponds to the give MIME type. See the
152 * constants above for the list of possible values. If nothing else fits,
153 * TYPE_NULL will be returned.
154 */
155 [ChromeOnly]
156 unsigned long getContentTypeForMIMEType(DOMString aMimeType);
158 /**
159 * This method will play a plugin that has been stopped by the
160 * click-to-play plugins or play-preview features.
161 */
162 [ChromeOnly, Throws]
163 void playPlugin();
165 /**
166 * Forces a re-evaluation and reload of the tag, optionally invalidating its
167 * click-to-play state. This can be used when the MIME type that provides a
168 * type has changed, for instance, to force the tag to re-evalulate the
169 * handler to use.
170 */
171 [ChromeOnly, Throws]
172 void reload(boolean aClearActivation);
174 /**
175 * This attribute will return true if the current content type has been
176 * activated, either explicitly or by passing checks that would have it be
177 * click-to-play or play-preview.
178 */
179 [ChromeOnly]
180 readonly attribute boolean activated;
182 /**
183 * The URL of the data/src loaded in the object. This may be null (i.e.
184 * an <embed> with no src).
185 */
186 [ChromeOnly]
187 readonly attribute URI? srcURI;
189 [ChromeOnly]
190 readonly attribute unsigned long defaultFallbackType;
192 [ChromeOnly]
193 readonly attribute unsigned long pluginFallbackType;
195 /**
196 * If this object currently owns a running plugin, regardless of whether or
197 * not one is pending spawn/despawn.
198 */
199 [ChromeOnly]
200 readonly attribute boolean hasRunningPlugin;
202 /**
203 * This method will disable the play-preview plugin state.
204 */
205 [ChromeOnly, Throws]
206 void cancelPlayPreview();
207 };
209 HTMLObjectElement implements MozImageLoadingContent;
210 HTMLObjectElement implements MozFrameLoaderOwner;
211 HTMLObjectElement implements MozObjectLoadingContent;