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