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