1 /* 2 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above 11 * copyright notice, this list of conditions and the following disclaimer 12 * in the documentation and/or other materials provided with the 13 * distribution. 14 * * Neither the name of Google Inc. nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 enum TestEnum {"", "EnumValue1", "EnumValue2", "EnumValue3"}; 32 33 callback VoidCallbackFunction = void (); 34 callback AnyCallbackFunctionOptionalAnyArg = any (optional any optionalAnyArg); 35 36 dictionary TestDict { 37 boolean booleanMember; 38 long longMember1 = 1; 39 }; 40 41 dictionary TestDictDerived : TestDict { 42 unsigned short unsignedShortMember; 43 float floatMember4 = 4.0; 44 }; 45 46 // No extended attributes on the interface; those go in TestInterface.idl 47 interface TestObject { 48 // Constants 49 const unsigned short CONST_VALUE_0 = 0; 50 const unsigned short CONST_VALUE_1 = 1; 51 const unsigned short CONST_VALUE_2 = 2; 52 const unsigned short CONST_VALUE_4 = 4; 53 const unsigned short CONST_VALUE_8 = 8; 54 const short CONST_VALUE_9 = -1; 55 const DOMString CONST_VALUE_10 = "my constant string"; 56 const unsigned short CONST_VALUE_11 = 0xffffffff; 57 const unsigned short CONST_VALUE_12 = 0x01; 58 const unsigned short CONST_VALUE_13 = 0X20; 59 const unsigned short CONST_VALUE_14 = 0x1abc; 60 const unsigned short CONST_VALUE_15 = 010; 61 const unsigned short CONST_VALUE_16 = -010; 62 const unsigned short CONST_VALUE_16 = -0x1A; 63 const unsigned short CONST_VALUE_17 = -0X1a; 64 65 // Extended attributes 66 [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1; 67 [RuntimeEnabled=FeatureName] const short FEATURE_ENABLED_CONST = 1; 68 [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1; 69 70 71 // Attributes 72 // 73 // Naming convention: 74 // [ExtAttr] attribute Type extAttrTypeNameAttribute; 75 // E.g., 76 // [Foo] attribute DOMString? fooStringOrNullAttribute 77 // 78 // Type name reference: 79 // http://heycam.github.io/webidl/#dfn-type-name 80 // 81 // TestInterfaceEmpty is used as a stub interface type, for testing behavior 82 // that should not depend on particular type (beyond "interface or not"). 83 // read only 84 readonly attribute DOMString readonlyStringAttribute; 85 readonly attribute TestInterfaceEmpty readonlyTestInterfaceEmptyAttribute; 86 readonly attribute long readonlyLongAttribute; 87 // Basic types 88 attribute Date dateAttribute; 89 attribute DOMString stringAttribute; 90 attribute ByteString byteStringAttribute; 91 attribute ScalarValueString scalarValueStringAttribute; 92 attribute DOMTimeStamp domTimeStampAttribute; 93 attribute boolean booleanAttribute; 94 attribute byte byteAttribute; 95 attribute double doubleAttribute; 96 attribute float floatAttribute; 97 attribute long longAttribute; 98 attribute long long longLongAttribute; 99 attribute octet octetAttribute; 100 attribute short shortAttribute; 101 attribute unrestricted double unrestrictedDoubleAttribute; 102 attribute unrestricted float unrestrictedFloatAttribute; 103 attribute unsigned long unsignedLongAttribute; 104 attribute unsigned long long unsignedLongLongAttribute; 105 attribute unsigned short unsignedShortAttribute; 106 // Interface type 107 attribute TestInterfaceEmpty testInterfaceEmptyAttribute; 108 // Self-reference 109 attribute TestObject testObjectAttribute; 110 // Callback function type 111 attribute VoidCallbackFunction voidCallbackFunctionAttribute; 112 attribute AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgAttribute; 113 // Names that begin with an acronym 114 attribute long cssAttribute; 115 attribute long imeAttribute; 116 attribute long svgAttribute; 117 attribute long xmlAttribute; 118 // Non-wrapper types 119 attribute NodeFilter nodeFilterAttribute; 120 attribute SerializedScriptValue serializedScriptValueAttribute; 121 attribute any anyAttribute; 122 // Custom type conversions 123 attribute Promise promiseAttribute; 124 attribute Window windowAttribute; 125 // DOM Node types 126 attribute Document documentAttribute; 127 attribute DocumentFragment documentFragmentAttribute; 128 attribute DocumentType documentTypeAttribute; 129 attribute Element elementAttribute; 130 attribute Node nodeAttribute; 131 attribute ShadowRoot shadowRootAttribute; 132 // Typed arrays 133 attribute ArrayBuffer arrayBufferAttribute; 134 attribute Float32Array float32ArrayAttribute; 135 attribute Uint8Array uint8ArrayAttribute; 136 // Exceptions for is_keep_alive_for_gc 137 readonly attribute TestInterfaceEmpty self; 138 readonly attribute EventTarget readonlyEventTargetAttribute; 139 readonly attribute EventTarget? readonlyEventTargetOrNullAttribute; 140 readonly attribute Window readonlyWindowAttribute; 141 readonly attribute HTMLCollection htmlCollectionAttribute; 142 readonly attribute HTMLElement htmlElementAttribute; 143 // Arrays 144 attribute DOMString[] stringArrayAttribute; 145 attribute TestInterfaceEmpty[] testInterfaceEmptyArrayAttribute; 146 attribute float[] floatArrayAttribute; 147 // Nullable attributes 148 attribute DOMString? stringOrNullAttribute; 149 attribute long? longOrNullAttribute; 150 attribute TestInterface? testInterfaceOrNullAttribute; 151 // Enumerations 152 attribute TestEnum testEnumAttribute; 153 // Static attributes 154 static attribute DOMString staticStringAttribute; 155 static attribute long staticLongAttribute; 156 // Exceptional type 157 attribute EventHandler eventHandlerAttribute; 158 159 // Extended attributes 160 [LogActivity, LogAllWorlds] attribute long activityLoggingAccessForAllWorldsLongAttribute; 161 [LogActivity=GetterOnly, LogAllWorlds] attribute long activityLoggingGetterForAllWorldsLongAttribute; 162 [LogActivity=SetterOnly, LogAllWorlds] attribute long activityLoggingSetterForAllWorldsLongAttribute; 163 [CachedAttribute=isValueDirty] attribute any cachedAttributeAnyAttribute; 164 [CachedAttribute=isArrayDirty] attribute DOMString[] cachedArrayAttribute; 165 [CallWith=ExecutionContext] attribute any callWithExecutionContextAnyAttribute; 166 [CallWith=ScriptState] attribute any callWithScriptStateAnyAttribute; 167 [CallWith=ExecutionContext|ScriptState] attribute any callWithExecutionContextAndScriptStateAnyAttribute; 168 [CheckSecurity=Node] readonly attribute Document checkSecurityForNodeReadonlyDocumentAttribute; // All uses are read only 169 [Conditional=CONDITION] attribute long conditionalLongAttribute; 170 [Conditional=CONDITION_1&CONDITION_2] attribute long conditionalAndLongAttribute; 171 [Conditional=CONDITION_1|CONDITION_2] attribute long conditionalOrLongAttribute; 172 // Constructors: FIXME: replace suffix with [ConstructorAttribute] 173 attribute TestInterfaceEmptyConstructor testInterfaceEmptyConstructorAttribute; 174 [DeprecateAs=deprecatedTestInterfaceEmptyConstructorAttribute] attribute TestInterfaceEmptyConstructor testInterfaceEmptyConstructorAttribute; 175 [MeasureAs=FeatureName] attribute TestInterfaceEmptyConstructor measureAsFeatureNameTestInterfaceEmptyConstructorAttribute; 176 [Custom] attribute object customObjectAttribute; 177 [Custom=Getter] attribute long customGetterLongAttribute; 178 [Custom=Getter] readonly attribute object customGetterReadonlyObjectAttribute; 179 [Custom=Setter] attribute long customSetterLongAttribute; 180 [Conditional=CONDITION, Custom] attribute long customLongAttribute; 181 [CustomElementCallbacks] readonly attribute long customElementsCallbacksReadonlyLongAttribute; 182 [DeprecateAs=LongAttribute] attribute long deprecatedLongAttribute; 183 [EnforceRange] attribute long enforceRangeLongAttribute; 184 [ExposeJSAccessors] attribute long exposeJSAccessorsLongAttribute; 185 [ImplementedAs=implementedAsName] attribute long implementedAsLongAttribute; 186 [Custom, ImplementedAs=implementedAsNameWithCustom] attribute long customImplementedAsLongAttribute; 187 [Custom=Getter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customGetterImplementedAsLongAttribute; 188 [Custom=Setter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customSetterImplementedAsLongAttribute; 189 [MeasureAs=TestFeature] attribute long measureAsLongAttribute; 190 [NotEnumerable] attribute long notEnumerableLongAttribute; 191 [PerContextEnabled=FeatureName] attribute long perContextEnabledLongAttribute; 192 [PerWorldBindings] readonly attribute TestInterfaceEmpty perWorldBindingsReadonlyTestInterfaceEmptyAttribute; 193 [LogActivity, LogAllWorlds, PerWorldBindings] attribute long activityLoggingAccessPerWorldBindingsLongAttribute; 194 [LogActivity, PerWorldBindings] attribute long activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute; 195 [LogActivity=GetterOnly, LogAllWorlds, PerWorldBindings] attribute long activityLoggingGetterPerWorldBindingsLongAttribute; 196 [LogActivity=GetterOnly, PerWorldBindings] attribute long activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute; 197 [PutForwards=href] readonly attribute TestNode location; 198 [PutForwards=hrefThrows] readonly attribute TestNode locationWithException; 199 [PutForwards=hrefCallWith] readonly attribute TestNode locationWithCallWith; 200 [PerWorldBindings, PutForwards=href] readonly attribute TestNode locationWithPerWorldBindings; 201 [PutForwards=attr1] readonly attribute TestInterfaceGarbageCollected locationGarbageCollected; 202 [PutForwards=attr1] readonly attribute TestInterfaceWillBeGarbageCollected locationWillBeGarbageCollected; 203 [RaisesException] attribute long raisesExceptionLongAttribute; 204 [RaisesException=Getter] attribute long raisesExceptionGetterLongAttribute; 205 [RaisesException=Setter] attribute long setterRaisesExceptionLongAttribute; 206 [RaisesException] attribute TestInterfaceEmpty raisesExceptionTestInterfaceEmptyAttribute; 207 [CachedAttribute=isValueDirty, RaisesException] attribute any cachedAttributeRaisesExceptionGetterAnyAttribute; 208 [Reflect] attribute TestInterface reflectTestInterfaceAttribute; 209 [Reflect=reflectedNameAttribute] attribute TestInterface reflectReflectedNameAttributeTestAttribute; 210 // [Reflect] exceptional types: exceptional getters, exceptional setters, 211 // or range checking for unsigned 212 [Reflect] attribute boolean reflectBooleanAttribute; 213 [Reflect] attribute long reflectLongAttribute; 214 [Reflect] attribute unsigned short reflectUnsignedShortAttribute; 215 [Reflect] attribute unsigned long reflectUnsignedLongAttribute; 216 // [Reflect] exceptional names 217 [Reflect] attribute DOMString id; 218 [Reflect] attribute DOMString name; 219 [Reflect] attribute DOMString class; 220 [Reflect=id] attribute DOMString reflectedId; 221 [Reflect=name] attribute DOMString reflectedName; 222 [Reflect=class] attribute DOMString reflectedClass; 223 // Limited value attributes and enumerated attributes 224 [Reflect, ReflectOnly="unique"] attribute DOMString limitedToOnlyOneAttribute; 225 [Reflect, ReflectOnly="Per"|"Paal"|"Espen"] attribute DOMString limitedToOnlyAttribute; 226 [Reflect=other, ReflectOnly="Value1"|"Value2" ] attribute DOMString limitedToOnlyOtherAttribute; 227 [Reflect, ReflectOnly="rsa"|"dsa", ReflectMissing="rsa"] attribute DOMString limitedWithMissingDefaultAttribute; 228 [Reflect, ReflectOnly="ltr"|"rtl"|"auto", ReflectMissing="auto", ReflectInvalid="ltr"] attribute DOMString limitedWithInvalidMissingDefaultAttribute; 229 [Reflect, ReflectOnly="anonymous"|"use-credentials", ReflectEmpty="anonymous", ReflectInvalid="anonymous"] readonly attribute DOMString corsSettingAttribute; 230 [Reflect, ReflectOnly="empty"|"missing"|"invalid"|"a-normal", ReflectEmpty="empty", ReflectMissing="missing", ReflectInvalid="invalid"] readonly attribute DOMString limitedWithEmptyMissingInvalidAttribute; 231 232 [Replaceable] readonly attribute long replaceableReadonlyLongAttribute; 233 [Replaceable, PutForwards=href] readonly attribute TestNode locationReplaceable; 234 [RuntimeEnabled=FeatureName] attribute long runtimeEnabledLongAttribute; 235 [PerContextEnabled=FeatureName, RuntimeEnabled=FeatureName] attribute long perContextEnabledRuntimeEnabledLongAttribute; 236 [Conditional=CONDITION, RuntimeEnabled=FeatureName] attribute long conditionalRuntimeEnabledLongAttribute; 237 [SetterCallWith=ActiveWindow&FirstWindow] attribute DOMString setterCallWithActiveWindowAndFirstWindowStringAttribute; 238 [SetterCallWith=ExecutionContext] attribute DOMString setterCallWithExecutionContextStringAttribute; 239 [TreatNullAs=NullString] attribute DOMString treatNullAsNullStringStringAttribute; 240 [TreatReturnedNullStringAs=Null] attribute DOMString treatReturnedNullStringAsNullStringAttribute; 241 [TreatReturnedNullStringAs=Undefined] attribute DOMString treatReturnedNullStringAsUndefinedStringAttribute; 242 [TreatReturnedNullStringAs=Null] attribute ByteString treatReturnedNullStringAsNullByteStringAttribute; 243 [TreatReturnedNullStringAs=Undefined] attribute ByteString treatReturnedNullStringAsUndefinedByteStringAttribute; 244 [TreatReturnedNullStringAs=Null] attribute ScalarValueString treatReturnedNullStringAsNullScalarValueStringAttribute; 245 [TreatReturnedNullStringAs=Undefined] attribute ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringAttribute; 246 [TypeChecking=Interface|Nullable] attribute float typeCheckingInterfaceNullableStringFloatAttribute; // nop for non-interface types 247 [TypeChecking=Interface] attribute TestInterface typeCheckingInterfaceTestInterfaceAttribute; 248 [TypeChecking=Nullable] attribute TestInterface? typeCheckingNullableTestInterfaceOrNullAttribute; 249 [TypeChecking=Interface|Nullable] attribute TestInterface? typeCheckingInterfaceNullableTestInterfaceOrNullAttribute; 250 [Reflect, URL] attribute DOMString urlStringAttribute; 251 [Reflect=reflectUrlAttribute, URL] attribute DOMString urlStringAttribute; 252 [Unforgeable] attribute long unforgeableLongAttribute; 253 [LogActivity=SetterOnly, LogPreviousValue] attribute long activityLoggingSetterOnlyLogPreviousValueAttribute; 254 [LogActivity, LogPreviousValue] attribute TestInterfaceEmpty activityLoggingLogPreviousValueInterfaceAttribute; 255 256 257 // Methods 258 // 259 // Naming convention: 260 // ReturnType returnTypeMethodTypeName1ArgTypeName2Arg(Type1 typeName1Arg, Type2 typeName2Arg); 261 // E.g., 262 // void voidMethodStringArgLongArrayArg(DOMString stringArg, long[] longArrayArg); 263 void voidMethod(); 264 static void staticVoidMethod(); 265 266 // Types 267 // Basic types 268 Date dateMethod(); 269 DOMString stringMethod(); 270 ByteString byteStringMethod(); 271 ScalarValueString scalarValueStringMethod(); 272 DOMTimeStamp readonlyDOMTimeStampMethod(); 273 boolean booleanMethod(); 274 byte byteMethod(); 275 double doubleMethod(); 276 float floatMethod(); 277 long longMethod(); 278 long long longLongMethod(); 279 octet octetMethod(); 280 short shortMethod(); 281 unsigned long unsignedLongMethod(); 282 unsigned long long unsignedLongLongMethod(); 283 unsigned short unsignedShortMethod(); 284 285 void voidMethodDateArg(Date dateArg); 286 void voidMethodStringArg(DOMString stringArg); 287 void voidMethodByteStringArg(ByteString stringArg); 288 void voidMethodScalarValueStringArg(ScalarValueString scalarValueStringArg); 289 void voidMethodDOMTimeStampArg(DOMTimeStamp domTimeStampArg); 290 void voidMethodBooleanArg(boolean booleanArg); 291 void voidMethodByteArg(byte byteArg); 292 void voidMethodDoubleArg(double doubleArg); 293 void voidMethodFloatArg(float floatArg); 294 void voidMethodLongArg(long longArg); 295 void voidMethodLongLongArg(long long longLongArg); 296 void voidMethodOctetArg(octet octetArg); 297 void voidMethodShortArg(short shortArg); 298 void voidMethodUnsignedLongArg(unsigned long unsignedLongArg); 299 void voidMethodUnsignedLongLongArg(unsigned long long unsignedLongLongArg); 300 void voidMethodUnsignedShortArg(unsigned short unsignedShortArg); 301 // Interface types 302 TestInterfaceEmpty testInterfaceEmptyMethod(); 303 void voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg); 304 void voidMethodLongArgTestInterfaceEmptyArg(long longArg, TestInterfaceEmpty testInterfaceEmptyArg); 305 // Callback function type 306 VoidCallbackFunction voidCallbackFunctionMethod(); 307 AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgMethod(); 308 void voidMethodVoidCallbackFunctionArg(VoidCallbackFunction voidCallbackFunctionArg); 309 void voidMethodAnyCallbackFunctionOptionalAnyArg(AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgArg); 310 // Custom type conversions 311 CompareHow compareHowMethod(); 312 any anyMethod(); 313 void voidMethodCompareHowArg(CompareHow compareHowArg); 314 void voidMethodEventTargetArg(EventTarget eventTargetArg); 315 void voidMethodMediaQueryListListenerArg(MediaQueryListListener mediaQueryListListenerArg); 316 void voidMethodAnyArg(any anyArg); 317 // DOM node types 318 void voidMethodAttrArg(Attr attrArg); 319 void voidMethodDocumentArg(Document documentArg); 320 void voidMethodDocumentTypeArg(DocumentType documentTypeArg); 321 void voidMethodElementArg(Element elementArg); 322 void voidMethodNodeArg(Node nodeArg); 323 // Typed arrays 324 ArrayBuffer arrayBufferMethod(); 325 ArrayBufferView arrayBufferViewMethod(); 326 Float32Array float32ArrayMethod(); 327 Int32Array int32ArrayMethod(); 328 Uint8Array uint8ArrayMethod(); 329 void voidMethodArrayBufferArg(ArrayBuffer arrayBufferArg); 330 void voidMethodArrayBufferOrNullArg(ArrayBuffer? arrayBufferArg); 331 void voidMethodArrayBufferViewArg(ArrayBufferView arrayBufferViewArg); 332 void voidMethodFloat32ArrayArg(Float32Array float32ArrayArg); 333 void voidMethodInt32ArrayArg(Int32Array int32ArrayArg); 334 void voidMethodUint8ArrayArg(Uint8Array uint8ArrayArg); 335 // Arrays 336 long[] longArrayMethod(); 337 DOMString[] stringArrayMethod(); 338 TestInterfaceEmpty[] testInterfaceEmptyArrayMethod(); 339 void voidMethodArrayLongArg(long[] arrayLongArg); 340 void voidMethodArrayStringArg(DOMString[] arrayStringArg); 341 void voidMethodArrayTestInterfaceEmptyArg(TestInterfaceEmpty[] arrayTestInterfaceEmptyArg); 342 // Sequences 343 sequence<long> longSequenceMethod(); 344 sequence<DOMString> stringSequenceMethod(); 345 sequence<TestInterfaceEmpty> testInterfaceEmptySequenceMethod(); 346 void voidMethodSequenceLongArg(sequence<long> longSequenceArg); 347 void voidMethodSequenceStringArg(sequence<DOMString> stringSequenceArg); 348 void voidMethodSequenceTestInterfaceEmptyArg(sequence<TestInterfaceEmpty> testInterfaceEmptySequenceArg); 349 // Nullable types 350 // Currently only used on interface type arguments 351 void voidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? nullableTestInterfaceEmptyArg); 352 // Callback interface types 353 void voidMethodTestCallbackInterfaceArg(TestCallbackInterface testCallbackInterfaceArg); 354 void voidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg); 355 void voidMethodTestCallbackInterfaceOrNullArg(TestCallbackInterface? testCallbackInterfaceArg); 356 // Enumerations 357 TestEnum testEnumMethod(); 358 void voidMethodTestEnumArg(TestEnum testEnumTypeArg); 359 // Exceptional types 360 Dictionary dictionaryMethod(); 361 NodeFilter nodeFilterMethod(); 362 Promise promiseMethod(); 363 SerializedScriptValue serializedScriptValueMethod(); 364 XPathNSResolver xPathNSResolverMethod(); 365 void voidMethodDictionaryArg(Dictionary dictionaryArg); 366 void voidMethodEventListenerArg(EventListener eventListenerArg); 367 void voidMethodNodeFilterArg(NodeFilter nodeFilterArg); 368 void voidMethodPromiseArg(Promise promiseArg); 369 void voidMethodSerializedScriptValueArg(SerializedScriptValue serializedScriptValueArg); 370 void voidMethodXPathNSResolverArg(XPathNSResolver xPathNSResolverArg); 371 void voidMethodDictionarySequenceArg(sequence<Dictionary> dictionarySequenceArg); 372 373 // Arguments 374 void voidMethodStringArgLongArg(DOMString stringArg, long longArg); 375 // Optional arguments 376 void voidMethodOptionalStringArg(optional DOMString optionalStringArg); 377 void voidMethodOptionalTestInterfaceEmptyArg(optional TestInterfaceEmpty optionalTestInterfaceEmptyArg); 378 void voidMethodOptionalLongArg(optional long optionalLongArg); 379 DOMString stringMethodOptionalLongArg(optional long optionalLongArg); 380 TestInterfaceEmpty testInterfaceEmptyMethodOptionalLongArg(optional long optionalLongArg); 381 long longMethodOptionalLongArg(optional long optionalLongArg); 382 void voidMethodLongArgOptionalLongArg(long longArg, optional long optionalLongArg); 383 void voidMethodLongArgOptionalLongArgOptionalLongArg(long longArg, optional long optionalLongArg1, optional long optionalLongArg2); 384 void voidMethodLongArgOptionalTestInterfaceEmptyArg(long longArg, optional TestInterfaceEmpty optionalTestInterfaceEmpty); 385 void voidMethodTestInterfaceEmptyArgOptionalLongArg(TestInterfaceEmpty optionalTestInterfaceEmpty, optional long longArg); 386 // Optional arguments: exceptional case 387 void voidMethodOptionalDictionaryArg(optional Dictionary optionalDictionaryArg); 388 389 // Optional arguments with defaults 390 void voidMethodDefaultStringArg(optional DOMString defaultStringArg = "foo"); 391 void voidMethodDefaultNullStringArg(optional DOMString defaultStringArg = null); 392 void voidMethodDefaultLongArg(optional long defaultLongArg = 10); 393 void voidMethodDefaultDoubleArg(optional double defaultDoubleArg = 0.5); 394 void voidMethodDefaultTrueBooleanArg(optional boolean defaultBooleanArg = true); 395 void voidMethodDefaultFalseBooleanArg(optional boolean defaultBooleanArg = false); 396 void voidMethodDefaultNullableStringArg(optional DOMString? defaultStringArg = null); 397 void voidMethodDefaultNullableTestInterfaceArg(optional TestInterface? defaultTestInterfaceArg = null); 398 399 // Variadic operations 400 void voidMethodVariadicStringArg(DOMString... variadicStringArgs); 401 void voidMethodStringArgVariadicStringArg(DOMString stringArg, DOMString... variadicStringArgs); 402 void voidMethodVariadicTestInterfaceEmptyArg(TestInterfaceEmpty... variadicTestInterfaceEmptyArgs); 403 void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg, TestInterfaceEmpty... variadicTestInterfaceEmptyArgs); 404 void voidMethodVariadicTestInterfaceGarbageCollectedArg(TestInterfaceGarbageCollected... variadicTestInterfaceGarbageCollectedArg); 405 void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(TestInterfaceWillBeGarbageCollected... variadicTestInterfaceWillBeGarbageCollectedArg); 406 407 // Overloaded methods 408 void overloadedMethodA(long longArg); 409 void overloadedMethodA(long longArg1, long longArg2); 410 void overloadedMethodB(long longArg); 411 void overloadedMethodB(DOMString stringArg, optional long longArg); 412 void overloadedMethodC(long longArg); 413 void overloadedMethodC(TestInterfaceEmpty testInterfaceEmptyArg); 414 void overloadedMethodD(long longArg); 415 void overloadedMethodD(long[] longArrayArg); 416 void overloadedMethodE(long longArg); 417 void overloadedMethodE(TestInterfaceEmpty? testInterfaceEmptyOrNullArg); 418 void overloadedMethodF(optional DOMString stringArg); 419 void overloadedMethodF(double doubleArg); 420 void overloadedMethodG(long longArg); 421 void overloadedMethodG(optional TestInterfaceEmpty? testInterfaceEmptyOrNullArg = null); 422 void overloadedMethodH(TestInterface testInterfaceArg); 423 void overloadedMethodH(TestInterfaceEmpty testInterfaceEmptyArg); 424 void overloadedMethodI(DOMString stringArg); 425 void overloadedMethodI(double doubleArg); 426 427 428 [PerWorldBindings] void overloadedPerWorldBindingsMethod(); 429 [PerWorldBindings] void overloadedPerWorldBindingsMethod(long longArg); 430 431 static void overloadedStaticMethod(long longArg); 432 static void overloadedStaticMethod(long longArg1, long longArg2); 433 434 // Extended attributes for arguments 435 // [Clamp] 436 void voidMethodClampUnsignedShortArg([Clamp] unsigned short clampUnsignedShortArg); 437 void voidMethodClampUnsignedLongArg([Clamp] unsigned long clampUnsignedLongArg); 438 // [Default] 439 void voidMethodDefaultUndefinedTestInterfaceEmptyArg([Default=Undefined] optional TestInterfaceEmpty defaultUndefinedTestInterfaceEmptyArg); 440 void voidMethodDefaultUndefinedLongArg([Default=Undefined] optional long defaultUndefinedLongArg); 441 void voidMethodDefaultUndefinedStringArg([Default=Undefined] optional DOMString defaultUndefinedStringArg); 442 // [EnforceRange] 443 void voidMethodEnforceRangeLongArg([EnforceRange] long enforceRangeLongArg); 444 // [TreatNullAs], [TreatUndefinedAs] 445 void voidMethodTreatNullAsNullStringStringArg([TreatNullAs=NullString] DOMString treatNullAsNullStringStringArg); 446 void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString treatNullAsNullStringStringArg); 447 448 // Extended attributes for methods 449 [LogActivity, LogAllWorlds] void activityLoggingAccessForAllWorldsMethod(); 450 [CallWith=ExecutionContext] void callWithExecutionContextVoidMethod(); 451 [CallWith=ScriptState] void callWithScriptStateVoidMethod(); 452 [CallWith=ScriptState] long callWithScriptStateLongMethod(); 453 [CallWith=ScriptState&ExecutionContext] void callWithScriptStateExecutionContextVoidMethod(); 454 [CallWith=ScriptState&ScriptArguments] void callWithScriptStateScriptArgumentsVoidMethod(); 455 [CallWith=ScriptState&ScriptArguments] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg); 456 [CallWith=ActiveWindow] void callWithActiveWindow(); 457 [CallWith=ActiveWindow&FirstWindow] void callWithActiveWindowScriptWindow(); 458 [CheckSecurity=Node] void checkSecurityForNodeVoidMethod(); 459 [Conditional=CONDITION] void conditionalConditionVoidMethod(); 460 [Conditional=CONDITION_1&CONDITION_2] void conditionalCondition1AndCondition2VoidMethod(); 461 [Conditional=CONDITION] static void conditionalConditionStaticVoidMethod(); 462 [Custom] void customVoidMethod(); 463 [Conditional=CONDITION, Custom] void conditionalConditionCustomVoidMethod(); 464 [CustomElementCallbacks] void customElementCallbacksVoidMethod(); 465 [DeprecateAs=voidMethod] void deprecatedVoidMethod(); 466 [DoNotCheckSignature] void doNotCheckSignatureVoidMethod(); 467 [ImplementedAs=implementedAsMethodName] void implementedAsVoidMethod(); 468 [MeasureAs=TestFeature] void measureAsVoidMethod(); 469 [DeprecateAs=TestFeatureA] void DeprecateAsOverloadedMethod(); 470 [DeprecateAs=TestFeatureB] void DeprecateAsOverloadedMethod(long arg); 471 [DeprecateAs=TestFeature] void DeprecateAsSameValueOverloadedMethod(); 472 [DeprecateAs=TestFeature] void DeprecateAsSameValueOverloadedMethod(long arg); 473 [MeasureAs=TestFeatureA] void measureAsOverloadedMethod(); 474 [MeasureAs=TestFeatureB] void measureAsOverloadedMethod(long arg); 475 [MeasureAs=TestFeature] void measureAsSameValueOverloadedMethod(); 476 [MeasureAs=TestFeature] void measureAsSameValueOverloadedMethod(long arg); 477 [DeprecateAs=TestFeatureA, MeasureAs=TestFeature] void deprecateAsMeasureAsSameValueOverloadedMethod(); 478 [DeprecateAs=TestFeatureB, MeasureAs=TestFeature] void deprecateAsMeasureAsSameValueOverloadedMethod(long arg); 479 [DeprecateAs=TestFeature, MeasureAs=TestFeatureA] void deprecateAsSameValueMeasureAsOverloadedMethod(); 480 [DeprecateAs=TestFeature, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsOverloadedMethod(long arg); 481 [DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod(); 482 [DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod(long arg); 483 [NotEnumerable] void notEnumerableVoidMethod(); 484 [PerContextEnabled=FeatureName] void perContextEnabledVoidMethod(); 485 [PerWorldBindings] void perWorldBindingsVoidMethod(); 486 [PerWorldBindings] void perWorldBindingsVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg); 487 [LogActivity, LogAllWorlds, PerWorldBindings] void activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 488 [LogActivity, PerWorldBindings] void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 489 [RaisesException] void raisesExceptionVoidMethod(); 490 [RaisesException] DOMString raisesExceptionStringMethod(); 491 [RaisesException] void raisesExceptionVoidMethodOptionalLongArg(optional long optionalLongArg); 492 [RaisesException] void raisesExceptionVoidMethodTestCallbackInterfaceArg(TestCallbackInterface testCallbackInterfaceArg); 493 [RaisesException] void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg); 494 [RaisesException] TestInterfaceEmpty raisesExceptionTestInterfaceEmptyVoidMethod(); 495 [CallWith=ExecutionContext, RaisesException] void callWithExecutionContextRaisesExceptionVoidMethodLongArg(long longArg); 496 [ReadOnly] void readOnlyVoidMethod(); 497 [NotEnumerable, ReadOnly] void notEnumerableReadOnlyVoidMethod(); 498 [RuntimeEnabled=FeatureName] void runtimeEnabledVoidMethod(); 499 [PerWorldBindings, RuntimeEnabled=FeatureName] void perWorldBindingsRuntimeEnabledVoidMethod(); 500 [RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(DOMString stringArg); 501 [RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(long longArg); 502 [RuntimeEnabled=FeatureName1] void partiallyRuntimeEnabledOverloadedVoidMethod(DOMString stringArg); 503 [RuntimeEnabled=FeatureName2] void partiallyRuntimeEnabledOverloadedVoidMethod(TestInterface testInterface); 504 void partiallyRuntimeEnabledOverloadedVoidMethod(long longArg); 505 [TreatReturnedNullStringAs=Null] DOMString treatReturnedNullStringAsNullStringMethod(); 506 [TreatReturnedNullStringAs=Undefined] DOMString treatReturnedNullStringAsUndefinedStringMethod(); 507 [TreatReturnedNullStringAs=Null] ByteString treatReturnedNullStringAsNullByteStringMethod(); 508 [TreatReturnedNullStringAs=Undefined] ByteString treatReturnedNullStringAsUndefinedByteStringMethod(); 509 [TreatReturnedNullStringAs=Null] ScalarValueString treatReturnedNullStringAsNullScalarValueStringMethod(); 510 [TreatReturnedNullStringAs=Undefined] ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringMethod(); 511 [TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg); 512 [TypeChecking=Nullable] void typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? testInterfaceEmptyOrNullArg); 513 [TypeChecking=Interface|Nullable] void typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? testInterfaceEmptyOrNullArg); 514 [TypeChecking=Unrestricted] void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg); 515 [Unforgeable] void unforgeableVoidMethod(); 516 void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceArg); 517 void voidMethodTestInterfaceGarbageCollectedArrayArg(TestInterfaceGarbageCollected[] testInterfaceGarbageCollectedArrayArg); 518 void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceArg); 519 void voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] testInterfaceWillBeGarbageCollectedArrayArg); 520 521 // Extended attributes on referenced interfaces 522 // (not self; self-reference tests at interface themselves) 523 attribute TestInterface testInterfaceAttribute; // [ImplementedAs] 524 attribute TestInterfaceGarbageCollected testInterfaceGarbageCollectedAttribute; // [GarbageCollected] 525 attribute TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullAttribute; // [GarbageCollected] 526 attribute TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedAttribute; // [WillBeGarbageCollected] 527 attribute TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullAttribute; // [WillBeGarbageCollected] 528 }; 529