Home | History | Annotate | Download | only in core
      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 // No extended attributes on the interface; those go in TestInterface.idl
     37 interface TestObject {
     38     // Constants
     39     const unsigned short CONST_VALUE_0 = 0;
     40     const unsigned short CONST_VALUE_1 = 1;
     41     const unsigned short CONST_VALUE_2 = 2;
     42     const unsigned short CONST_VALUE_4 = 4;
     43     const unsigned short CONST_VALUE_8 = 8;
     44     const short CONST_VALUE_9 = -1;
     45     const DOMString CONST_VALUE_10 = "my constant string";
     46     const unsigned short CONST_VALUE_11 = 0xffffffff;
     47     const unsigned short CONST_VALUE_12 = 0x01;
     48     const unsigned short CONST_VALUE_13 = 0X20;
     49     const unsigned short CONST_VALUE_14 = 0x1abc;
     50     const unsigned short CONST_VALUE_15 = 010;
     51     const unsigned short CONST_VALUE_16 = -010;
     52     const unsigned short CONST_VALUE_16 = -0x1A;
     53     const unsigned short CONST_VALUE_17 = -0X1a;
     54     const double CONST_VALUE_18 = 0.123;
     55     const double CONST_VALUE_19 = 4e9;
     56     const double CONST_VALUE_20 = 3.4e5;
     57     const double CONST_VALUE_21 = -1.3;
     58     const double CONST_VALUE_22 = -4e-9;
     59     const double CONST_VALUE_23 = .123;
     60     const double CONST_VALUE_24 = 5E+4;
     61     const float CONST_VALUE_25 = 1;
     62 
     63     // Extended attributes
     64     [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
     65     [MeasureAs=Constant] const short MEASURED_CONSTANT = 1;
     66     [RuntimeEnabled=FeatureName] const short FEATURE_ENABLED_CONST = 1;
     67     [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
     68 
     69     stringifier attribute DOMString stringifierAttribute;
     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     [CachedAttribute=isStringDirty] attribute DOMString? cachedStringOrNoneAttribute;
    166     [CallWith=ExecutionContext] attribute any callWithExecutionContextAnyAttribute;
    167     [CallWith=ScriptState] attribute any callWithScriptStateAnyAttribute;
    168     [CallWith=(ExecutionContext,ScriptState)] attribute any callWithExecutionContextAndScriptStateAnyAttribute;
    169     [CheckSecurity=Node] readonly attribute Document checkSecurityForNodeReadonlyDocumentAttribute; // All uses are read only
    170     [Conditional=CONDITION] attribute long conditionalLongAttribute;
    171     // Constructors: FIXME: replace suffix with [ConstructorAttribute]
    172     attribute TestInterfaceEmptyConstructor testInterfaceEmptyConstructorAttribute;
    173     [DeprecateAs=deprecatedTestInterfaceEmptyConstructorAttribute] attribute TestInterfaceEmptyConstructor testInterfaceEmptyConstructorAttribute;
    174     [MeasureAs=FeatureName] attribute TestInterfaceEmptyConstructor measureAsFeatureNameTestInterfaceEmptyConstructorAttribute;
    175     [Custom] attribute object customObjectAttribute;
    176     [Custom=Getter] attribute long customGetterLongAttribute;
    177     [Custom=Getter] readonly attribute object customGetterReadonlyObjectAttribute;
    178     [Custom=Setter] attribute long customSetterLongAttribute;
    179     [Conditional=CONDITION, Custom] attribute long customLongAttribute;
    180     [CustomElementCallbacks] readonly attribute long customElementsCallbacksReadonlyLongAttribute;
    181     [DeprecateAs=LongAttribute] attribute long deprecatedLongAttribute;
    182     [EnforceRange] attribute long enforceRangeLongAttribute;
    183     [ExposeJSAccessors] attribute long exposeJSAccessorsLongAttribute;
    184     [ImplementedAs=implementedAsName] attribute long implementedAsLongAttribute;
    185     [Custom, ImplementedAs=implementedAsNameWithCustom] attribute long customImplementedAsLongAttribute;
    186     [Custom=Getter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customGetterImplementedAsLongAttribute;
    187     [Custom=Setter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customSetterImplementedAsLongAttribute;
    188     [MeasureAs=TestFeature] attribute long measureAsLongAttribute;
    189     [NotEnumerable] attribute long notEnumerableLongAttribute;
    190     [PerContextEnabled=FeatureName] attribute long perContextEnabledLongAttribute;
    191     [PerWorldBindings] readonly attribute TestInterfaceEmpty perWorldBindingsReadonlyTestInterfaceEmptyAttribute;
    192     [LogActivity, LogAllWorlds, PerWorldBindings] attribute long activityLoggingAccessPerWorldBindingsLongAttribute;
    193     [LogActivity, PerWorldBindings] attribute long activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute;
    194     [LogActivity=GetterOnly, LogAllWorlds, PerWorldBindings] attribute long activityLoggingGetterPerWorldBindingsLongAttribute;
    195     [LogActivity=GetterOnly, PerWorldBindings] attribute long activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute;
    196     [PutForwards=href] readonly attribute TestNode location;
    197     [PutForwards=hrefThrows] readonly attribute TestNode locationWithException;
    198     [PutForwards=hrefCallWith] readonly attribute TestNode locationWithCallWith;
    199     [PutForwards=hrefByteString] readonly attribute TestNode locationByteString;
    200     [PerWorldBindings, PutForwards=href] readonly attribute TestNode locationWithPerWorldBindings;
    201     [TypeChecking=Interface, PutForwards=href] readonly attribute TestNode locationTypeCheckingInterface;
    202     [PutForwards=attr1] readonly attribute TestInterfaceGarbageCollected locationGarbageCollected;
    203     [PutForwards=attr1] readonly attribute TestInterfaceWillBeGarbageCollected locationWillBeGarbageCollected;
    204     [RaisesException] attribute long raisesExceptionLongAttribute;
    205     [RaisesException=Getter] attribute long raisesExceptionGetterLongAttribute;
    206     [RaisesException=Setter] attribute long setterRaisesExceptionLongAttribute;
    207     [RaisesException] attribute TestInterfaceEmpty raisesExceptionTestInterfaceEmptyAttribute;
    208     [CachedAttribute=isValueDirty, RaisesException] attribute any cachedAttributeRaisesExceptionGetterAnyAttribute;
    209     [Reflect] attribute TestInterface reflectTestInterfaceAttribute;
    210     [Reflect=reflectedNameAttribute] attribute TestInterface reflectReflectedNameAttributeTestAttribute;
    211     // [Reflect] exceptional types: exceptional getters, exceptional setters,
    212     // or range checking for unsigned
    213     [Reflect] attribute boolean reflectBooleanAttribute;
    214     [Reflect] attribute long reflectLongAttribute;
    215     [Reflect] attribute unsigned short reflectUnsignedShortAttribute;
    216     [Reflect] attribute unsigned long reflectUnsignedLongAttribute;
    217     // [Reflect] exceptional names
    218     [Reflect] attribute DOMString id;
    219     [Reflect] attribute DOMString name;
    220     [Reflect] attribute DOMString class;
    221     [Reflect=id] attribute DOMString reflectedId;
    222     [Reflect=name] attribute DOMString reflectedName;
    223     [Reflect=class] attribute DOMString reflectedClass;
    224     // Limited value attributes and enumerated attributes
    225     [Reflect, ReflectOnly="unique"] attribute DOMString limitedToOnlyOneAttribute;
    226     [Reflect, ReflectOnly=("Per","Paal","Espen")] attribute DOMString limitedToOnlyAttribute;
    227     [Reflect=other, ReflectOnly=("Value1","Value2")] attribute DOMString limitedToOnlyOtherAttribute;
    228     [Reflect, ReflectOnly=("rsa","dsa"), ReflectMissing="rsa"] attribute DOMString limitedWithMissingDefaultAttribute;
    229     [Reflect, ReflectOnly=("ltr","rtl","auto"), ReflectMissing="auto", ReflectInvalid="ltr"] attribute DOMString limitedWithInvalidMissingDefaultAttribute;
    230     [Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] readonly attribute DOMString corsSettingAttribute;
    231     [Reflect, ReflectOnly=("empty","missing","invalid","a-normal"), ReflectEmpty="empty", ReflectMissing="missing", ReflectInvalid="invalid"] readonly attribute DOMString limitedWithEmptyMissingInvalidAttribute;
    232 
    233     [Replaceable] readonly attribute long replaceableReadonlyLongAttribute;
    234     [Replaceable, PutForwards=href] readonly attribute TestNode locationReplaceable;
    235     [RuntimeEnabled=FeatureName] attribute long runtimeEnabledLongAttribute;
    236     [PerContextEnabled=FeatureName, RuntimeEnabled=FeatureName] attribute long perContextEnabledRuntimeEnabledLongAttribute;
    237     [Conditional=CONDITION, RuntimeEnabled=FeatureName] attribute long conditionalRuntimeEnabledLongAttribute;
    238     [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString setterCallWithActiveWindowAndFirstWindowStringAttribute;
    239     [SetterCallWith=ExecutionContext] attribute DOMString setterCallWithExecutionContextStringAttribute;
    240     [TreatNullAs=EmptyString] attribute DOMString treatNullAsEmptyStringStringAttribute;
    241     [TreatNullAs=NullString] attribute DOMString treatNullAsNullStringStringAttribute;
    242     [TreatReturnedNullStringAs=Null] attribute DOMString treatReturnedNullStringAsNullStringAttribute;
    243     [TreatReturnedNullStringAs=Undefined] attribute DOMString treatReturnedNullStringAsUndefinedStringAttribute;
    244     [TreatReturnedNullStringAs=Undefined, CachedAttribute=isStringDirty] attribute DOMString cachedTreatReturnedNullStringAsUndefinedStringAttribute;
    245     [TreatReturnedNullStringAs=Null] attribute ByteString treatReturnedNullStringAsNullByteStringAttribute;
    246     [TreatReturnedNullStringAs=Undefined] attribute ByteString treatReturnedNullStringAsUndefinedByteStringAttribute;
    247     [TreatReturnedNullStringAs=Null] attribute ScalarValueString treatReturnedNullStringAsNullScalarValueStringAttribute;
    248     [TreatReturnedNullStringAs=Undefined] attribute ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringAttribute;
    249     [TypeChecking=Interface] attribute float typeCheckingInterfaceFloatAttribute; // nop for non-interface types
    250     [TypeChecking=Interface] attribute TestInterface typeCheckingInterfaceTestInterfaceAttribute;
    251     [TypeChecking=Interface] attribute TestInterface? typeCheckingInterfaceTestInterfaceOrNullAttribute;
    252     [Reflect, URL] attribute DOMString urlStringAttribute;
    253     [Reflect=reflectUrlAttribute, URL] attribute DOMString urlStringAttribute;
    254     [Unforgeable] attribute long unforgeableLongAttribute;
    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     any anyMethod();
    312     void voidMethodEventTargetArg(EventTarget eventTargetArg);
    313     void voidMethodAnyArg(any anyArg);
    314     // DOM node types
    315     void voidMethodAttrArg(Attr attrArg);
    316     void voidMethodDocumentArg(Document documentArg);
    317     void voidMethodDocumentTypeArg(DocumentType documentTypeArg);
    318     void voidMethodElementArg(Element elementArg);
    319     void voidMethodNodeArg(Node nodeArg);
    320     // Typed arrays
    321     ArrayBuffer arrayBufferMethod();
    322     ArrayBufferView arrayBufferViewMethod();
    323     Float32Array float32ArrayMethod();
    324     Int32Array int32ArrayMethod();
    325     Uint8Array uint8ArrayMethod();
    326     void voidMethodArrayBufferArg(ArrayBuffer arrayBufferArg);
    327     void voidMethodArrayBufferOrNullArg(ArrayBuffer? arrayBufferArg);
    328     void voidMethodArrayBufferViewArg(ArrayBufferView arrayBufferViewArg);
    329     void voidMethodFloat32ArrayArg(Float32Array float32ArrayArg);
    330     void voidMethodInt32ArrayArg(Int32Array int32ArrayArg);
    331     void voidMethodUint8ArrayArg(Uint8Array uint8ArrayArg);
    332     // Arrays
    333     long[] longArrayMethod();
    334     DOMString[] stringArrayMethod();
    335     TestInterfaceEmpty[] testInterfaceEmptyArrayMethod();
    336     void voidMethodArrayLongArg(long[] arrayLongArg);
    337     void voidMethodArrayStringArg(DOMString[] arrayStringArg);
    338     void voidMethodArrayTestInterfaceEmptyArg(TestInterfaceEmpty[] arrayTestInterfaceEmptyArg);
    339     // Sequences
    340     sequence<long> longSequenceMethod();
    341     sequence<DOMString> stringSequenceMethod();
    342     sequence<TestInterfaceEmpty> testInterfaceEmptySequenceMethod();
    343     void voidMethodSequenceLongArg(sequence<long> longSequenceArg);
    344     void voidMethodSequenceStringArg(sequence<DOMString> stringSequenceArg);
    345     void voidMethodSequenceTestInterfaceEmptyArg(sequence<TestInterfaceEmpty> testInterfaceEmptySequenceArg);
    346     void voidMethodSequenceSequenceDOMStringArg(sequence<sequence<DOMString>> stringSequenceSequenceArg);
    347     // Nullable types
    348     long? nullableLongMethod();
    349     DOMString? nullableStringMethod();
    350     TestInterface? nullableTestInterfaceMethod();
    351     sequence<long>? nullableLongSequenceMethod();
    352     // Union types
    353     (TestInterfaceGarbageCollected or DOMString) testInterfaceGarbageCollectedOrDOMStringMethod();
    354     (TestInterfaceWillBeGarbageCollected or TestDictionary) testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod();
    355     (sequence<long> or DOMString[] or unrestricted double) longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethod();
    356     // Currently only used on interface type arguments
    357     void voidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? nullableTestInterfaceEmptyArg);
    358     // Callback interface types
    359     void voidMethodTestCallbackInterfaceArg(TestCallbackInterface testCallbackInterfaceArg);
    360     void voidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg);
    361     void voidMethodTestCallbackInterfaceOrNullArg(TestCallbackInterface? testCallbackInterfaceArg);
    362     // Enumerations
    363     TestEnum testEnumMethod();
    364     void voidMethodTestEnumArg(TestEnum testEnumTypeArg);
    365     // Exceptional types
    366     Dictionary dictionaryMethod();
    367     NodeFilter nodeFilterMethod();
    368     Promise promiseMethod(long arg1, Dictionary arg2, DOMString arg3, DOMString... variadic);
    369     Promise promiseMethodWithoutExceptionState(Dictionary arg1);
    370     SerializedScriptValue serializedScriptValueMethod();
    371     XPathNSResolver xPathNSResolverMethod();
    372     void voidMethodDictionaryArg(Dictionary dictionaryArg);
    373     void voidMethodNodeFilterArg(NodeFilter nodeFilterArg);
    374     void voidMethodPromiseArg(Promise promiseArg);
    375     void voidMethodSerializedScriptValueArg(SerializedScriptValue serializedScriptValueArg);
    376     void voidMethodXPathNSResolverArg(XPathNSResolver xPathNSResolverArg);
    377     void voidMethodDictionarySequenceArg(sequence<Dictionary> dictionarySequenceArg);
    378     Promise overloadedPromiseMethod(long arg);
    379     Promise overloadedPromiseMethod(DOMString arg);
    380 
    381     // Arguments
    382     void voidMethodStringArgLongArg(DOMString stringArg, long longArg);
    383     // Optional arguments
    384     void voidMethodOptionalStringArg(optional DOMString optionalStringArg);
    385     void voidMethodOptionalTestInterfaceEmptyArg(optional TestInterfaceEmpty optionalTestInterfaceEmptyArg);
    386     void voidMethodOptionalLongArg(optional long optionalLongArg);
    387     DOMString stringMethodOptionalLongArg(optional long optionalLongArg);
    388     TestInterfaceEmpty testInterfaceEmptyMethodOptionalLongArg(optional long optionalLongArg);
    389     long longMethodOptionalLongArg(optional long optionalLongArg);
    390     void voidMethodLongArgOptionalLongArg(long longArg, optional long optionalLongArg);
    391     void voidMethodLongArgOptionalLongArgOptionalLongArg(long longArg, optional long optionalLongArg1, optional long optionalLongArg2);
    392     void voidMethodLongArgOptionalTestInterfaceEmptyArg(long longArg, optional TestInterfaceEmpty optionalTestInterfaceEmpty);
    393     void voidMethodTestInterfaceEmptyArgOptionalLongArg(TestInterfaceEmpty optionalTestInterfaceEmpty, optional long longArg);
    394     // Optional arguments: exceptional case
    395     void voidMethodOptionalDictionaryArg(optional Dictionary optionalDictionaryArg);
    396 
    397     // Optional arguments with defaults
    398     void voidMethodDefaultByteStringArg(optional ByteString defaultByteStringArg = "foo");
    399     void voidMethodDefaultStringArg(optional DOMString defaultStringArg = "foo");
    400     void voidMethodDefaultIntegerArgs(optional long defaultLongArg = 10,
    401                                       optional long long defaultLongLongArg = -10,
    402                                       optional unsigned long defaultUnsignedArg = 0xFFFFFFFF);
    403     void voidMethodDefaultDoubleArg(optional double defaultDoubleArg = 0.5);
    404     void voidMethodDefaultTrueBooleanArg(optional boolean defaultBooleanArg = true);
    405     void voidMethodDefaultFalseBooleanArg(optional boolean defaultBooleanArg = false);
    406     void voidMethodDefaultNullableByteStringArg(optional ByteString? defaultStringArg = null);
    407     void voidMethodDefaultNullableStringArg(optional DOMString? defaultStringArg = null);
    408     void voidMethodDefaultNullableTestInterfaceArg(optional TestInterface? defaultTestInterfaceArg = null);
    409 
    410     // Variadic operations
    411     void voidMethodVariadicStringArg(DOMString... variadicStringArgs);
    412     void voidMethodStringArgVariadicStringArg(DOMString stringArg, DOMString... variadicStringArgs);
    413     void voidMethodVariadicTestInterfaceEmptyArg(TestInterfaceEmpty... variadicTestInterfaceEmptyArgs);
    414     void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg, TestInterfaceEmpty... variadicTestInterfaceEmptyArgs);
    415     void voidMethodVariadicTestInterfaceGarbageCollectedArg(TestInterfaceGarbageCollected... variadicTestInterfaceGarbageCollectedArg);
    416     void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(TestInterfaceWillBeGarbageCollected... variadicTestInterfaceWillBeGarbageCollectedArg);
    417 
    418     // Overloaded methods
    419     void overloadedMethodA(long longArg);
    420     void overloadedMethodA(long longArg1, long longArg2);
    421     void overloadedMethodB(long longArg);
    422     void overloadedMethodB(DOMString stringArg, optional long longArg);
    423     void overloadedMethodC(long longArg);
    424     void overloadedMethodC(TestInterfaceEmpty testInterfaceEmptyArg);
    425     void overloadedMethodD(long longArg);
    426     void overloadedMethodD(long[] longArrayArg);
    427     void overloadedMethodE(long longArg);
    428     void overloadedMethodE(TestInterfaceEmpty? testInterfaceEmptyOrNullArg);
    429     void overloadedMethodF(optional DOMString stringArg);
    430     void overloadedMethodF(double doubleArg);
    431     void overloadedMethodG(long longArg);
    432     void overloadedMethodG(optional TestInterfaceEmpty? testInterfaceEmptyOrNullArg = null);
    433     void overloadedMethodH(TestInterface testInterfaceArg);
    434     void overloadedMethodH(TestInterfaceEmpty testInterfaceEmptyArg);
    435     void overloadedMethodI(DOMString stringArg);
    436     void overloadedMethodI(double doubleArg);
    437     void overloadedMethodJ(DOMString stringArg);
    438     void overloadedMethodJ(TestDictionary testDictionaryArg);
    439 
    440 
    441     [PerWorldBindings] void overloadedPerWorldBindingsMethod();
    442     [PerWorldBindings] void overloadedPerWorldBindingsMethod(long longArg);
    443 
    444     static void overloadedStaticMethod(long longArg);
    445     static void overloadedStaticMethod(long longArg1, long longArg2);
    446 
    447     // Extended attributes for arguments
    448     // [Clamp]
    449     void voidMethodClampUnsignedShortArg([Clamp] unsigned short clampUnsignedShortArg);
    450     void voidMethodClampUnsignedLongArg([Clamp] unsigned long clampUnsignedLongArg);
    451     // [Default]
    452     void voidMethodDefaultUndefinedTestInterfaceEmptyArg([Default=Undefined] optional TestInterfaceEmpty defaultUndefinedTestInterfaceEmptyArg);
    453     void voidMethodDefaultUndefinedLongArg([Default=Undefined] optional long defaultUndefinedLongArg);
    454     void voidMethodDefaultUndefinedStringArg([Default=Undefined] optional DOMString defaultUndefinedStringArg);
    455     // [EnforceRange]
    456     void voidMethodEnforceRangeLongArg([EnforceRange] long enforceRangeLongArg);
    457     // [TreatNullAs], [TreatUndefinedAs]
    458     void voidMethodTreatNullAsEmptyStringStringArg([TreatNullAs=EmptyString] DOMString treatNullAsEmptyStringStringArg);
    459     void voidMethodTreatNullAsNullStringStringArg([TreatNullAs=NullString] DOMString treatNullAsNullStringStringArg);
    460     void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString treatNullAsNullStringStringArg);
    461 
    462     // Extended attributes for methods
    463     [LogActivity, LogAllWorlds] void activityLoggingAccessForAllWorldsMethod();
    464     [CallWith=ExecutionContext] void callWithExecutionContextVoidMethod();
    465     [CallWith=ScriptState] void callWithScriptStateVoidMethod();
    466     [CallWith=ScriptState] long callWithScriptStateLongMethod();
    467     [CallWith=(ScriptState,ExecutionContext)] void callWithScriptStateExecutionContextVoidMethod();
    468     [CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethod();
    469     [CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg);
    470     [CallWith=ActiveWindow] void callWithActiveWindow();
    471     [CallWith=(ActiveWindow,FirstWindow)] void callWithActiveWindowScriptWindow();
    472     [CheckSecurity=Node] void checkSecurityForNodeVoidMethod();
    473     [Conditional=CONDITION] void conditionalConditionVoidMethod();
    474     [Conditional=CONDITION] static void conditionalConditionStaticVoidMethod();
    475     [Custom] void customVoidMethod();
    476     [Conditional=CONDITION, Custom] void conditionalConditionCustomVoidMethod();
    477     [CustomElementCallbacks] void customElementCallbacksVoidMethod();
    478     [DeprecateAs=voidMethod] void deprecatedVoidMethod();
    479     [DoNotCheckSignature] void doNotCheckSignatureVoidMethod();
    480     [ImplementedAs=implementedAsMethodName] void implementedAsVoidMethod();
    481     [MeasureAs=TestFeature] void measureAsVoidMethod();
    482     [DeprecateAs=TestFeatureA] void DeprecateAsOverloadedMethod();
    483     [DeprecateAs=TestFeatureB] void DeprecateAsOverloadedMethod(long arg);
    484     [DeprecateAs=TestFeature] void DeprecateAsSameValueOverloadedMethod();
    485     [DeprecateAs=TestFeature] void DeprecateAsSameValueOverloadedMethod(long arg);
    486     [MeasureAs=TestFeatureA] void measureAsOverloadedMethod();
    487     [MeasureAs=TestFeatureB] void measureAsOverloadedMethod(long arg);
    488     [MeasureAs=TestFeature] void measureAsSameValueOverloadedMethod();
    489     [MeasureAs=TestFeature] void measureAsSameValueOverloadedMethod(long arg);
    490     [DeprecateAs=TestFeatureA, MeasureAs=TestFeature] void deprecateAsMeasureAsSameValueOverloadedMethod();
    491     [DeprecateAs=TestFeatureB, MeasureAs=TestFeature] void deprecateAsMeasureAsSameValueOverloadedMethod(long arg);
    492     [DeprecateAs=TestFeature, MeasureAs=TestFeatureA] void deprecateAsSameValueMeasureAsOverloadedMethod();
    493     [DeprecateAs=TestFeature, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsOverloadedMethod(long arg);
    494     [DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod();
    495     [DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod(long arg);
    496     [NotEnumerable] void notEnumerableVoidMethod();
    497     [PerContextEnabled=FeatureName] void perContextEnabledVoidMethod();
    498     [PerWorldBindings] void perWorldBindingsVoidMethod();
    499     [PerWorldBindings] void perWorldBindingsVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
    500     [LogActivity, LogAllWorlds, PerWorldBindings] void activityLoggingForAllWorldsPerWorldBindingsVoidMethod();
    501     [LogActivity, PerWorldBindings] void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod();
    502     [RaisesException] void raisesExceptionVoidMethod();
    503     [RaisesException] DOMString raisesExceptionStringMethod();
    504     [RaisesException] void raisesExceptionVoidMethodOptionalLongArg(optional long optionalLongArg);
    505     [RaisesException] void raisesExceptionVoidMethodTestCallbackInterfaceArg(TestCallbackInterface testCallbackInterfaceArg);
    506     [RaisesException] void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg);
    507     [RaisesException] TestInterfaceEmpty raisesExceptionTestInterfaceEmptyVoidMethod();
    508     [CallWith=ExecutionContext, RaisesException] void callWithExecutionContextRaisesExceptionVoidMethodLongArg(long longArg);
    509     [RuntimeEnabled=FeatureName] void runtimeEnabledVoidMethod();
    510     [PerWorldBindings, RuntimeEnabled=FeatureName] void perWorldBindingsRuntimeEnabledVoidMethod();
    511     [RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(DOMString stringArg);
    512     [RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(long longArg);
    513     [RuntimeEnabled=FeatureName1] void partiallyRuntimeEnabledOverloadedVoidMethod(DOMString stringArg);
    514     [RuntimeEnabled=FeatureName2] void partiallyRuntimeEnabledOverloadedVoidMethod(TestInterface testInterface);
    515     void partiallyRuntimeEnabledOverloadedVoidMethod(long longArg);
    516     [TreatReturnedNullStringAs=Null] DOMString treatReturnedNullStringAsNullStringMethod();
    517     [TreatReturnedNullStringAs=Undefined] DOMString treatReturnedNullStringAsUndefinedStringMethod();
    518     [TreatReturnedNullStringAs=Null] ByteString treatReturnedNullStringAsNullByteStringMethod();
    519     [TreatReturnedNullStringAs=Undefined] ByteString treatReturnedNullStringAsUndefinedByteStringMethod();
    520     [TreatReturnedNullStringAs=Null] ScalarValueString treatReturnedNullStringAsNullScalarValueStringMethod();
    521     [TreatReturnedNullStringAs=Undefined] ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringMethod();
    522     [TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
    523     [TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg(TestInterfaceEmpty... testInterfaceEmptyArg);
    524     [TypeChecking=Unrestricted] void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg);
    525     [Unforgeable] void unforgeableVoidMethod();
    526     void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceArg);
    527     void voidMethodTestInterfaceGarbageCollectedArrayArg(TestInterfaceGarbageCollected[] testInterfaceGarbageCollectedArrayArg);
    528     void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceArg);
    529     void voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] testInterfaceWillBeGarbageCollectedArrayArg);
    530 
    531     // Extended attributes on referenced interfaces
    532     // (not self; self-reference tests at interface themselves)
    533     attribute TestInterface testInterfaceAttribute; // [ImplementedAs]
    534     attribute TestInterfaceGarbageCollected testInterfaceGarbageCollectedAttribute; // [GarbageCollected]
    535     attribute TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullAttribute; // [GarbageCollected]
    536     attribute TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedAttribute; // [WillBeGarbageCollected]
    537     attribute TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullAttribute; // [WillBeGarbageCollected]
    538 
    539     // Private scripts
    540     [ImplementedInPrivateScript] void voidMethodImplementedInPrivateScript();
    541     [ImplementedInPrivateScript] short shortMethodImplementedInPrivateScript();
    542     [ImplementedInPrivateScript] short shortMethodWithShortArgumentImplementedInPrivateScript(short value);
    543     [ImplementedInPrivateScript] DOMString stringMethodWithStringArgumentImplementedInPrivateScript(DOMString value);
    544     [ImplementedInPrivateScript] Node nodeMethodWithNodeArgumentImplementedInPrivateScript(Node value);
    545     [ImplementedInPrivateScript] Node nodeMethodWithVariousArgumentsImplementedInPrivateScript(Document document, Node node, short value1, double value2, DOMString string);
    546     [ImplementedInPrivateScript] readonly attribute short readonlyShortAttribute;
    547     [ImplementedInPrivateScript] attribute short shortAttribute;
    548     [ImplementedInPrivateScript] attribute DOMString stringAttribute;
    549     [ImplementedInPrivateScript] attribute Node nodeAttribute;
    550     [OnlyExposedToPrivateScript] short methodImplementedInCPPForPrivateScriptOnly(short value1, short value2);
    551     [OnlyExposedToPrivateScript] attribute DOMString attributeImplementedInCPPForPrivateScriptOnly;
    552     [ImplementedInPrivateScript, OnlyExposedToPrivateScript] short methodForPrivateScriptOnly(short value1, short value2);
    553     [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString attributeForPrivateScriptOnly;
    554     [ImplementedInPrivateScript] attribute TestEnum enumForPrivateScript;
    555 };
    556