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/.
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
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.
15 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
17 interface HTMLObjectElement : HTMLElement {
19 attribute DOMString data;
21 attribute DOMString type;
23 attribute boolean typeMustMatch;
25 attribute DOMString name;
27 attribute DOMString useMap;
29 readonly attribute HTMLFormElement? form;
31 attribute DOMString width;
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);
46 legacycaller any (any... arguments);
49 // http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
50 partial interface HTMLObjectElement {
52 attribute DOMString align;
54 attribute DOMString archive;
56 attribute DOMString code;
58 attribute boolean declare;
60 attribute unsigned long hspace;
62 attribute DOMString standby;
64 attribute unsigned long vspace;
66 attribute DOMString codeBase;
68 attribute DOMString codeType;
70 [TreatNullAs=EmptyString, Pure, SetterThrows]
71 attribute DOMString border;
74 partial interface HTMLObjectElement {
76 Document? getSVGDocument();
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].
85 const unsigned long TYPE_LOADING = 0;
87 const unsigned long TYPE_IMAGE = 1;
89 const unsigned long TYPE_PLUGIN = 2;
91 const unsigned long TYPE_DOCUMENT = 3;
93 const unsigned long TYPE_NULL = 4;
95 // The content type is not supported (e.g. plugin not installed)
97 const unsigned long PLUGIN_UNSUPPORTED = 0;
98 // Showing alternate content
100 const unsigned long PLUGIN_ALTERNATE = 1;
101 // The plugin exists, but is disabled
103 const unsigned long PLUGIN_DISABLED = 2;
104 // The plugin is blocklisted and disabled
106 const unsigned long PLUGIN_BLOCKLISTED = 3;
107 // The plugin is considered outdated, but not disabled
109 const unsigned long PLUGIN_OUTDATED = 4;
110 // The plugin has crashed
112 const unsigned long PLUGIN_CRASHED = 5;
113 // Suppressed by security policy
115 const unsigned long PLUGIN_SUPPRESSED = 6;
116 // Blocked by content policy
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
125 const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
126 // The plugin is vulnerable (update available)
128 const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
129 // The plugin is vulnerable (no update available)
131 const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
132 // The plugin is in play preview mode
134 const unsigned long PLUGIN_PLAY_PREVIEW = 11;
137 * The actual mime type (the one we got back from the network
138 * request) for the element.
141 readonly attribute DOMString actualType;
144 * Gets the type of the content that's currently loaded. See
145 * the constants above for the list of possible values.
148 readonly attribute unsigned long displayedType;
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.
156 unsigned long getContentTypeForMIMEType(DOMString aMimeType);
160 sequence<MozPluginParameter> getPluginAttributes();
163 sequence<MozPluginParameter> getPluginParameters();
166 * This method will play a plugin that has been stopped by the
167 * click-to-play plugins or play-preview features.
173 * Forces a re-evaluation and reload of the tag, optionally invalidating its
174 * click-to-play state. This can be used when the MIME type that provides a
175 * type has changed, for instance, to force the tag to re-evalulate the
179 void reload(boolean aClearActivation);
182 * This attribute will return true if the current content type has been
183 * activated, either explicitly or by passing checks that would have it be
184 * click-to-play or play-preview.
187 readonly attribute boolean activated;
190 * The URL of the data/src loaded in the object. This may be null (i.e.
191 * an <embed> with no src).
194 readonly attribute URI? srcURI;
197 readonly attribute unsigned long defaultFallbackType;
200 readonly attribute unsigned long pluginFallbackType;
203 * If this object currently owns a running plugin, regardless of whether or
204 * not one is pending spawn/despawn.
207 readonly attribute boolean hasRunningPlugin;
210 * This method will disable the play-preview plugin state.
213 void cancelPlayPreview();
217 * Name:Value pair type used for passing parameters to NPAPI or javascript
220 dictionary MozPluginParameter {
222 DOMString value = "";
225 HTMLObjectElement implements MozImageLoadingContent;
226 HTMLObjectElement implements MozFrameLoaderOwner;
227 HTMLObjectElement implements MozObjectLoadingContent;