tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestCodeGen.webidl (72835B)


      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 
      7 typedef long myLong;
      8 typedef TestInterface AnotherNameForTestInterface;
      9 typedef TestInterface? NullableTestInterface;
     10 typedef CustomEventInit TestDictionaryTypedef;
     11 typedef ArrayBufferView ArrayBufferViewTypedef;
     12 typedef [AllowShared] ArrayBufferView AllowSharedArrayBufferViewTypedef;
     13 
     14 interface TestExternalInterface;
     15 
     16 // We need a pref name that's in StaticPrefList.h here.
     17 [Pref="dom.webidl.test1",
     18 Exposed=Window]
     19 interface TestRenamedInterface {
     20 };
     21 
     22 [Exposed=Window]
     23 callback interface TestCallbackInterface {
     24  readonly attribute long foo;
     25  attribute DOMString bar;
     26  undefined doSomething();
     27  long doSomethingElse(DOMString arg, TestInterface otherArg);
     28  undefined doSequenceLongArg(sequence<long> arg);
     29  undefined doSequenceStringArg(sequence<DOMString> arg);
     30  undefined doRecordLongArg(record<DOMString, long> arg);
     31  sequence<long> getSequenceOfLong();
     32  sequence<TestInterface> getSequenceOfInterfaces();
     33  sequence<TestInterface>? getNullableSequenceOfInterfaces();
     34  sequence<TestInterface?> getSequenceOfNullableInterfaces();
     35  sequence<TestInterface?>? getNullableSequenceOfNullableInterfaces();
     36  sequence<TestCallbackInterface> getSequenceOfCallbackInterfaces();
     37  sequence<TestCallbackInterface>? getNullableSequenceOfCallbackInterfaces();
     38  sequence<TestCallbackInterface?> getSequenceOfNullableCallbackInterfaces();
     39  sequence<TestCallbackInterface?>? getNullableSequenceOfNullableCallbackInterfaces();
     40  record<DOMString, long> getRecordOfLong();
     41  Dict? getDictionary();
     42  undefined passArrayBuffer(ArrayBuffer arg);
     43  undefined passNullableArrayBuffer(ArrayBuffer? arg);
     44  undefined passOptionalArrayBuffer(optional ArrayBuffer arg);
     45  undefined passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
     46  undefined passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
     47  undefined passArrayBufferView(ArrayBufferView arg);
     48  undefined passInt8Array(Int8Array arg);
     49  undefined passInt16Array(Int16Array arg);
     50  undefined passInt32Array(Int32Array arg);
     51  undefined passUint8Array(Uint8Array arg);
     52  undefined passUint16Array(Uint16Array arg);
     53  undefined passUint32Array(Uint32Array arg);
     54  undefined passUint8ClampedArray(Uint8ClampedArray arg);
     55  undefined passFloat32Array(Float32Array arg);
     56  undefined passBigInt64Array(BigUint64Array arg);
     57  undefined passBigUint64Array(BigUint64Array arg);
     58  undefined passFloat64Array(Float64Array arg);
     59  undefined passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
     60  undefined passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
     61  undefined passVariadicTypedArray(Float32Array... arg);
     62  undefined passVariadicNullableTypedArray(Float32Array?... arg);
     63  Uint8Array receiveUint8Array();
     64  attribute Uint8Array uint8ArrayAttr;
     65  BigUint64Array receiveBigUint64Array();
     66  attribute BigInt64Array int64ArrayAttr;
     67  Promise<undefined> receivePromise();
     68 };
     69 
     70 [Exposed=Window]
     71 callback interface TestSingleOperationCallbackInterface {
     72  TestInterface doSomething(short arg, sequence<double> anotherArg);
     73 };
     74 
     75 enum TestEnum {
     76  "1",
     77  "a",
     78  "b",
     79  "1-2",
     80  "2d-array"
     81 };
     82 
     83 callback TestCallback = undefined();
     84 [TreatNonCallableAsNull] callback TestTreatAsNullCallback = undefined();
     85 
     86 // Callback return value tests
     87 callback TestIntegerReturn = long();
     88 callback TestNullableIntegerReturn = long?();
     89 callback TestBooleanReturn = boolean();
     90 callback TestFloatReturn = float();
     91 callback TestStringReturn = DOMString(long arg);
     92 callback TestEnumReturn = TestEnum();
     93 callback TestInterfaceReturn = TestInterface();
     94 callback TestNullableInterfaceReturn = TestInterface?();
     95 callback TestExternalInterfaceReturn = TestExternalInterface();
     96 callback TestNullableExternalInterfaceReturn = TestExternalInterface?();
     97 callback TestCallbackInterfaceReturn = TestCallbackInterface();
     98 callback TestNullableCallbackInterfaceReturn = TestCallbackInterface?();
     99 callback TestCallbackReturn = TestCallback();
    100 callback TestNullableCallbackReturn = TestCallback?();
    101 callback TestObjectReturn = object();
    102 callback TestNullableObjectReturn = object?();
    103 callback TestTypedArrayReturn = ArrayBuffer();
    104 callback TestNullableTypedArrayReturn = ArrayBuffer?();
    105 callback TestSequenceReturn = sequence<boolean>();
    106 callback TestNullableSequenceReturn = sequence<boolean>?();
    107 // Callback argument tests
    108 callback TestIntegerArguments = sequence<long>(long arg1, long? arg2,
    109                                               sequence<long> arg3,
    110                                               sequence<long?>? arg4);
    111 callback TestInterfaceArguments = undefined(TestInterface arg1,
    112                                            TestInterface? arg2,
    113                                            TestExternalInterface arg3,
    114                                            TestExternalInterface? arg4,
    115                                            TestCallbackInterface arg5,
    116                                            TestCallbackInterface? arg6,
    117                                            sequence<TestInterface> arg7,
    118                                            sequence<TestInterface?>? arg8,
    119                                            sequence<TestExternalInterface> arg9,
    120                                            sequence<TestExternalInterface?>? arg10,
    121                                            sequence<TestCallbackInterface> arg11,
    122                                            sequence<TestCallbackInterface?>? arg12);
    123 callback TestStringEnumArguments = undefined(DOMString myString, DOMString? nullString,
    124                                        TestEnum myEnum);
    125 callback TestObjectArguments = undefined(object anObj, object? anotherObj,
    126                                    ArrayBuffer buf, ArrayBuffer? buf2);
    127 callback TestOptionalArguments = undefined(optional DOMString aString,
    128                                           optional object something,
    129                                           optional sequence<TestInterface> aSeq,
    130                                           optional TestInterface? anInterface,
    131                                           optional TestInterface anotherInterface,
    132                                           optional long aLong);
    133 // Callback constructor return value tests
    134 callback constructor TestUndefinedConstruction = undefined(TestDictionaryTypedef arg);
    135 callback constructor TestIntegerConstruction = unsigned long();
    136 callback constructor TestBooleanConstruction = boolean(any arg1,
    137                                                       optional any arg2);
    138 callback constructor TestFloatConstruction = unrestricted float(optional object arg1,
    139                                                                optional TestDictionaryTypedef arg2);
    140 callback constructor TestStringConstruction = DOMString(long? arg);
    141 callback constructor TestEnumConstruction = TestEnum(any... arg);
    142 callback constructor TestInterfaceConstruction = TestInterface();
    143 callback constructor TestExternalInterfaceConstruction = TestExternalInterface();
    144 callback constructor TestCallbackInterfaceConstruction = TestCallbackInterface();
    145 callback constructor TestCallbackConstruction = TestCallback();
    146 callback constructor TestObjectConstruction = object();
    147 callback constructor TestTypedArrayConstruction = ArrayBuffer();
    148 callback constructor TestSequenceConstruction = sequence<boolean>();
    149 // If you add a new test callback, add it to the forceCallbackGeneration
    150 // method on TestInterface so it actually gets tested.
    151 
    152 TestInterface includes InterfaceMixin;
    153 
    154 // This interface is only for use in the constructor below
    155 [Exposed=Window]
    156 interface OnlyForUseInConstructor {
    157 };
    158 
    159 // This enum is only for use in inner unions below
    160 enum OnlyForUseInInnerUnion {
    161  "1",
    162 };
    163 
    164 [LegacyFactoryFunction=Test,
    165 LegacyFactoryFunction=Test(DOMString str),
    166 LegacyFactoryFunction=Test2(DictForConstructor dict, any any1, object obj1,
    167                        object? obj2, sequence<Dict> seq, optional any any2,
    168                        optional object obj3, optional object? obj4),
    169 Exposed=Window]
    170 interface TestInterface {
    171  constructor();
    172  constructor(DOMString str);
    173  constructor(unsigned long num, boolean? boolArg);
    174  constructor(TestInterface? iface);
    175  constructor(unsigned long arg1, TestInterface iface);
    176  constructor(ArrayBuffer arrayBuf);
    177  constructor(Uint8Array typedArr);
    178  // constructor(long arg1, long arg2, (TestInterface or OnlyForUseInConstructor) arg3);
    179 
    180  // Integer types
    181  // XXXbz add tests for throwing versions of all the integer stuff
    182  readonly attribute byte readonlyByte;
    183  attribute byte writableByte;
    184  undefined passByte(byte arg);
    185  byte receiveByte();
    186  undefined passOptionalByte(optional byte arg);
    187  undefined passOptionalByteBeforeRequired(optional byte arg1, byte arg2);
    188  undefined passOptionalByteWithDefault(optional byte arg = 0);
    189  undefined passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2);
    190  undefined passNullableByte(byte? arg);
    191  undefined passOptionalNullableByte(optional byte? arg);
    192  undefined passVariadicByte(byte... arg);
    193  [StoreInSlot, Pure]
    194  readonly attribute byte cachedByte;
    195  [StoreInSlot, Constant]
    196  readonly attribute byte cachedConstantByte;
    197  [StoreInSlot, Pure]
    198  attribute byte cachedWritableByte;
    199  [Affects=Nothing]
    200  attribute byte sideEffectFreeByte;
    201  [Affects=Nothing, DependsOn=DOMState]
    202  attribute byte domDependentByte;
    203  [Affects=Nothing, DependsOn=Nothing]
    204  readonly attribute byte constantByte;
    205  [DependsOn=DeviceState, Affects=Nothing]
    206  readonly attribute byte deviceStateDependentByte;
    207  [Affects=Nothing]
    208  byte returnByteSideEffectFree();
    209  [Affects=Nothing, DependsOn=DOMState]
    210  byte returnDOMDependentByte();
    211  [Affects=Nothing, DependsOn=Nothing]
    212  byte returnConstantByte();
    213  [DependsOn=DeviceState, Affects=Nothing]
    214  byte returnDeviceStateDependentByte();
    215 
    216  readonly attribute short readonlyShort;
    217  attribute short writableShort;
    218  undefined passShort(short arg);
    219  short receiveShort();
    220  undefined passOptionalShort(optional short arg);
    221  undefined passOptionalShortWithDefault(optional short arg = 5);
    222 
    223  readonly attribute long readonlyLong;
    224  attribute long writableLong;
    225  undefined passLong(long arg);
    226  long receiveLong();
    227  undefined passOptionalLong(optional long arg);
    228  undefined passOptionalLongWithDefault(optional long arg = 7);
    229 
    230  readonly attribute long long readonlyLongLong;
    231  attribute long long writableLongLong;
    232  undefined passLongLong(long long arg);
    233  long long receiveLongLong();
    234  undefined passOptionalLongLong(optional long long arg);
    235  undefined passOptionalLongLongWithDefault(optional long long arg = -12);
    236 
    237  readonly attribute octet readonlyOctet;
    238  attribute octet writableOctet;
    239  undefined passOctet(octet arg);
    240  octet receiveOctet();
    241  undefined passOptionalOctet(optional octet arg);
    242  undefined passOptionalOctetWithDefault(optional octet arg = 19);
    243 
    244  readonly attribute unsigned short readonlyUnsignedShort;
    245  attribute unsigned short writableUnsignedShort;
    246  undefined passUnsignedShort(unsigned short arg);
    247  unsigned short receiveUnsignedShort();
    248  undefined passOptionalUnsignedShort(optional unsigned short arg);
    249  undefined passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2);
    250 
    251  readonly attribute unsigned long readonlyUnsignedLong;
    252  attribute unsigned long writableUnsignedLong;
    253  undefined passUnsignedLong(unsigned long arg);
    254  unsigned long receiveUnsignedLong();
    255  undefined passOptionalUnsignedLong(optional unsigned long arg);
    256  undefined passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6);
    257 
    258  readonly attribute unsigned long long readonlyUnsignedLongLong;
    259  attribute unsigned long long  writableUnsignedLongLong;
    260  undefined passUnsignedLongLong(unsigned long long arg);
    261  unsigned long long receiveUnsignedLongLong();
    262  undefined passOptionalUnsignedLongLong(optional unsigned long long arg);
    263  undefined passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17);
    264 
    265  attribute float writableFloat;
    266  attribute unrestricted float writableUnrestrictedFloat;
    267  attribute float? writableNullableFloat;
    268  attribute unrestricted float? writableNullableUnrestrictedFloat;
    269  attribute double writableDouble;
    270  attribute unrestricted double writableUnrestrictedDouble;
    271  attribute double? writableNullableDouble;
    272  attribute unrestricted double? writableNullableUnrestrictedDouble;
    273  undefined passFloat(float arg1, unrestricted float arg2,
    274                      float? arg3, unrestricted float? arg4,
    275                      double arg5, unrestricted double arg6,
    276                      double? arg7, unrestricted double? arg8,
    277                      sequence<float> arg9, sequence<unrestricted float> arg10,
    278                      sequence<float?> arg11, sequence<unrestricted float?> arg12,
    279                      sequence<double> arg13, sequence<unrestricted double> arg14,
    280                      sequence<double?> arg15, sequence<unrestricted double?> arg16);
    281  [LenientFloat]
    282  undefined passLenientFloat(float arg1, unrestricted float arg2,
    283                             float? arg3, unrestricted float? arg4,
    284                             double arg5, unrestricted double arg6,
    285                             double? arg7, unrestricted double? arg8,
    286                             sequence<float> arg9,
    287                             sequence<unrestricted float> arg10,
    288                             sequence<float?> arg11,
    289                             sequence<unrestricted float?> arg12,
    290                             sequence<double> arg13,
    291                             sequence<unrestricted double> arg14,
    292                             sequence<double?> arg15,
    293                             sequence<unrestricted double?> arg16);
    294  [LenientFloat]
    295  attribute float lenientFloatAttr;
    296  [LenientFloat]
    297  attribute double lenientDoubleAttr;
    298 
    299  undefined passUnrestricted(optional unrestricted float arg1 = 0,
    300                             optional unrestricted float arg2 = Infinity,
    301                             optional unrestricted float arg3 = -Infinity,
    302                             optional unrestricted float arg4 = NaN,
    303                             optional unrestricted double arg5 = 0,
    304                             optional unrestricted double arg6 = Infinity,
    305                             optional unrestricted double arg7 = -Infinity,
    306                             optional unrestricted double arg8 = NaN);
    307 
    308  // Castable interface types
    309  // XXXbz add tests for throwing versions of all the castable interface stuff
    310  TestInterface receiveSelf();
    311  TestInterface? receiveNullableSelf();
    312  TestInterface receiveWeakSelf();
    313  TestInterface? receiveWeakNullableSelf();
    314  undefined passSelf(TestInterface arg);
    315  undefined passNullableSelf(TestInterface? arg);
    316  attribute TestInterface nonNullSelf;
    317  attribute TestInterface? nullableSelf;
    318  [Cached, Pure]
    319  readonly attribute TestInterface cachedSelf;
    320  // Optional arguments
    321  undefined passOptionalSelf(optional TestInterface? arg);
    322  undefined passOptionalNonNullSelf(optional TestInterface arg);
    323  undefined passOptionalSelfWithDefault(optional TestInterface? arg = null);
    324 
    325  // Non-wrapper-cache interface types
    326  [NewObject]
    327  TestNonWrapperCacheInterface receiveNonWrapperCacheInterface();
    328  [NewObject]
    329  TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface();
    330  [NewObject]
    331  sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence();
    332  [NewObject]
    333  sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence();
    334  [NewObject]
    335  sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence();
    336  [NewObject]
    337  sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence();
    338 
    339  // External interface types
    340  TestExternalInterface receiveExternal();
    341  TestExternalInterface? receiveNullableExternal();
    342  TestExternalInterface receiveWeakExternal();
    343  TestExternalInterface? receiveWeakNullableExternal();
    344  undefined passExternal(TestExternalInterface arg);
    345  undefined passNullableExternal(TestExternalInterface? arg);
    346  attribute TestExternalInterface nonNullExternal;
    347  attribute TestExternalInterface? nullableExternal;
    348  // Optional arguments
    349  undefined passOptionalExternal(optional TestExternalInterface? arg);
    350  undefined passOptionalNonNullExternal(optional TestExternalInterface arg);
    351  undefined passOptionalExternalWithDefault(optional TestExternalInterface? arg = null);
    352 
    353  // Callback interface types
    354  TestCallbackInterface receiveCallbackInterface();
    355  TestCallbackInterface? receiveNullableCallbackInterface();
    356  TestCallbackInterface receiveWeakCallbackInterface();
    357  TestCallbackInterface? receiveWeakNullableCallbackInterface();
    358  undefined passCallbackInterface(TestCallbackInterface arg);
    359  undefined passNullableCallbackInterface(TestCallbackInterface? arg);
    360  attribute TestCallbackInterface nonNullCallbackInterface;
    361  attribute TestCallbackInterface? nullableCallbackInterface;
    362  // Optional arguments
    363  undefined passOptionalCallbackInterface(optional TestCallbackInterface? arg);
    364  undefined passOptionalNonNullCallbackInterface(optional TestCallbackInterface arg);
    365  undefined passOptionalCallbackInterfaceWithDefault(optional TestCallbackInterface? arg = null);
    366 
    367  // Sequence types
    368  [Cached, Pure]
    369  readonly attribute sequence<long> readonlySequence;
    370  [Cached, Pure]
    371  readonly attribute sequence<Dict> readonlySequenceOfDictionaries;
    372  [Cached, Pure]
    373  readonly attribute sequence<Dict>? readonlyNullableSequenceOfDictionaries;
    374  [Cached, Pure, Frozen]
    375  readonly attribute sequence<Dict> readonlyFrozenSequence;
    376  [Cached, Pure, Frozen]
    377  readonly attribute sequence<Dict>? readonlyFrozenNullableSequence;
    378  sequence<long> receiveSequence();
    379  sequence<long>? receiveNullableSequence();
    380  sequence<long?> receiveSequenceOfNullableInts();
    381  sequence<long?>? receiveNullableSequenceOfNullableInts();
    382  undefined passSequence(sequence<long> arg);
    383  undefined passNullableSequence(sequence<long>? arg);
    384  undefined passSequenceOfNullableInts(sequence<long?> arg);
    385  undefined passOptionalSequenceOfNullableInts(optional sequence<long?> arg);
    386  undefined passOptionalNullableSequenceOfNullableInts(optional sequence<long?>? arg);
    387  sequence<TestInterface> receiveCastableObjectSequence();
    388  sequence<TestCallbackInterface> receiveCallbackObjectSequence();
    389  sequence<TestInterface?> receiveNullableCastableObjectSequence();
    390  sequence<TestCallbackInterface?> receiveNullableCallbackObjectSequence();
    391  sequence<TestInterface>? receiveCastableObjectNullableSequence();
    392  sequence<TestInterface?>? receiveNullableCastableObjectNullableSequence();
    393  sequence<TestInterface> receiveWeakCastableObjectSequence();
    394  sequence<TestInterface?> receiveWeakNullableCastableObjectSequence();
    395  sequence<TestInterface>? receiveWeakCastableObjectNullableSequence();
    396  sequence<TestInterface?>? receiveWeakNullableCastableObjectNullableSequence();
    397  undefined passCastableObjectSequence(sequence<TestInterface> arg);
    398  undefined passNullableCastableObjectSequence(sequence<TestInterface?> arg);
    399  undefined passCastableObjectNullableSequence(sequence<TestInterface>? arg);
    400  undefined passNullableCastableObjectNullableSequence(sequence<TestInterface?>? arg);
    401  undefined passOptionalSequence(optional sequence<long> arg);
    402  undefined passOptionalSequenceWithDefaultValue(optional sequence<long> arg = []);
    403  undefined passOptionalNullableSequence(optional sequence<long>? arg);
    404  undefined passOptionalNullableSequenceWithDefaultValue(optional sequence<long>? arg = null);
    405  undefined passOptionalNullableSequenceWithDefaultValue2(optional sequence<long>? arg = []);
    406  undefined passOptionalObjectSequence(optional sequence<TestInterface> arg);
    407  undefined passExternalInterfaceSequence(sequence<TestExternalInterface> arg);
    408  undefined passNullableExternalInterfaceSequence(sequence<TestExternalInterface?> arg);
    409 
    410  sequence<DOMString> receiveStringSequence();
    411  undefined passStringSequence(sequence<DOMString> arg);
    412 
    413  sequence<ByteString> receiveByteStringSequence();
    414  undefined passByteStringSequence(sequence<ByteString> arg);
    415 
    416  sequence<UTF8String> receiveUTF8StringSequence();
    417  undefined passUTF8StringSequence(sequence<UTF8String> arg);
    418 
    419  sequence<any> receiveAnySequence();
    420  sequence<any>? receiveNullableAnySequence();
    421  sequence<sequence<any>> receiveAnySequenceSequence();
    422 
    423  sequence<object> receiveObjectSequence();
    424  sequence<object?> receiveNullableObjectSequence();
    425 
    426  undefined passSequenceOfSequences(sequence<sequence<long>> arg);
    427  undefined passSequenceOfSequencesOfSequences(sequence<sequence<sequence<long>>> arg);
    428  sequence<sequence<long>> receiveSequenceOfSequences();
    429  sequence<sequence<sequence<long>>> receiveSequenceOfSequencesOfSequences();
    430 
    431  // record types
    432  undefined passRecord(record<DOMString, long> arg);
    433  undefined passNullableRecord(record<DOMString, long>? arg);
    434  undefined passRecordOfNullableInts(record<DOMString, long?> arg);
    435  undefined passOptionalRecordOfNullableInts(optional record<DOMString, long?> arg);
    436  undefined passOptionalNullableRecordOfNullableInts(optional record<DOMString, long?>? arg);
    437  undefined passCastableObjectRecord(record<DOMString, TestInterface> arg);
    438  undefined passNullableCastableObjectRecord(record<DOMString, TestInterface?> arg);
    439  undefined passCastableObjectNullableRecord(record<DOMString, TestInterface>? arg);
    440  undefined passNullableCastableObjectNullableRecord(record<DOMString, TestInterface?>? arg);
    441  undefined passOptionalRecord(optional record<DOMString, long> arg);
    442  undefined passOptionalNullableRecord(optional record<DOMString, long>? arg);
    443  undefined passOptionalNullableRecordWithDefaultValue(optional record<DOMString, long>? arg = null);
    444  undefined passOptionalObjectRecord(optional record<DOMString, TestInterface> arg);
    445  undefined passExternalInterfaceRecord(record<DOMString, TestExternalInterface> arg);
    446  undefined passNullableExternalInterfaceRecord(record<DOMString, TestExternalInterface?> arg);
    447  undefined passStringRecord(record<DOMString, DOMString> arg);
    448  undefined passByteStringRecord(record<DOMString, ByteString> arg);
    449  undefined passUTF8StringRecord(record<DOMString, UTF8String> arg);
    450  undefined passRecordOfRecords(record<DOMString, record<DOMString, long>> arg);
    451  record<DOMString, long> receiveRecord();
    452  record<DOMString, long>? receiveNullableRecord();
    453  record<DOMString, long?> receiveRecordOfNullableInts();
    454  record<DOMString, long?>? receiveNullableRecordOfNullableInts();
    455  record<DOMString, record<DOMString, long>> receiveRecordOfRecords();
    456  record<DOMString, any> receiveAnyRecord();
    457 
    458  // Typed array types
    459  undefined passArrayBuffer(ArrayBuffer arg);
    460  undefined passNullableArrayBuffer(ArrayBuffer? arg);
    461  undefined passOptionalArrayBuffer(optional ArrayBuffer arg);
    462  undefined passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
    463  undefined passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
    464  undefined passArrayBufferView(ArrayBufferView arg);
    465  undefined passInt8Array(Int8Array arg);
    466  undefined passInt16Array(Int16Array arg);
    467  undefined passInt32Array(Int32Array arg);
    468  undefined passUint8Array(Uint8Array arg);
    469  undefined passUint16Array(Uint16Array arg);
    470  undefined passUint32Array(Uint32Array arg);
    471  undefined passUint8ClampedArray(Uint8ClampedArray arg);
    472  undefined passFloat32Array(Float32Array arg);
    473  undefined passFloat64Array(Float64Array arg);
    474  undefined passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
    475  undefined passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
    476  undefined passRecordOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
    477  undefined passRecordOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
    478  undefined passVariadicTypedArray(Float32Array... arg);
    479  undefined passVariadicNullableTypedArray(Float32Array?... arg);
    480  Uint8Array receiveUint8Array();
    481  attribute Uint8Array uint8ArrayAttr;
    482 
    483  // DOMString types
    484  undefined passString(DOMString arg);
    485  undefined passNullableString(DOMString? arg);
    486  undefined passOptionalString(optional DOMString arg);
    487  undefined passOptionalStringWithDefaultValue(optional DOMString arg = "abc");
    488  undefined passOptionalNullableString(optional DOMString? arg);
    489  undefined passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
    490  undefined passVariadicString(DOMString... arg);
    491  DOMString receiveString();
    492 
    493  // ByteString types
    494  undefined passByteString(ByteString arg);
    495  undefined passNullableByteString(ByteString? arg);
    496  undefined passOptionalByteString(optional ByteString arg);
    497  undefined passOptionalByteStringWithDefaultValue(optional ByteString arg = "abc");
    498  undefined passOptionalNullableByteString(optional ByteString? arg);
    499  undefined passOptionalNullableByteStringWithDefaultValue(optional ByteString? arg = null);
    500  undefined passVariadicByteString(ByteString... arg);
    501  undefined passOptionalUnionByteString(optional (ByteString or long) arg);
    502  undefined passOptionalUnionByteStringWithDefaultValue(optional (ByteString or long) arg = "abc");
    503 
    504  // UTF8String types
    505  undefined passUTF8String(UTF8String arg);
    506  undefined passNullableUTF8String(UTF8String? arg);
    507  undefined passOptionalUTF8String(optional UTF8String arg);
    508  undefined passOptionalUTF8StringWithDefaultValue(optional UTF8String arg = "abc");
    509  undefined passOptionalNullableUTF8String(optional UTF8String? arg);
    510  undefined passOptionalNullableUTF8StringWithDefaultValue(optional UTF8String? arg = null);
    511  undefined passVariadicUTF8String(UTF8String... arg);
    512  undefined passOptionalUnionUTF8String(optional (UTF8String or long) arg);
    513  undefined passOptionalUnionUTF8StringWithDefaultValue(optional (UTF8String or long) arg = "abc");
    514 
    515  // USVString types
    516  undefined passUSVS(USVString arg);
    517  undefined passNullableUSVS(USVString? arg);
    518  undefined passOptionalUSVS(optional USVString arg);
    519  undefined passOptionalUSVSWithDefaultValue(optional USVString arg = "abc");
    520  undefined passOptionalNullableUSVS(optional USVString? arg);
    521  undefined passOptionalNullableUSVSWithDefaultValue(optional USVString? arg = null);
    522  undefined passVariadicUSVS(USVString... arg);
    523  USVString receiveUSVS();
    524 
    525  // JSString types
    526  undefined passJSString(JSString arg);
    527  // undefined passNullableJSString(JSString? arg); // NOT SUPPORTED YET
    528  // undefined passOptionalJSString(optional JSString arg); // NOT SUPPORTED YET
    529  undefined passOptionalJSStringWithDefaultValue(optional JSString arg = "abc");
    530  // undefined passOptionalNullableJSString(optional JSString? arg); // NOT SUPPORTED YET
    531  // undefined passOptionalNullableJSStringWithDefaultValue(optional JSString? arg = null); // NOT SUPPORTED YET
    532  // undefined passVariadicJSString(JSString... arg); // NOT SUPPORTED YET
    533  // undefined passRecordOfJSString(record<DOMString, JSString> arg); // NOT SUPPORTED YET
    534  // undefined passSequenceOfJSString(sequence<JSString> arg); // NOT SUPPORTED YET
    535  // undefined passUnionJSString((JSString or long) arg); // NOT SUPPORTED YET
    536  JSString receiveJSString();
    537  // sequence<JSString> receiveJSStringSequence(); // NOT SUPPORTED YET
    538  // (JSString or long) receiveJSStringUnion(); // NOT SUPPORTED YET
    539  // record<DOMString, JSString> receiveJSStringRecord(); // NOT SUPPORTED YET
    540  readonly attribute JSString readonlyJSStringAttr;
    541  attribute JSString jsStringAttr;
    542 
    543  // Enumerated types
    544  undefined passEnum(TestEnum arg);
    545  undefined passNullableEnum(TestEnum? arg);
    546  undefined passOptionalEnum(optional TestEnum arg);
    547  undefined passEnumWithDefault(optional TestEnum arg = "a");
    548  undefined passOptionalNullableEnum(optional TestEnum? arg);
    549  undefined passOptionalNullableEnumWithDefaultValue(optional TestEnum? arg = null);
    550  undefined passOptionalNullableEnumWithDefaultValue2(optional TestEnum? arg = "a");
    551  TestEnum receiveEnum();
    552  TestEnum? receiveNullableEnum();
    553  attribute TestEnum enumAttribute;
    554  readonly attribute TestEnum readonlyEnumAttribute;
    555 
    556  // Callback types
    557  undefined passCallback(TestCallback arg);
    558  undefined passNullableCallback(TestCallback? arg);
    559  undefined passOptionalCallback(optional TestCallback arg);
    560  undefined passOptionalNullableCallback(optional TestCallback? arg);
    561  undefined passOptionalNullableCallbackWithDefaultValue(optional TestCallback? arg = null);
    562  TestCallback receiveCallback();
    563  TestCallback? receiveNullableCallback();
    564  undefined passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg);
    565  undefined passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg);
    566  undefined passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null);
    567  attribute TestTreatAsNullCallback treatAsNullCallback;
    568  attribute TestTreatAsNullCallback? nullableTreatAsNullCallback;
    569 
    570  // Force code generation of the various test callbacks we have.
    571  undefined forceCallbackGeneration(TestIntegerReturn arg1,
    572                                    TestNullableIntegerReturn arg2,
    573                                    TestBooleanReturn arg3,
    574                                    TestFloatReturn arg4,
    575                                    TestStringReturn arg5,
    576                                    TestEnumReturn arg6,
    577                                    TestInterfaceReturn arg7,
    578                                    TestNullableInterfaceReturn arg8,
    579                                    TestExternalInterfaceReturn arg9,
    580                                    TestNullableExternalInterfaceReturn arg10,
    581                                    TestCallbackInterfaceReturn arg11,
    582                                    TestNullableCallbackInterfaceReturn arg12,
    583                                    TestCallbackReturn arg13,
    584                                    TestNullableCallbackReturn arg14,
    585                                    TestObjectReturn arg15,
    586                                    TestNullableObjectReturn arg16,
    587                                    TestTypedArrayReturn arg17,
    588                                    TestNullableTypedArrayReturn arg18,
    589                                    TestSequenceReturn arg19,
    590                                    TestNullableSequenceReturn arg20,
    591                                    TestIntegerArguments arg21,
    592                                    TestInterfaceArguments arg22,
    593                                    TestStringEnumArguments arg23,
    594                                    TestObjectArguments arg24,
    595                                    TestOptionalArguments arg25,
    596                                    TestUnionArguments arg26,
    597                                    TestUndefinedConstruction arg27,
    598                                    TestIntegerConstruction arg28,
    599                                    TestBooleanConstruction arg29,
    600                                    TestFloatConstruction arg30,
    601                                    TestStringConstruction arg31,
    602                                    TestEnumConstruction arg32,
    603                                    TestInterfaceConstruction arg33,
    604                                    TestExternalInterfaceConstruction arg34,
    605                                    TestCallbackInterfaceConstruction arg35,
    606                                    TestCallbackConstruction arg36,
    607                                    TestObjectConstruction arg37,
    608                                    TestTypedArrayConstruction arg38,
    609                                    TestSequenceConstruction arg39);
    610 
    611  // Any types
    612  undefined passAny(any arg);
    613  undefined passVariadicAny(any... arg);
    614  undefined passOptionalAny(optional any arg);
    615  undefined passAnyDefaultNull(optional any arg = null);
    616  undefined passSequenceOfAny(sequence<any> arg);
    617  undefined passNullableSequenceOfAny(sequence<any>? arg);
    618  undefined passOptionalSequenceOfAny(optional sequence<any> arg);
    619  undefined passOptionalNullableSequenceOfAny(optional sequence<any>? arg);
    620  undefined passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null);
    621  undefined passSequenceOfSequenceOfAny(sequence<sequence<any>> arg);
    622  undefined passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
    623  undefined passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
    624  undefined passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
    625  undefined passRecordOfAny(record<DOMString, any> arg);
    626  undefined passNullableRecordOfAny(record<DOMString, any>? arg);
    627  undefined passOptionalRecordOfAny(optional record<DOMString, any> arg);
    628  undefined passOptionalNullableRecordOfAny(optional record<DOMString, any>? arg);
    629  undefined passOptionalRecordOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
    630  undefined passRecordOfRecordOfAny(record<DOMString, record<DOMString, any>> arg);
    631  undefined passRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?> arg);
    632  undefined passNullableRecordOfNullableRecordOfAny(record<DOMString, record<DOMString, any>?>? arg);
    633  undefined passOptionalNullableRecordOfNullableRecordOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
    634  undefined passOptionalNullableRecordOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
    635  undefined passOptionalNullableSequenceOfNullableRecordOfAny(optional sequence<record<DOMString, any>?>? arg);
    636  any receiveAny();
    637 
    638  // object types
    639  undefined passObject(object arg);
    640  undefined passVariadicObject(object... arg);
    641  undefined passNullableObject(object? arg);
    642  undefined passVariadicNullableObject(object... arg);
    643  undefined passOptionalObject(optional object arg);
    644  undefined passOptionalNullableObject(optional object? arg);
    645  undefined passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
    646  undefined passSequenceOfObject(sequence<object> arg);
    647  undefined passSequenceOfNullableObject(sequence<object?> arg);
    648  undefined passNullableSequenceOfObject(sequence<object>? arg);
    649  undefined passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
    650  undefined passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
    651  undefined passRecordOfObject(record<DOMString, object> arg);
    652  object receiveObject();
    653  object? receiveNullableObject();
    654 
    655  // Union types
    656  undefined passUnion((object or long) arg);
    657  // Some  union tests are debug-only to avoid creating all those
    658  // unused union types in opt builds.
    659 #ifdef DEBUG
    660  undefined passUnion2((long or boolean) arg);
    661  undefined passUnion3((object or long or boolean) arg);
    662  undefined passUnion4((Node or long or boolean) arg);
    663  undefined passUnion5((object or boolean) arg);
    664  undefined passUnion6((object or DOMString) arg);
    665  undefined passUnion7((object or DOMString or long) arg);
    666  undefined passUnion8((object or DOMString or boolean) arg);
    667  undefined passUnion9((object or DOMString or long or boolean) arg);
    668  undefined passUnion10(optional (EventInit or long) arg = {});
    669  undefined passUnion11(optional (CustomEventInit or long) arg = {});
    670  undefined passUnion12(optional (EventInit or long) arg = 5);
    671  undefined passUnion13(optional (object or long?) arg = null);
    672  undefined passUnion14(optional (object or long?) arg = 5);
    673  undefined passUnion15((sequence<long> or long) arg);
    674  undefined passUnion16(optional (sequence<long> or long) arg);
    675  undefined passUnion17(optional (sequence<long>? or long) arg = 5);
    676  undefined passUnion18((sequence<object> or long) arg);
    677  undefined passUnion19(optional (sequence<object> or long) arg);
    678  undefined passUnion20(optional (sequence<object> or long) arg = []);
    679  undefined passUnion21((record<DOMString, long> or long) arg);
    680  undefined passUnion22((record<DOMString, object> or long) arg);
    681  undefined passUnion23((sequence<ImageData> or long) arg);
    682  undefined passUnion24((sequence<ImageData?> or long) arg);
    683  undefined passUnion25((sequence<sequence<ImageData>> or long) arg);
    684  undefined passUnion26((sequence<sequence<ImageData?>> or long) arg);
    685  undefined passUnion27(optional (sequence<DOMString> or EventInit) arg = {});
    686  undefined passUnion28(optional (EventInit or sequence<DOMString>) arg = {});
    687  undefined passUnionWithCallback((EventHandler or long) arg);
    688  undefined passUnionWithByteString((ByteString or long) arg);
    689  undefined passUnionWithUTF8String((UTF8String or long) arg);
    690  undefined passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
    691  undefined passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
    692  undefined passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
    693  undefined passUnionWithUSVS((USVString or long) arg);
    694 #endif
    695  undefined passUnionWithNullable((object? or long) arg);
    696  undefined passNullableUnion((object or long)? arg);
    697  undefined passOptionalUnion(optional (object or long) arg);
    698  undefined passOptionalNullableUnion(optional (object or long)? arg);
    699  undefined passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
    700  //undefined passUnionWithInterfaces((TestInterface or TestExternalInterface) arg);
    701  //undefined passUnionWithInterfacesAndNullable((TestInterface? or TestExternalInterface) arg);
    702  //undefined passUnionWithSequence((sequence<object> or long) arg);
    703  undefined passUnionWithArrayBuffer((UTF8String or ArrayBuffer) arg);
    704  undefined passUnionWithArrayBufferOrNull((UTF8String or ArrayBuffer?) arg);
    705  undefined passUnionWithTypedArrays((ArrayBufferView or ArrayBuffer) arg);
    706  undefined passUnionWithTypedArraysOrNull((ArrayBufferView or ArrayBuffer?) arg);
    707  undefined passUnionWithString((DOMString or object) arg);
    708  // Using an enum in a union.  Note that we use some enum not declared in our
    709  // binding file, because UnionTypes.h will need to include the binding header
    710  // for this enum.  Pick an enum from an interface that won't drag in too much
    711  // stuff.
    712  undefined passUnionWithEnum((SupportedType or object) arg);
    713 
    714  // Trying to use a callback in a union won't include the test
    715  // headers, unfortunately, so won't compile.
    716  //undefined passUnionWithCallback((TestCallback or long) arg);
    717  undefined passUnionWithObject((object or long) arg);
    718  //undefined passUnionWithDict((Dict or long) arg);
    719 
    720  undefined passUnionWithDefaultValue1(optional (double or DOMString) arg = "");
    721  undefined passUnionWithDefaultValue2(optional (double or DOMString) arg = 1);
    722  undefined passUnionWithDefaultValue3(optional (double or DOMString) arg = 1.5);
    723  undefined passUnionWithDefaultValue4(optional (float or DOMString) arg = "");
    724  undefined passUnionWithDefaultValue5(optional (float or DOMString) arg = 1);
    725  undefined passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5);
    726  undefined passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = "");
    727  undefined passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1);
    728  undefined passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5);
    729  undefined passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity);
    730  undefined passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = "");
    731  undefined passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1);
    732  undefined passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity);
    733  undefined passUnionWithDefaultValue14(optional (double or ByteString) arg = "");
    734  undefined passUnionWithDefaultValue15(optional (double or ByteString) arg = 1);
    735  undefined passUnionWithDefaultValue16(optional (double or ByteString) arg = 1.5);
    736  undefined passUnionWithDefaultValue17(optional (double or SupportedType) arg = "text/html");
    737  undefined passUnionWithDefaultValue18(optional (double or SupportedType) arg = 1);
    738  undefined passUnionWithDefaultValue19(optional (double or SupportedType) arg = 1.5);
    739  undefined passUnionWithDefaultValue20(optional (double or USVString) arg = "abc");
    740  undefined passUnionWithDefaultValue21(optional (double or USVString) arg = 1);
    741  undefined passUnionWithDefaultValue22(optional (double or USVString) arg = 1.5);
    742  undefined passUnionWithDefaultValue23(optional (double or UTF8String) arg = "");
    743  undefined passUnionWithDefaultValue24(optional (double or UTF8String) arg = 1);
    744  undefined passUnionWithDefaultValue25(optional (double or UTF8String) arg = 1.5);
    745 
    746  undefined passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = "");
    747  undefined passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1);
    748  undefined passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null);
    749  undefined passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = "");
    750  undefined passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1);
    751  undefined passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null);
    752  undefined passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = "");
    753  undefined passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1);
    754  undefined passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null);
    755  undefined passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = "");
    756  undefined passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1);
    757  undefined passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null);
    758  undefined passNullableUnionWithDefaultValue13(optional (double or ByteString)? arg = "");
    759  undefined passNullableUnionWithDefaultValue14(optional (double or ByteString)? arg = 1);
    760  undefined passNullableUnionWithDefaultValue15(optional (double or ByteString)? arg = 1.5);
    761  undefined passNullableUnionWithDefaultValue16(optional (double or ByteString)? arg = null);
    762  undefined passNullableUnionWithDefaultValue17(optional (double or SupportedType)? arg = "text/html");
    763  undefined passNullableUnionWithDefaultValue18(optional (double or SupportedType)? arg = 1);
    764  undefined passNullableUnionWithDefaultValue19(optional (double or SupportedType)? arg = 1.5);
    765  undefined passNullableUnionWithDefaultValue20(optional (double or SupportedType)? arg = null);
    766  undefined passNullableUnionWithDefaultValue21(optional (double or USVString)? arg = "abc");
    767  undefined passNullableUnionWithDefaultValue22(optional (double or USVString)? arg = 1);
    768  undefined passNullableUnionWithDefaultValue23(optional (double or USVString)? arg = 1.5);
    769  undefined passNullableUnionWithDefaultValue24(optional (double or USVString)? arg = null);
    770 
    771  undefined passNullableUnionWithDefaultValue25(optional (double or UTF8String)? arg = "abc");
    772  undefined passNullableUnionWithDefaultValue26(optional (double or UTF8String)? arg = 1);
    773  undefined passNullableUnionWithDefaultValue27(optional (double or UTF8String)? arg = 1.5);
    774  undefined passNullableUnionWithDefaultValue28(optional (double or UTF8String)? arg = null);
    775 
    776  undefined passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
    777  undefined passSequenceOfUnions2(sequence<(object or long)> arg);
    778  undefined passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
    779 
    780  undefined passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
    781  undefined passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
    782  undefined passRecordOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
    783 
    784  // Each inner union in the following APIs should have a unique set
    785  // of union member types, not used in any other API.
    786  undefined passUnionWithSequenceOfUnions((DOMString or sequence<(OnlyForUseInInnerUnion or CanvasPattern)>) arg);
    787  //undefined passUnionWithFrozenArrayOfUnions((DOMString or FrozenArray<(OnlyForUseInInnerUnion or CanvasGradient)>) arg);
    788  undefined passUnionWithRecordOfUnions((sequence<long> or record<DOMString, (OnlyForUseInInnerUnion or sequence<long>)>) arg);
    789 
    790  // XXXbz no move constructor on some unions
    791  // undefined passRecordOfUnions2(record<DOMString, (object or long)> arg);
    792 
    793  (CanvasPattern or CanvasGradient) receiveUnion();
    794  (object or long) receiveUnion2();
    795  (CanvasPattern? or CanvasGradient) receiveUnionContainingNull();
    796  (CanvasPattern or CanvasGradient)? receiveNullableUnion();
    797  (object or long)? receiveNullableUnion2();
    798  (undefined or CanvasPattern) receiveUnionWithUndefined();
    799  (undefined? or CanvasPattern) receiveUnionWithNullableUndefined();
    800  (undefined or CanvasPattern?) receiveUnionWithUndefinedAndNullable();
    801  (undefined or CanvasPattern)? receiveNullableUnionWithUndefined();
    802 
    803  attribute (CanvasPattern or CanvasGradient) writableUnion;
    804  attribute (CanvasPattern? or CanvasGradient) writableUnionContainingNull;
    805  attribute (CanvasPattern or CanvasGradient)? writableNullableUnion;
    806  attribute (undefined or CanvasPattern) writableUnionWithUndefined;
    807  attribute (undefined? or CanvasPattern) writableUnionWithNullableUndefined;
    808  attribute (undefined or CanvasPattern?) writableUnionWithUndefinedAndNullable;
    809  attribute (undefined or CanvasPattern)? writableNullableUnionWithUndefined;
    810 
    811  // Promise types
    812  undefined passPromise(Promise<any> arg);
    813  undefined passOptionalPromise(optional Promise<any> arg);
    814  undefined passPromiseSequence(sequence<Promise<any>> arg);
    815  Promise<any> receivePromise();
    816  Promise<any> receiveAddrefedPromise();
    817 
    818  // ObservableArray types
    819  attribute ObservableArray<boolean> booleanObservableArray;
    820  attribute ObservableArray<object> objectObservableArray;
    821  attribute ObservableArray<any> anyObservableArray;
    822  attribute ObservableArray<TestInterface> interfaceObservableArray;
    823  attribute ObservableArray<long?> nullableObservableArray;
    824 
    825  // binaryNames tests
    826  [BinaryName="methodRenamedTo"]
    827  undefined methodRenamedFrom();
    828  [BinaryName="methodRenamedTo"]
    829  undefined methodRenamedFrom(byte argument);
    830  [BinaryName="attributeGetterRenamedTo"]
    831  readonly attribute byte attributeGetterRenamedFrom;
    832  [BinaryName="attributeRenamedTo"]
    833  attribute byte attributeRenamedFrom;
    834 
    835  undefined passDictionary(optional Dict x = {});
    836  undefined passDictionary2(Dict x);
    837  [Cached, Pure]
    838  readonly attribute Dict readonlyDictionary;
    839  [Cached, Pure]
    840  readonly attribute Dict? readonlyNullableDictionary;
    841  [Cached, Pure]
    842  attribute Dict writableDictionary;
    843  [Cached, Pure, Frozen]
    844  readonly attribute Dict readonlyFrozenDictionary;
    845  [Cached, Pure, Frozen]
    846  readonly attribute Dict? readonlyFrozenNullableDictionary;
    847  [Cached, Pure, Frozen]
    848  attribute Dict writableFrozenDictionary;
    849  Dict receiveDictionary();
    850  Dict? receiveNullableDictionary();
    851  undefined passOtherDictionary(optional GrandparentDict x = {});
    852  undefined passSequenceOfDictionaries(sequence<Dict> x);
    853  undefined passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
    854  // No support for nullable dictionaries inside a sequence (nor should there be)
    855  //  undefined passSequenceOfNullableDictionaries(sequence<Dict?> x);
    856  undefined passDictionaryOrLong(optional Dict x = {});
    857  undefined passDictionaryOrLong(long x);
    858 
    859  undefined passDictContainingDict(optional DictContainingDict arg = {});
    860  undefined passDictContainingSequence(optional DictContainingSequence arg = {});
    861  DictContainingSequence receiveDictContainingSequence();
    862  undefined passVariadicDictionary(Dict... arg);
    863 
    864  // EnforceRange/Clamp tests
    865  undefined dontEnforceRangeOrClamp(byte arg);
    866  undefined doEnforceRange([EnforceRange] byte arg);
    867  undefined doEnforceRangeNullable([EnforceRange] byte? arg);
    868  undefined doClamp([Clamp] byte arg);
    869  undefined doClampNullable([Clamp] byte? arg);
    870  attribute [EnforceRange] byte enforcedByte;
    871  attribute [EnforceRange] byte? enforcedNullableByte;
    872  attribute [Clamp] byte clampedByte;
    873  attribute [Clamp] byte? clampedNullableByte;
    874 
    875  // Typedefs
    876  const myLong myLongConstant = 5;
    877  undefined exerciseTypedefInterfaces1(AnotherNameForTestInterface arg);
    878  AnotherNameForTestInterface exerciseTypedefInterfaces2(NullableTestInterface arg);
    879  undefined exerciseTypedefInterfaces3(YetAnotherNameForTestInterface arg);
    880 
    881  // Deprecated methods and attributes
    882  [Deprecated="Components"]
    883  attribute byte deprecatedAttribute;
    884  [Deprecated="Components"]
    885  byte deprecatedMethod();
    886  [Deprecated="Components"]
    887  byte deprecatedMethodWithContext(any arg);
    888 
    889  // Static methods and attributes
    890  static attribute boolean staticAttribute;
    891  static undefined staticMethod(boolean arg);
    892  static undefined staticMethodWithContext(any arg);
    893 
    894  // Testing static method with a reserved C++ keyword as the name
    895  static undefined assert(boolean arg);
    896 
    897  // Deprecated static methods and attributes
    898  [Deprecated="Components"]
    899  static attribute byte staticDeprecatedAttribute;
    900  [Deprecated="Components"]
    901  static undefined staticDeprecatedMethod();
    902  [Deprecated="Components"]
    903  static undefined staticDeprecatedMethodWithContext(any arg);
    904 
    905  // Overload resolution tests
    906  //undefined overload1(DOMString... strs);
    907  boolean overload1(TestInterface arg);
    908  TestInterface overload1(DOMString strs, TestInterface arg);
    909  undefined overload2(TestInterface arg);
    910  undefined overload2(optional Dict arg = {});
    911  undefined overload2(boolean arg);
    912  undefined overload2(DOMString arg);
    913  undefined overload3(TestInterface arg);
    914  undefined overload3(TestCallback arg);
    915  undefined overload3(boolean arg);
    916  undefined overload4(TestInterface arg);
    917  undefined overload4(TestCallbackInterface arg);
    918  undefined overload4(DOMString arg);
    919  undefined overload5(long arg);
    920  undefined overload5(TestEnum arg);
    921  undefined overload6(long arg);
    922  undefined overload6(boolean arg);
    923  undefined overload7(long arg);
    924  undefined overload7(boolean arg);
    925  undefined overload7(ByteString arg);
    926  undefined overload8(long arg);
    927  undefined overload8(TestInterface arg);
    928  undefined overload9(long? arg);
    929  undefined overload9(DOMString arg);
    930  undefined overload10(long? arg);
    931  undefined overload10(object arg);
    932  undefined overload11(long arg);
    933  undefined overload11(DOMString? arg);
    934  undefined overload12(long arg);
    935  undefined overload12(boolean? arg);
    936  undefined overload13(long? arg);
    937  undefined overload13(boolean arg);
    938  undefined overload14(optional long arg);
    939  undefined overload14(TestInterface arg);
    940  undefined overload15(long arg);
    941  undefined overload15(optional TestInterface arg);
    942  undefined overload16(long arg);
    943  undefined overload16(optional TestInterface? arg);
    944  undefined overload17(sequence<long> arg);
    945  undefined overload17(record<DOMString, long> arg);
    946  undefined overload18(record<DOMString, DOMString> arg);
    947  undefined overload18(sequence<DOMString> arg);
    948  undefined overload19(sequence<long> arg);
    949  undefined overload19(optional Dict arg = {});
    950  undefined overload20(optional Dict arg = {});
    951  undefined overload20(sequence<long> arg);
    952 
    953  // Variadic handling
    954  undefined passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3);
    955 
    956  // Conditionally exposed methods/attributes
    957  [Pref="dom.webidl.test1"]
    958  readonly attribute boolean prefable1;
    959  [Pref="dom.webidl.test1"]
    960  readonly attribute boolean prefable2;
    961  [Pref="dom.webidl.test2"]
    962  readonly attribute boolean prefable3;
    963  [Pref="dom.webidl.test2"]
    964  readonly attribute boolean prefable4;
    965  [Pref="dom.webidl.test1"]
    966  readonly attribute boolean prefable5;
    967  [Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    968  readonly attribute boolean prefable6;
    969  [Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    970  readonly attribute boolean prefable7;
    971  [Pref="dom.webidl.test2", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    972  readonly attribute boolean prefable8;
    973  [Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    974  readonly attribute boolean prefable9;
    975  [Pref="dom.webidl.test1"]
    976  undefined prefable10();
    977  [Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    978  undefined prefable11();
    979  [Pref="dom.webidl.test1", Func="TestFuncControlledMember"]
    980  readonly attribute boolean prefable12;
    981  [Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
    982  undefined prefable13();
    983  [Pref="dom.webidl.test1", Func="TestFuncControlledMember"]
    984  readonly attribute boolean prefable14;
    985  [Func="TestFuncControlledMember"]
    986  readonly attribute boolean prefable15;
    987  [Func="TestFuncControlledMember"]
    988  readonly attribute boolean prefable16;
    989  [Pref="dom.webidl.test1", Func="TestFuncControlledMember"]
    990  undefined prefable17();
    991  [Func="TestFuncControlledMember"]
    992  undefined prefable18();
    993  [Func="TestFuncControlledMember"]
    994  undefined prefable19();
    995  [Pref="dom.webidl.test1", Func="TestFuncControlledMember", ChromeOnly]
    996  undefined prefable20();
    997  [Trial="TestTrial"]
    998  undefined prefable21();
    999  [Pref="dom.webidl.test1", Trial="TestTrial"]
   1000  undefined prefable22();
   1001 
   1002  // Conditionally exposed methods/attributes involving [SecureContext]
   1003  [SecureContext]
   1004  readonly attribute boolean conditionalOnSecureContext1;
   1005  [SecureContext, Pref="dom.webidl.test1"]
   1006  readonly attribute boolean conditionalOnSecureContext2;
   1007  [SecureContext, Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
   1008  readonly attribute boolean conditionalOnSecureContext3;
   1009  [SecureContext, Pref="dom.webidl.test1", Func="TestFuncControlledMember"]
   1010  readonly attribute boolean conditionalOnSecureContext4;
   1011  [SecureContext]
   1012  undefined conditionalOnSecureContext5();
   1013  [SecureContext, Pref="dom.webidl.test1"]
   1014  undefined conditionalOnSecureContext6();
   1015  [SecureContext, Pref="dom.webidl.test1", Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
   1016  undefined conditionalOnSecureContext7();
   1017  [SecureContext, Pref="dom.webidl.test1", Func="TestFuncControlledMember"]
   1018  undefined conditionalOnSecureContext8();
   1019  [SecureContext, Trial="TestTrial"]
   1020  readonly attribute boolean conditionalOnSecureContext9;
   1021  [SecureContext, Pref="dom.webidl.test1", Func="TestFuncControlledMember", Trial="TestTrial"]
   1022  undefined conditionalOnSecureContext10();
   1023 
   1024  // Miscellania
   1025  [LegacyLenientThis] attribute long attrWithLenientThis;
   1026  [LegacyUnforgeable] readonly attribute long unforgeableAttr;
   1027  [LegacyUnforgeable, ChromeOnly] readonly attribute long unforgeableAttr2;
   1028  [LegacyUnforgeable] long unforgeableMethod();
   1029  [LegacyUnforgeable, ChromeOnly] long unforgeableMethod2();
   1030  stringifier;
   1031  undefined passRenamedInterface(TestRenamedInterface arg);
   1032  [PutForwards=writableByte] readonly attribute TestInterface putForwardsAttr;
   1033  [PutForwards=writableByte, LegacyLenientThis] readonly attribute TestInterface putForwardsAttr2;
   1034  [PutForwards=writableByte, ChromeOnly] readonly attribute TestInterface putForwardsAttr3;
   1035  [Throws] undefined throwingMethod();
   1036  [Throws] attribute boolean throwingAttr;
   1037  [GetterThrows] attribute boolean throwingGetterAttr;
   1038  [SetterThrows] attribute boolean throwingSetterAttr;
   1039  [CanOOM] undefined canOOMMethod();
   1040  [CanOOM] attribute boolean canOOMAttr;
   1041  [GetterCanOOM] attribute boolean canOOMGetterAttr;
   1042  [SetterCanOOM] attribute boolean canOOMSetterAttr;
   1043  [NeedsSubjectPrincipal] undefined needsSubjectPrincipalMethod();
   1044  [NeedsSubjectPrincipal] attribute boolean needsSubjectPrincipalAttr;
   1045  [NeedsCallerType] undefined needsCallerTypeMethod();
   1046  [NeedsCallerType] attribute boolean needsCallerTypeAttr;
   1047  [NeedsSubjectPrincipal=NonSystem] undefined needsNonSystemSubjectPrincipalMethod();
   1048  [NeedsSubjectPrincipal=NonSystem] attribute boolean needsNonSystemSubjectPrincipalAttr;
   1049  [CEReactions] undefined ceReactionsMethod();
   1050  [CEReactions] undefined ceReactionsMethodOverload();
   1051  [CEReactions] undefined ceReactionsMethodOverload(DOMString bar);
   1052  [CEReactions] attribute boolean ceReactionsAttr;
   1053  legacycaller short(unsigned long arg1, TestInterface arg2);
   1054  undefined passArgsWithDefaults(optional long arg1,
   1055                                 optional TestInterface? arg2 = null,
   1056                                 optional Dict arg3 = {}, optional double arg4 = 5.0,
   1057                                 optional float arg5);
   1058 
   1059  attribute any toJSONShouldSkipThis;
   1060  attribute TestParentInterface toJSONShouldSkipThis2;
   1061  attribute TestCallbackInterface toJSONShouldSkipThis3;
   1062  [Default] object toJSON();
   1063 
   1064  attribute byte dashed-attribute;
   1065  undefined dashed-method();
   1066 
   1067  // [NonEnumerable] tests
   1068  [NonEnumerable]
   1069  attribute boolean nonEnumerableAttr;
   1070  [NonEnumerable]
   1071  const boolean nonEnumerableConst = true;
   1072  [NonEnumerable]
   1073  undefined nonEnumerableMethod();
   1074 
   1075  // [AllowShared] tests
   1076  attribute [AllowShared] ArrayBufferViewTypedef allowSharedArrayBufferViewTypedef;
   1077  attribute [AllowShared] ArrayBufferView allowSharedArrayBufferView;
   1078  attribute [AllowShared] ArrayBufferView? allowSharedNullableArrayBufferView;
   1079  attribute [AllowShared] ArrayBuffer allowSharedArrayBuffer;
   1080  attribute [AllowShared] ArrayBuffer? allowSharedNullableArrayBuffer;
   1081 
   1082  undefined passAllowSharedArrayBufferViewTypedef(AllowSharedArrayBufferViewTypedef foo);
   1083  undefined passAllowSharedArrayBufferView([AllowShared] ArrayBufferView foo);
   1084  undefined passAllowSharedNullableArrayBufferView([AllowShared] ArrayBufferView? foo);
   1085  undefined passAllowSharedArrayBuffer([AllowShared] ArrayBuffer foo);
   1086  undefined passAllowSharedNullableArrayBuffer([AllowShared] ArrayBuffer? foo);
   1087  undefined passUnionArrayBuffer((DOMString or ArrayBuffer) foo);
   1088  undefined passUnionAllowSharedArrayBuffer((DOMString or [AllowShared] ArrayBuffer) foo);
   1089 
   1090  [Frozen, ReflectedHTMLAttributeReturningFrozenArray]
   1091  attribute sequence<Element>? reflectedHTMLAttributeReturningFrozenArray;
   1092 
   1093  // If you add things here, add them to TestExampleGen as well
   1094 };
   1095 
   1096 [LegacyFactoryFunction=Test3((long or record<DOMString, any>) arg1),
   1097 LegacyFactoryFunction=Test4(record<DOMString, record<DOMString, any>> arg1),
   1098 Exposed=Window]
   1099 interface TestLegacyFactoryFunctionInterface {
   1100 };
   1101 
   1102 [LegacyFactoryFunction=Test5(record<DOMString, sequence<record<DOMString, record<DOMString, sequence<sequence<any>>>>>> arg1),
   1103 LegacyFactoryFunction=Test6(sequence<record<ByteString, sequence<sequence<record<ByteString, record<USVString, any>>>>>> arg1),
   1104 Exposed=Window]
   1105 interface TestLegacyFactoryFunctionInterface2 {
   1106 };
   1107 
   1108 [Exposed=Window]
   1109 interface TestParentInterface {
   1110 };
   1111 
   1112 [Exposed=Window]
   1113 interface TestChildInterface : TestParentInterface {
   1114 };
   1115 
   1116 [Exposed=Window]
   1117 interface TestNonWrapperCacheInterface {
   1118 };
   1119 
   1120 interface mixin InterfaceMixin {
   1121  undefined mixedInMethod();
   1122  attribute boolean mixedInProperty;
   1123 
   1124  const long mixedInConstant = 5;
   1125 };
   1126 
   1127 dictionary Dict : ParentDict {
   1128  TestEnum someEnum;
   1129  long x;
   1130  long a;
   1131  long b = 8;
   1132  long z = 9;
   1133  [EnforceRange] unsigned long enforcedUnsignedLong;
   1134  [Clamp] unsigned long clampedUnsignedLong;
   1135  DOMString str;
   1136  DOMString empty = "";
   1137  TestEnum otherEnum = "b";
   1138  DOMString otherStr = "def";
   1139  DOMString? yetAnotherStr = null;
   1140  DOMString template;
   1141  ByteString byteStr;
   1142  ByteString emptyByteStr = "";
   1143  ByteString otherByteStr = "def";
   1144  // JSString jsStr; // NOT SUPPORTED YET
   1145  object someObj;
   1146  boolean prototype;
   1147  object? anotherObj = null;
   1148  TestCallback? someCallback = null;
   1149  any someAny;
   1150  any anotherAny = null;
   1151 
   1152  unrestricted float  urFloat = 0;
   1153  unrestricted float  urFloat2 = 1.1;
   1154  unrestricted float  urFloat3 = -1.1;
   1155  unrestricted float? urFloat4 = null;
   1156  unrestricted float  infUrFloat = Infinity;
   1157  unrestricted float  negativeInfUrFloat = -Infinity;
   1158  unrestricted float  nanUrFloat = NaN;
   1159 
   1160  unrestricted double  urDouble = 0;
   1161  unrestricted double  urDouble2 = 1.1;
   1162  unrestricted double  urDouble3 = -1.1;
   1163  unrestricted double? urDouble4 = null;
   1164  unrestricted double  infUrDouble = Infinity;
   1165  unrestricted double  negativeInfUrDouble = -Infinity;
   1166  unrestricted double  nanUrDouble = NaN;
   1167 
   1168  (float or DOMString) floatOrString = "str";
   1169  (float or DOMString)? nullableFloatOrString = "str";
   1170  (object or long) objectOrLong;
   1171 #ifdef DEBUG
   1172  (EventInit or long) eventInitOrLong;
   1173  (EventInit or long)? nullableEventInitOrLong;
   1174  (HTMLElement or long)? nullableHTMLElementOrLong;
   1175  // CustomEventInit is useful to test because it needs rooting.
   1176  (CustomEventInit or long) eventInitOrLong2;
   1177  (CustomEventInit or long)? nullableEventInitOrLong2;
   1178  (EventInit or long) eventInitOrLongWithDefaultValue = {};
   1179  (CustomEventInit or long) eventInitOrLongWithDefaultValue2 = {};
   1180  (EventInit or long) eventInitOrLongWithDefaultValue3 = 5;
   1181  (CustomEventInit or long) eventInitOrLongWithDefaultValue4 = 5;
   1182  (EventInit or long)? nullableEventInitOrLongWithDefaultValue = null;
   1183  (CustomEventInit or long)? nullableEventInitOrLongWithDefaultValue2 = null;
   1184  (EventInit or long)? nullableEventInitOrLongWithDefaultValue3 = 5;
   1185  (CustomEventInit or long)? nullableEventInitOrLongWithDefaultValue4 = 5;
   1186  (sequence<object> or long) objectSequenceOrLong;
   1187  (sequence<object> or long) objectSequenceOrLongWithDefaultValue1 = 1;
   1188  (sequence<object> or long) objectSequenceOrLongWithDefaultValue2 = [];
   1189  (sequence<object> or long)? nullableObjectSequenceOrLong;
   1190  (sequence<object> or long)? nullableObjectSequenceOrLongWithDefaultValue1 = 1;
   1191  (sequence<object> or long)? nullableObjectSequenceOrLongWithDefaultValue2 = [];
   1192 #endif
   1193 
   1194  ArrayBuffer arrayBuffer;
   1195  ArrayBuffer? nullableArrayBuffer;
   1196  Uint8Array uint8Array;
   1197  Float64Array? float64Array = null;
   1198 
   1199  sequence<long> seq1;
   1200  sequence<long> seq2 = [];
   1201  sequence<long>? seq3;
   1202  sequence<long>? seq4 = null;
   1203  sequence<long>? seq5 = [];
   1204 
   1205  long dashed-name;
   1206 
   1207  required long requiredLong;
   1208  required object requiredObject;
   1209 
   1210  CustomEventInit customEventInit;
   1211  TestDictionaryTypedef dictionaryTypedef;
   1212 
   1213  Promise<undefined> promise;
   1214  sequence<Promise<undefined>> promiseSequence;
   1215 
   1216  record<DOMString, long> recordMember;
   1217  record<DOMString, long>? nullableRecord;
   1218  record<DOMString, DOMString>? nullableRecordWithDefault = null;
   1219  record<USVString, long> usvStringRecord;
   1220  record<USVString, long>? nullableUSVStringRecordWithDefault = null;
   1221  record<ByteString, long> byteStringRecord;
   1222  record<ByteString, long>? nullableByteStringRecordWithDefault = null;
   1223  record<UTF8String, long> utf8StringRecord;
   1224  record<UTF8String, long>? nullableUTF8StringRecordWithDefault = null;
   1225  required record<DOMString, TestInterface> requiredRecord;
   1226  required record<USVString, TestInterface> requiredUSVRecord;
   1227  required record<ByteString, TestInterface> requiredByteRecord;
   1228  required record<UTF8String, TestInterface> requiredUTF8Record;
   1229 };
   1230 
   1231 dictionary ParentDict : GrandparentDict {
   1232  long c = 5;
   1233  TestInterface someInterface;
   1234  TestInterface? someNullableInterface = null;
   1235  TestExternalInterface someExternalInterface;
   1236  any parentAny;
   1237 };
   1238 
   1239 dictionary DictContainingDict {
   1240  Dict memberDict;
   1241 };
   1242 
   1243 dictionary DictContainingSequence {
   1244  sequence<long> ourSequence;
   1245  sequence<TestInterface> ourSequence2;
   1246  sequence<any> ourSequence3;
   1247  sequence<object> ourSequence4;
   1248  sequence<object?> ourSequence5;
   1249  sequence<object>? ourSequence6;
   1250  sequence<object?>? ourSequence7;
   1251  sequence<object>? ourSequence8 = null;
   1252  sequence<object?>? ourSequence9 = null;
   1253  sequence<(float or DOMString)> ourSequence10;
   1254 };
   1255 
   1256 dictionary DictForConstructor {
   1257  Dict dict;
   1258  DictContainingDict dict2;
   1259  sequence<Dict> seq1;
   1260  sequence<sequence<Dict>>? seq2;
   1261  sequence<sequence<Dict>?> seq3;
   1262  sequence<any> seq4;
   1263  sequence<any> seq5;
   1264  sequence<DictContainingSequence> seq6;
   1265  object obj1;
   1266  object? obj2;
   1267  any any1 = null;
   1268 };
   1269 
   1270 dictionary DictWithConditionalMembers {
   1271  [ChromeOnly]
   1272  long chromeOnlyMember;
   1273  [Func="TestFuncControlledMember"]
   1274  long funcControlledMember;
   1275  [ChromeOnly, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
   1276  long chromeOnlyFuncControlledMember;
   1277  // We need a pref name that's in StaticPrefList.h here.
   1278  [Pref="dom.webidl.test1"]
   1279  long prefControlledMember;
   1280  [Pref="dom.webidl.test1", ChromeOnly, Func="TestFuncControlledMember"]
   1281  long chromeOnlyFuncAndPrefControlledMember;
   1282 };
   1283 
   1284 dictionary DictWithAllowSharedMembers {
   1285  [AllowShared] ArrayBufferView a;
   1286  [AllowShared] ArrayBufferView? b;
   1287  [AllowShared] ArrayBuffer c;
   1288  [AllowShared] ArrayBuffer? d;
   1289  [AllowShared] ArrayBufferViewTypedef e;
   1290  AllowSharedArrayBufferViewTypedef f;
   1291 };
   1292 
   1293 dictionary DictWithBinaryType {
   1294  [BinaryType="nsAutoString"]
   1295  DOMString otherTypeOfStorageStr = "";
   1296 };
   1297 
   1298 [Exposed=Window]
   1299 interface TestIndexedGetterInterface {
   1300  getter long item(unsigned long idx);
   1301  readonly attribute unsigned long length;
   1302  legacycaller undefined();
   1303  [Cached, Pure] readonly attribute long cachedAttr;
   1304  [StoreInSlot, Pure] readonly attribute long storeInSlotAttr;
   1305 };
   1306 
   1307 [Exposed=Window]
   1308 interface TestNamedGetterInterface {
   1309  getter DOMString (DOMString name);
   1310 };
   1311 
   1312 [Exposed=Window]
   1313 interface TestIndexedGetterAndSetterAndNamedGetterInterface {
   1314  getter DOMString (DOMString myName);
   1315  getter long (unsigned long index);
   1316  setter undefined (unsigned long index, long arg);
   1317  readonly attribute unsigned long length;
   1318 };
   1319 
   1320 [Exposed=Window]
   1321 interface TestIndexedAndNamedGetterInterface {
   1322  getter long (unsigned long index);
   1323  getter DOMString namedItem(DOMString name);
   1324  readonly attribute unsigned long length;
   1325 };
   1326 
   1327 [Exposed=Window]
   1328 interface TestIndexedSetterInterface {
   1329  setter undefined setItem(unsigned long idx, DOMString item);
   1330  getter DOMString (unsigned long idx);
   1331  readonly attribute unsigned long length;
   1332 };
   1333 
   1334 [Exposed=Window]
   1335 interface TestNamedSetterInterface {
   1336  setter undefined (DOMString myName, TestIndexedSetterInterface item);
   1337  getter TestIndexedSetterInterface (DOMString name);
   1338 };
   1339 
   1340 [Exposed=Window]
   1341 interface TestIndexedAndNamedSetterInterface {
   1342  setter undefined (unsigned long index, TestIndexedSetterInterface item);
   1343  getter TestIndexedSetterInterface (unsigned long index);
   1344  readonly attribute unsigned long length;
   1345  setter undefined setNamedItem(DOMString name, TestIndexedSetterInterface item);
   1346  getter TestIndexedSetterInterface (DOMString name);
   1347 };
   1348 
   1349 [Exposed=Window]
   1350 interface TestIndexedAndNamedGetterAndSetterInterface : TestIndexedSetterInterface {
   1351  getter long item(unsigned long index);
   1352  getter DOMString namedItem(DOMString name);
   1353  setter undefined (unsigned long index, long item);
   1354  setter undefined (DOMString name, DOMString item);
   1355  stringifier DOMString ();
   1356  readonly attribute unsigned long length;
   1357 };
   1358 
   1359 [Exposed=Window]
   1360 interface TestNamedDeleterInterface {
   1361  deleter undefined (DOMString name);
   1362  getter long (DOMString name);
   1363 };
   1364 
   1365 [Exposed=Window]
   1366 interface TestNamedDeleterWithRetvalInterface {
   1367  deleter undefined delNamedItem(DOMString name);
   1368  getter long (DOMString name);
   1369 };
   1370 
   1371 [Exposed=Window]
   1372 interface TestCppKeywordNamedMethodsInterface {
   1373  boolean continue();
   1374  boolean delete();
   1375  long volatile();
   1376 };
   1377 
   1378 [Deprecated="Components",
   1379 Exposed=Window]
   1380 interface TestDeprecatedInterface {
   1381  constructor();
   1382 
   1383  static undefined alsoDeprecated();
   1384 };
   1385 
   1386 
   1387 [Exposed=Window]
   1388 interface TestInterfaceWithPromiseConstructorArg {
   1389  constructor(Promise<undefined> promise);
   1390 };
   1391 
   1392 [Exposed=Window]
   1393 namespace TestNamespace {
   1394  readonly attribute boolean foo;
   1395  long bar();
   1396 };
   1397 
   1398 partial namespace TestNamespace {
   1399  undefined baz();
   1400 };
   1401 
   1402 [ClassString="RenamedNamespaceClassName",
   1403 Exposed=Window]
   1404 namespace TestRenamedNamespace {
   1405 };
   1406 
   1407 [ProtoObjectHack,
   1408 Exposed=Window]
   1409 namespace TestProtoObjectHackedNamespace {
   1410 };
   1411 
   1412 [SecureContext,
   1413 Exposed=Window]
   1414 interface TestSecureContextInterface {
   1415  static undefined alsoSecureContext();
   1416 };
   1417 
   1418 [Exposed=(Window,Worker)]
   1419 interface TestWorkerExposedInterface {
   1420  [NeedsSubjectPrincipal] undefined needsSubjectPrincipalMethod();
   1421  [NeedsSubjectPrincipal] attribute boolean needsSubjectPrincipalAttr;
   1422  [NeedsCallerType] undefined needsCallerTypeMethod();
   1423  [NeedsCallerType] attribute boolean needsCallerTypeAttr;
   1424  [NeedsSubjectPrincipal=NonSystem] undefined needsNonSystemSubjectPrincipalMethod();
   1425  [NeedsSubjectPrincipal=NonSystem] attribute boolean needsNonSystemSubjectPrincipalAttr;
   1426 };
   1427 
   1428 [Exposed=Window]
   1429 interface TestHTMLConstructorInterface {
   1430  [HTMLConstructor] constructor();
   1431 };
   1432 
   1433 [Exposed=Window]
   1434 interface TestThrowingConstructorInterface {
   1435  [Throws]
   1436  constructor();
   1437  [Throws]
   1438  constructor(DOMString str);
   1439  [Throws]
   1440  constructor(unsigned long num, boolean? boolArg);
   1441  [Throws]
   1442  constructor(TestInterface? iface);
   1443  [Throws]
   1444  constructor(unsigned long arg1, TestInterface iface);
   1445  [Throws]
   1446  constructor(ArrayBuffer arrayBuf);
   1447  [Throws]
   1448  constructor(Uint8Array typedArr);
   1449  // [Throws] constructor(long arg1, long arg2, (TestInterface or OnlyForUseInConstructor) arg3);
   1450 };
   1451 
   1452 [Exposed=Window]
   1453 interface TestCEReactionsInterface {
   1454  [CEReactions] setter undefined (unsigned long index, long item);
   1455  [CEReactions] setter undefined (DOMString name, DOMString item);
   1456  [CEReactions] deleter undefined (DOMString name);
   1457  getter long item(unsigned long index);
   1458  getter DOMString (DOMString name);
   1459  readonly attribute unsigned long length;
   1460 };
   1461 
   1462 typedef [EnforceRange] octet OctetRange;
   1463 typedef [Clamp] octet OctetClamp;
   1464 typedef [LegacyNullToEmptyString] DOMString NullEmptyString;
   1465 // typedef [TreatNullAs=EmptyString] JSString NullEmptyJSString;
   1466 
   1467 dictionary TestAttributesOnDictionaryMembers {
   1468  [Clamp] octet a;
   1469  [ChromeOnly, Clamp] octet b;
   1470  required [Clamp] octet c;
   1471  [ChromeOnly] octet d;
   1472  // ChromeOnly doesn't mix with required, so we can't
   1473  // test [ChromeOnly] required [Clamp] octet e
   1474 };
   1475 
   1476 [Exposed=Window]
   1477 interface TestAttributesOnTypes {
   1478  undefined foo(OctetClamp thingy);
   1479  undefined bar(OctetRange thingy);
   1480  undefined baz(NullEmptyString thingy);
   1481  // undefined qux(NullEmptyJSString thingy);
   1482  attribute [Clamp] octet someAttr;
   1483  undefined argWithAttr([Clamp] octet arg0, optional [Clamp] octet arg1);
   1484  // There aren't any argument-only attributes that we can test here,
   1485  // TreatNonCallableAsNull isn't compatible with Clamp-able types
   1486 };
   1487 
   1488 [Exposed=Window]
   1489 interface TestPrefConstructorForInterface {
   1490  // Since only the constructor is under a pref,
   1491  // the generated constructor should check for the pref.
   1492  [Pref="dom.webidl.test1"] constructor();
   1493 };
   1494 
   1495 [Exposed=Window, Pref="dom.webidl.test1"]
   1496 interface TestConstructorForPrefInterface {
   1497  // Since the interface itself is under a Pref, there should be no
   1498  // check for the pref in the generated constructor.
   1499  constructor();
   1500 };
   1501 
   1502 [Exposed=Window, Pref="dom.webidl.test1"]
   1503 interface TestPrefConstructorForDifferentPrefInterface {
   1504  // Since the constructor's pref is different than the interface pref
   1505  // there should still be a check for the pref in the generated constructor.
   1506  [Pref="dom.webidl.test2"] constructor();
   1507 };
   1508 
   1509 [Exposed=Window, SecureContext]
   1510 interface TestConstructorForSCInterface {
   1511  // Since the interface itself is SecureContext, there should be no
   1512  // runtime check for SecureContext in the generated constructor.
   1513  constructor();
   1514 };
   1515 
   1516 [Exposed=Window]
   1517 interface TestSCConstructorForInterface {
   1518  // Since the interface context is unspecified but the constructor is
   1519  // SecureContext, the generated constructor should check for SecureContext.
   1520  [SecureContext] constructor();
   1521 };
   1522 
   1523 [Exposed=Window, Func="IsNotUAWidget"]
   1524 interface TestConstructorForFuncInterface {
   1525  // Since the interface has a Func attribute, but the constructor does not,
   1526  // the generated constructor should not check for the Func.
   1527  constructor();
   1528 };
   1529 
   1530 [Exposed=Window]
   1531 interface TestFuncConstructorForInterface {
   1532  // Since the constructor has a Func attribute, but the interface does not,
   1533  // the generated constructor should check for the Func.
   1534  [Func="IsNotUAWidget"]
   1535  constructor();
   1536 };
   1537 
   1538 [Exposed=Window, Func="Document::IsCallerChromeOrAddon"]
   1539 interface TestFuncConstructorForDifferentFuncInterface {
   1540  // Since the constructor has a different Func attribute from the interface,
   1541  // the generated constructor should still check for its conditional func.
   1542  [Func="IsNotUAWidget"]
   1543  constructor();
   1544 };
   1545 
   1546 [Exposed=Window]
   1547 interface TestPrefChromeOnlySCFuncConstructorForInterface {
   1548  [Pref="dom.webidl.test1", ChromeOnly, SecureContext, Func="IsNotUAWidget"]
   1549  // There should be checks for all Pref/ChromeOnly/SecureContext/Func
   1550  // in the generated constructor.
   1551  constructor();
   1552 };
   1553 
   1554 typedef (TestCallback or GrandparentDict) TestCallbackDictUnion;
   1555 typedef (GrandparentDict or TestCallback) TestDictCallbackUnion;
   1556 
   1557 [Exposed=Window]
   1558 interface TestCallbackDictUnionOverload {
   1559  undefined overload1(boolean arg);
   1560  undefined overload1(TestCallback arg);
   1561  undefined overload1(optional GrandparentDict arg = {});
   1562  undefined overload2(boolean arg);
   1563  undefined overload2(optional GrandparentDict arg = {});
   1564  undefined overload2(TestCallback arg);
   1565 };