1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bindings/test/TestExampleGen.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,659 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + */ 1.9 +[Constructor, 1.10 + Constructor(DOMString str), 1.11 + Constructor(unsigned long num, boolean? boolArg), 1.12 + Constructor(TestInterface? iface), 1.13 + Constructor(long arg1, IndirectlyImplementedInterface iface), 1.14 + // Constructor(long arg1, long arg2, (TestInterface or OnlyForUseInConstructor) arg3), 1.15 + NamedConstructor=Example, 1.16 + NamedConstructor=Example(DOMString str), 1.17 + NamedConstructor=Example2(DictForConstructor dict, any any1, object obj1, 1.18 + object? obj2, sequence<Dict> seq, optional any any2, 1.19 + optional object obj3, optional object? obj4) 1.20 + ] 1.21 +interface TestExampleInterface { 1.22 + // Integer types 1.23 + // XXXbz add tests for throwing versions of all the integer stuff 1.24 + readonly attribute byte readonlyByte; 1.25 + attribute byte writableByte; 1.26 + void passByte(byte arg); 1.27 + byte receiveByte(); 1.28 + void passOptionalByte(optional byte arg); 1.29 + void passOptionalByteBeforeRequired(optional byte arg1, byte arg2); 1.30 + void passOptionalByteWithDefault(optional byte arg = 0); 1.31 + void passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2); 1.32 + void passNullableByte(byte? arg); 1.33 + void passOptionalNullableByte(optional byte? arg); 1.34 + void passVariadicByte(byte... arg); 1.35 + [Cached, Pure] 1.36 + readonly attribute byte cachedByte; 1.37 + [StoreInSlot, Constant] 1.38 + readonly attribute byte cachedConstantByte; 1.39 + [Cached, Pure] 1.40 + attribute byte cachedWritableByte; 1.41 + 1.42 + readonly attribute short readonlyShort; 1.43 + attribute short writableShort; 1.44 + void passShort(short arg); 1.45 + short receiveShort(); 1.46 + void passOptionalShort(optional short arg); 1.47 + void passOptionalShortWithDefault(optional short arg = 5); 1.48 + 1.49 + readonly attribute long readonlyLong; 1.50 + attribute long writableLong; 1.51 + void passLong(long arg); 1.52 + long receiveLong(); 1.53 + void passOptionalLong(optional long arg); 1.54 + void passOptionalLongWithDefault(optional long arg = 7); 1.55 + 1.56 + readonly attribute long long readonlyLongLong; 1.57 + attribute long long writableLongLong; 1.58 + void passLongLong(long long arg); 1.59 + long long receiveLongLong(); 1.60 + void passOptionalLongLong(optional long long arg); 1.61 + void passOptionalLongLongWithDefault(optional long long arg = -12); 1.62 + 1.63 + readonly attribute octet readonlyOctet; 1.64 + attribute octet writableOctet; 1.65 + void passOctet(octet arg); 1.66 + octet receiveOctet(); 1.67 + void passOptionalOctet(optional octet arg); 1.68 + void passOptionalOctetWithDefault(optional octet arg = 19); 1.69 + 1.70 + readonly attribute unsigned short readonlyUnsignedShort; 1.71 + attribute unsigned short writableUnsignedShort; 1.72 + void passUnsignedShort(unsigned short arg); 1.73 + unsigned short receiveUnsignedShort(); 1.74 + void passOptionalUnsignedShort(optional unsigned short arg); 1.75 + void passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2); 1.76 + 1.77 + readonly attribute unsigned long readonlyUnsignedLong; 1.78 + attribute unsigned long writableUnsignedLong; 1.79 + void passUnsignedLong(unsigned long arg); 1.80 + unsigned long receiveUnsignedLong(); 1.81 + void passOptionalUnsignedLong(optional unsigned long arg); 1.82 + void passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6); 1.83 + 1.84 + readonly attribute unsigned long long readonlyUnsignedLongLong; 1.85 + attribute unsigned long long writableUnsignedLongLong; 1.86 + void passUnsignedLongLong(unsigned long long arg); 1.87 + unsigned long long receiveUnsignedLongLong(); 1.88 + void passOptionalUnsignedLongLong(optional unsigned long long arg); 1.89 + void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17); 1.90 + 1.91 + attribute float writableFloat; 1.92 + attribute unrestricted float writableUnrestrictedFloat; 1.93 + attribute float? writableNullableFloat; 1.94 + attribute unrestricted float? writableNullableUnrestrictedFloat; 1.95 + attribute double writableDouble; 1.96 + attribute unrestricted double writableUnrestrictedDouble; 1.97 + attribute double? writableNullableDouble; 1.98 + attribute unrestricted double? writableNullableUnrestrictedDouble; 1.99 + void passFloat(float arg1, unrestricted float arg2, 1.100 + float? arg3, unrestricted float? arg4, 1.101 + double arg5, unrestricted double arg6, 1.102 + double? arg7, unrestricted double? arg8, 1.103 + sequence<float> arg9, sequence<unrestricted float> arg10, 1.104 + sequence<float?> arg11, sequence<unrestricted float?> arg12, 1.105 + sequence<double> arg13, sequence<unrestricted double> arg14, 1.106 + sequence<double?> arg15, sequence<unrestricted double?> arg16); 1.107 + [LenientFloat] 1.108 + void passLenientFloat(float arg1, unrestricted float arg2, 1.109 + float? arg3, unrestricted float? arg4, 1.110 + double arg5, unrestricted double arg6, 1.111 + double? arg7, unrestricted double? arg8, 1.112 + sequence<float> arg9, 1.113 + sequence<unrestricted float> arg10, 1.114 + sequence<float?> arg11, 1.115 + sequence<unrestricted float?> arg12, 1.116 + sequence<double> arg13, 1.117 + sequence<unrestricted double> arg14, 1.118 + sequence<double?> arg15, 1.119 + sequence<unrestricted double?> arg16); 1.120 + [LenientFloat] 1.121 + attribute float lenientFloatAttr; 1.122 + [LenientFloat] 1.123 + attribute double lenientDoubleAttr; 1.124 + 1.125 + // Castable interface types 1.126 + // XXXbz add tests for throwing versions of all the castable interface stuff 1.127 + TestInterface receiveSelf(); 1.128 + TestInterface? receiveNullableSelf(); 1.129 + TestInterface receiveWeakSelf(); 1.130 + TestInterface? receiveWeakNullableSelf(); 1.131 + void passSelf(TestInterface arg); 1.132 + void passNullableSelf(TestInterface? arg); 1.133 + attribute TestInterface nonNullSelf; 1.134 + attribute TestInterface? nullableSelf; 1.135 + [Cached, Pure] 1.136 + readonly attribute TestInterface cachedSelf; 1.137 + // Optional arguments 1.138 + void passOptionalSelf(optional TestInterface? arg); 1.139 + void passOptionalNonNullSelf(optional TestInterface arg); 1.140 + void passOptionalSelfWithDefault(optional TestInterface? arg = null); 1.141 + 1.142 + // Non-wrapper-cache interface types 1.143 + [NewObject] 1.144 + TestNonWrapperCacheInterface receiveNonWrapperCacheInterface(); 1.145 + [NewObject] 1.146 + TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface(); 1.147 + [NewObject] 1.148 + sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence(); 1.149 + [NewObject] 1.150 + sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence(); 1.151 + [NewObject] 1.152 + sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence(); 1.153 + [NewObject] 1.154 + sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence(); 1.155 + 1.156 + // Non-castable interface types 1.157 + IndirectlyImplementedInterface receiveOther(); 1.158 + IndirectlyImplementedInterface? receiveNullableOther(); 1.159 + IndirectlyImplementedInterface receiveWeakOther(); 1.160 + IndirectlyImplementedInterface? receiveWeakNullableOther(); 1.161 + void passOther(IndirectlyImplementedInterface arg); 1.162 + void passNullableOther(IndirectlyImplementedInterface? arg); 1.163 + attribute IndirectlyImplementedInterface nonNullOther; 1.164 + attribute IndirectlyImplementedInterface? nullableOther; 1.165 + // Optional arguments 1.166 + void passOptionalOther(optional IndirectlyImplementedInterface? arg); 1.167 + void passOptionalNonNullOther(optional IndirectlyImplementedInterface arg); 1.168 + void passOptionalOtherWithDefault(optional IndirectlyImplementedInterface? arg = null); 1.169 + 1.170 + // External interface types 1.171 + TestExternalInterface receiveExternal(); 1.172 + TestExternalInterface? receiveNullableExternal(); 1.173 + TestExternalInterface receiveWeakExternal(); 1.174 + TestExternalInterface? receiveWeakNullableExternal(); 1.175 + void passExternal(TestExternalInterface arg); 1.176 + void passNullableExternal(TestExternalInterface? arg); 1.177 + attribute TestExternalInterface nonNullExternal; 1.178 + attribute TestExternalInterface? nullableExternal; 1.179 + // Optional arguments 1.180 + void passOptionalExternal(optional TestExternalInterface? arg); 1.181 + void passOptionalNonNullExternal(optional TestExternalInterface arg); 1.182 + void passOptionalExternalWithDefault(optional TestExternalInterface? arg = null); 1.183 + 1.184 + // Callback interface types 1.185 + TestCallbackInterface receiveCallbackInterface(); 1.186 + TestCallbackInterface? receiveNullableCallbackInterface(); 1.187 + TestCallbackInterface receiveWeakCallbackInterface(); 1.188 + TestCallbackInterface? receiveWeakNullableCallbackInterface(); 1.189 + void passCallbackInterface(TestCallbackInterface arg); 1.190 + void passNullableCallbackInterface(TestCallbackInterface? arg); 1.191 + attribute TestCallbackInterface nonNullCallbackInterface; 1.192 + attribute TestCallbackInterface? nullableCallbackInterface; 1.193 + // Optional arguments 1.194 + void passOptionalCallbackInterface(optional TestCallbackInterface? arg); 1.195 + void passOptionalNonNullCallbackInterface(optional TestCallbackInterface arg); 1.196 + void passOptionalCallbackInterfaceWithDefault(optional TestCallbackInterface? arg = null); 1.197 + 1.198 + // Miscellaneous interface tests 1.199 + IndirectlyImplementedInterface receiveConsequentialInterface(); 1.200 + void passConsequentialInterface(IndirectlyImplementedInterface arg); 1.201 + 1.202 + // Sequence types 1.203 + [Cached, Pure] 1.204 + readonly attribute sequence<long> readonlySequence; 1.205 + [Cached, Pure] 1.206 + readonly attribute sequence<Dict> readonlySequenceOfDictionaries; 1.207 + [Cached, Pure] 1.208 + readonly attribute sequence<Dict>? readonlyNullableSequenceOfDictionaries; 1.209 + [Cached, Pure, Frozen] 1.210 + readonly attribute sequence<long> readonlyFrozenSequence; 1.211 + [Cached, Pure, Frozen] 1.212 + readonly attribute sequence<long>? readonlyFrozenNullableSequence; 1.213 + sequence<long> receiveSequence(); 1.214 + sequence<long>? receiveNullableSequence(); 1.215 + sequence<long?> receiveSequenceOfNullableInts(); 1.216 + sequence<long?>? receiveNullableSequenceOfNullableInts(); 1.217 + void passSequence(sequence<long> arg); 1.218 + void passNullableSequence(sequence<long>? arg); 1.219 + void passSequenceOfNullableInts(sequence<long?> arg); 1.220 + void passOptionalSequenceOfNullableInts(optional sequence<long?> arg); 1.221 + void passOptionalNullableSequenceOfNullableInts(optional sequence<long?>? arg); 1.222 + sequence<TestInterface> receiveCastableObjectSequence(); 1.223 + sequence<TestCallbackInterface> receiveCallbackObjectSequence(); 1.224 + sequence<TestInterface?> receiveNullableCastableObjectSequence(); 1.225 + sequence<TestCallbackInterface?> receiveNullableCallbackObjectSequence(); 1.226 + sequence<TestInterface>? receiveCastableObjectNullableSequence(); 1.227 + sequence<TestInterface?>? receiveNullableCastableObjectNullableSequence(); 1.228 + sequence<TestInterface> receiveWeakCastableObjectSequence(); 1.229 + sequence<TestInterface?> receiveWeakNullableCastableObjectSequence(); 1.230 + sequence<TestInterface>? receiveWeakCastableObjectNullableSequence(); 1.231 + sequence<TestInterface?>? receiveWeakNullableCastableObjectNullableSequence(); 1.232 + void passCastableObjectSequence(sequence<TestInterface> arg); 1.233 + void passNullableCastableObjectSequence(sequence<TestInterface?> arg); 1.234 + void passCastableObjectNullableSequence(sequence<TestInterface>? arg); 1.235 + void passNullableCastableObjectNullableSequence(sequence<TestInterface?>? arg); 1.236 + void passOptionalSequence(optional sequence<long> arg); 1.237 + void passOptionalNullableSequence(optional sequence<long>? arg); 1.238 + void passOptionalNullableSequenceWithDefaultValue(optional sequence<long>? arg = null); 1.239 + void passOptionalObjectSequence(optional sequence<TestInterface> arg); 1.240 + void passExternalInterfaceSequence(sequence<TestExternalInterface> arg); 1.241 + void passNullableExternalInterfaceSequence(sequence<TestExternalInterface?> arg); 1.242 + 1.243 + sequence<DOMString> receiveStringSequence(); 1.244 + void passStringSequence(sequence<DOMString> arg); 1.245 + 1.246 + sequence<ByteString> receiveByteStringSequence(); 1.247 + void passByteStringSequence(sequence<ByteString> arg); 1.248 + 1.249 + sequence<any> receiveAnySequence(); 1.250 + sequence<any>? receiveNullableAnySequence(); 1.251 + //XXXbz No support for sequence of sequence return values yet. 1.252 + //sequence<sequence<any>> receiveAnySequenceSequence(); 1.253 + 1.254 + sequence<object> receiveObjectSequence(); 1.255 + sequence<object?> receiveNullableObjectSequence(); 1.256 + 1.257 + void passSequenceOfSequences(sequence<sequence<long>> arg); 1.258 + //XXXbz No support for sequence of sequence return values yet. 1.259 + //sequence<sequence<long>> receiveSequenceOfSequences(); 1.260 + 1.261 + // MozMap types 1.262 + void passMozMap(MozMap<long> arg); 1.263 + void passNullableMozMap(MozMap<long>? arg); 1.264 + void passMozMapOfNullableInts(MozMap<long?> arg); 1.265 + void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg); 1.266 + void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg); 1.267 + void passCastableObjectMozMap(MozMap<TestInterface> arg); 1.268 + void passNullableCastableObjectMozMap(MozMap<TestInterface?> arg); 1.269 + void passCastableObjectNullableMozMap(MozMap<TestInterface>? arg); 1.270 + void passNullableCastableObjectNullableMozMap(MozMap<TestInterface?>? arg); 1.271 + void passOptionalMozMap(optional MozMap<long> arg); 1.272 + void passOptionalNullableMozMap(optional MozMap<long>? arg); 1.273 + void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null); 1.274 + void passOptionalObjectMozMap(optional MozMap<TestInterface> arg); 1.275 + void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg); 1.276 + void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg); 1.277 + void passStringMozMap(MozMap<DOMString> arg); 1.278 + void passByteStringMozMap(MozMap<ByteString> arg); 1.279 + void passMozMapOfMozMaps(MozMap<MozMap<long>> arg); 1.280 + MozMap<long> receiveMozMap(); 1.281 + MozMap<long>? receiveNullableMozMap(); 1.282 + MozMap<long?> receiveMozMapOfNullableInts(); 1.283 + MozMap<long?>? receiveNullableMozMapOfNullableInts(); 1.284 + //XXXbz No support for MozMap of MozMaps return values yet. 1.285 + //MozMap<MozMap<long>> receiveMozMapOfMozMaps(); 1.286 + MozMap<any> receiveAnyMozMap(); 1.287 + 1.288 + // Typed array types 1.289 + void passArrayBuffer(ArrayBuffer arg); 1.290 + void passNullableArrayBuffer(ArrayBuffer? arg); 1.291 + void passOptionalArrayBuffer(optional ArrayBuffer arg); 1.292 + void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg); 1.293 + void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null); 1.294 + void passArrayBufferView(ArrayBufferView arg); 1.295 + void passInt8Array(Int8Array arg); 1.296 + void passInt16Array(Int16Array arg); 1.297 + void passInt32Array(Int32Array arg); 1.298 + void passUint8Array(Uint8Array arg); 1.299 + void passUint16Array(Uint16Array arg); 1.300 + void passUint32Array(Uint32Array arg); 1.301 + void passUint8ClampedArray(Uint8ClampedArray arg); 1.302 + void passFloat32Array(Float32Array arg); 1.303 + void passFloat64Array(Float64Array arg); 1.304 + void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg); 1.305 + void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg); 1.306 + void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg); 1.307 + void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg); 1.308 + void passVariadicTypedArray(Float32Array... arg); 1.309 + void passVariadicNullableTypedArray(Float32Array?... arg); 1.310 + Uint8Array receiveUint8Array(); 1.311 + 1.312 + // DOMString types 1.313 + void passString(DOMString arg); 1.314 + void passNullableString(DOMString? arg); 1.315 + void passOptionalString(optional DOMString arg); 1.316 + void passOptionalStringWithDefaultValue(optional DOMString arg = "abc"); 1.317 + void passOptionalNullableString(optional DOMString? arg); 1.318 + void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null); 1.319 + void passVariadicString(DOMString... arg); 1.320 + 1.321 + // ByteString types 1.322 + void passByteString(ByteString arg); 1.323 + void passNullableByteString(ByteString? arg); 1.324 + void passOptionalByteString(optional ByteString arg); 1.325 + void passOptionalNullableByteString(optional ByteString? arg); 1.326 + void passVariadicByteString(ByteString... arg); 1.327 + 1.328 + // Enumerated types 1.329 + void passEnum(TestEnum arg); 1.330 + void passNullableEnum(TestEnum? arg); 1.331 + void passOptionalEnum(optional TestEnum arg); 1.332 + void passEnumWithDefault(optional TestEnum arg = "a"); 1.333 + void passOptionalNullableEnum(optional TestEnum? arg); 1.334 + void passOptionalNullableEnumWithDefaultValue(optional TestEnum? arg = null); 1.335 + void passOptionalNullableEnumWithDefaultValue2(optional TestEnum? arg = "a"); 1.336 + TestEnum receiveEnum(); 1.337 + TestEnum? receiveNullableEnum(); 1.338 + attribute TestEnum enumAttribute; 1.339 + readonly attribute TestEnum readonlyEnumAttribute; 1.340 + 1.341 + // Callback types 1.342 + void passCallback(TestCallback arg); 1.343 + void passNullableCallback(TestCallback? arg); 1.344 + void passOptionalCallback(optional TestCallback arg); 1.345 + void passOptionalNullableCallback(optional TestCallback? arg); 1.346 + void passOptionalNullableCallbackWithDefaultValue(optional TestCallback? arg = null); 1.347 + TestCallback receiveCallback(); 1.348 + TestCallback? receiveNullableCallback(); 1.349 + void passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg); 1.350 + void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg); 1.351 + void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null); 1.352 + 1.353 + // Any types 1.354 + void passAny(any arg); 1.355 + void passVariadicAny(any... arg); 1.356 + void passOptionalAny(optional any arg); 1.357 + void passAnyDefaultNull(optional any arg = null); 1.358 + void passSequenceOfAny(sequence<any> arg); 1.359 + void passNullableSequenceOfAny(sequence<any>? arg); 1.360 + void passOptionalSequenceOfAny(optional sequence<any> arg); 1.361 + void passOptionalNullableSequenceOfAny(optional sequence<any>? arg); 1.362 + void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null); 1.363 + void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg); 1.364 + void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg); 1.365 + void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg); 1.366 + void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg); 1.367 + void passMozMapOfAny(MozMap<any> arg); 1.368 + void passNullableMozMapOfAny(MozMap<any>? arg); 1.369 + void passOptionalMozMapOfAny(optional MozMap<any> arg); 1.370 + void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg); 1.371 + void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null); 1.372 + void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg); 1.373 + void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg); 1.374 + void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg); 1.375 + void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg); 1.376 + void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg); 1.377 + void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg); 1.378 + any receiveAny(); 1.379 + 1.380 + // object types 1.381 + void passObject(object arg); 1.382 + void passVariadicObject(object... arg); 1.383 + void passNullableObject(object? arg); 1.384 + void passVariadicNullableObject(object... arg); 1.385 + void passOptionalObject(optional object arg); 1.386 + void passOptionalNullableObject(optional object? arg); 1.387 + void passOptionalNullableObjectWithDefaultValue(optional object? arg = null); 1.388 + void passSequenceOfObject(sequence<object> arg); 1.389 + void passSequenceOfNullableObject(sequence<object?> arg); 1.390 + void passNullableSequenceOfObject(sequence<object>? arg); 1.391 + void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg); 1.392 + void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg); 1.393 + void passMozMapOfObject(MozMap<object> arg); 1.394 + object receiveObject(); 1.395 + object? receiveNullableObject(); 1.396 + 1.397 + // Union types 1.398 + void passUnion((object or long) arg); 1.399 + // Some union tests are debug-only to avoid creating all those 1.400 + // unused union types in opt builds. 1.401 +#ifdef DEBUG 1.402 + void passUnion2((long or boolean) arg); 1.403 + void passUnion3((object or long or boolean) arg); 1.404 + void passUnion4((Node or long or boolean) arg); 1.405 + void passUnion5((object or boolean) arg); 1.406 + void passUnion6((object or DOMString) arg); 1.407 + void passUnion7((object or DOMString or long) arg); 1.408 + void passUnion8((object or DOMString or boolean) arg); 1.409 + void passUnion9((object or DOMString or long or boolean) arg); 1.410 + void passUnion10(optional (EventInit or long) arg); 1.411 + void passUnion11(optional (CustomEventInit or long) arg); 1.412 + void passUnion12(optional (EventInit or long) arg = 5); 1.413 + void passUnion13(optional (object or long?) arg = null); 1.414 + void passUnion14(optional (object or long?) arg = 5); 1.415 + void passUnionWithCallback((EventHandler or long) arg); 1.416 +#endif 1.417 + void passUnionWithNullable((object? or long) arg); 1.418 + void passNullableUnion((object or long)? arg); 1.419 + void passOptionalUnion(optional (object or long) arg); 1.420 + void passOptionalNullableUnion(optional (object or long)? arg); 1.421 + void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null); 1.422 + //void passUnionWithInterfaces((TestInterface or TestExternalInterface) arg); 1.423 + //void passUnionWithInterfacesAndNullable((TestInterface? or TestExternalInterface) arg); 1.424 + //void passUnionWithSequence((sequence<object> or long) arg); 1.425 + void passUnionWithArrayBuffer((ArrayBuffer or long) arg); 1.426 + void passUnionWithString((DOMString or object) arg); 1.427 + //void passUnionWithEnum((TestEnum or object) arg); 1.428 + // Trying to use a callback in a union won't include the test 1.429 + // headers, unfortunately, so won't compile. 1.430 + // void passUnionWithCallback((TestCallback or long) arg); 1.431 + void passUnionWithObject((object or long) arg); 1.432 + //void passUnionWithDict((Dict or long) arg); 1.433 + 1.434 + void passUnionWithDefaultValue1(optional (double or DOMString) arg = ""); 1.435 + void passUnionWithDefaultValue2(optional (double or DOMString) arg = 1); 1.436 + void passUnionWithDefaultValue3(optional (double or DOMString) arg = 1.5); 1.437 + void passUnionWithDefaultValue4(optional (float or DOMString) arg = ""); 1.438 + void passUnionWithDefaultValue5(optional (float or DOMString) arg = 1); 1.439 + void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5); 1.440 + void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = ""); 1.441 + void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1); 1.442 + void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5); 1.443 + void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity); 1.444 + void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = ""); 1.445 + void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1); 1.446 + void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity); 1.447 + 1.448 + void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = ""); 1.449 + void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1); 1.450 + void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null); 1.451 + void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = ""); 1.452 + void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1); 1.453 + void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null); 1.454 + void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = ""); 1.455 + void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1); 1.456 + void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null); 1.457 + void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = ""); 1.458 + void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1); 1.459 + void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null); 1.460 + 1.461 + void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg); 1.462 + void passSequenceOfUnions2(sequence<(object or long)> arg); 1.463 + void passVariadicUnion((CanvasPattern or CanvasGradient)... arg); 1.464 + 1.465 + void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg); 1.466 + void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg); 1.467 + void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg); 1.468 + // XXXbz no move constructor on some unions 1.469 + // void passMozMapOfUnions2(MozMap<(object or long)> arg); 1.470 + 1.471 + //(CanvasPattern or CanvasGradient) receiveUnion(); 1.472 + //(object or long) receiveUnion2(); 1.473 + //(CanvasPattern? or CanvasGradient) receiveUnionContainingNull(); 1.474 + //(CanvasPattern or CanvasGradient)? receiveNullableUnion(); 1.475 + //(object or long)? receiveNullableUnion2(); 1.476 + 1.477 + //attribute (CanvasPattern or CanvasGradient) writableUnion; 1.478 + //attribute (CanvasPattern? or CanvasGradient) writableUnionContainingNull; 1.479 + //attribute (CanvasPattern or CanvasGradient)? writableNullableUnion; 1.480 + 1.481 + // Date types 1.482 + void passDate(Date arg); 1.483 + void passNullableDate(Date? arg); 1.484 + void passOptionalDate(optional Date arg); 1.485 + void passOptionalNullableDate(optional Date? arg); 1.486 + void passOptionalNullableDateWithDefaultValue(optional Date? arg = null); 1.487 + void passDateSequence(sequence<Date> arg); 1.488 + void passNullableDateSequence(sequence<Date?> arg); 1.489 + void passDateMozMap(MozMap<Date> arg); 1.490 + Date receiveDate(); 1.491 + Date? receiveNullableDate(); 1.492 + 1.493 + // binaryNames tests 1.494 + void methodRenamedFrom(); 1.495 + void methodRenamedFrom(byte argument); 1.496 + readonly attribute byte attributeGetterRenamedFrom; 1.497 + attribute byte attributeRenamedFrom; 1.498 + 1.499 + void passDictionary(optional Dict x); 1.500 + [Cached, Pure] 1.501 + readonly attribute Dict readonlyDictionary; 1.502 + [Cached, Pure] 1.503 + readonly attribute Dict? readonlyNullableDictionary; 1.504 + [Cached, Pure] 1.505 + attribute Dict writableDictionary; 1.506 + [Cached, Pure, Frozen] 1.507 + readonly attribute Dict readonlyFrozenDictionary; 1.508 + [Cached, Pure, Frozen] 1.509 + readonly attribute Dict? readonlyFrozenNullableDictionary; 1.510 + [Cached, Pure, Frozen] 1.511 + attribute Dict writableFrozenDictionary; 1.512 + Dict receiveDictionary(); 1.513 + Dict? receiveNullableDictionary(); 1.514 + void passOtherDictionary(optional GrandparentDict x); 1.515 + void passSequenceOfDictionaries(sequence<Dict> x); 1.516 + void passMozMapOfDictionaries(MozMap<GrandparentDict> x); 1.517 + // No support for nullable dictionaries inside a sequence (nor should there be) 1.518 + // void passSequenceOfNullableDictionaries(sequence<Dict?> x); 1.519 + void passDictionaryOrLong(optional Dict x); 1.520 + void passDictionaryOrLong(long x); 1.521 + 1.522 + void passDictContainingDict(optional DictContainingDict arg); 1.523 + void passDictContainingSequence(optional DictContainingSequence arg); 1.524 + DictContainingSequence receiveDictContainingSequence(); 1.525 + 1.526 + // EnforceRange/Clamp tests 1.527 + void dontEnforceRangeOrClamp(byte arg); 1.528 + void doEnforceRange([EnforceRange] byte arg); 1.529 + void doClamp([Clamp] byte arg); 1.530 + [EnforceRange] attribute byte enforcedByte; 1.531 + [Clamp] attribute byte clampedByte; 1.532 + 1.533 + // Typedefs 1.534 + const myLong myLongConstant = 5; 1.535 + void exerciseTypedefInterfaces1(AnotherNameForTestInterface arg); 1.536 + AnotherNameForTestInterface exerciseTypedefInterfaces2(NullableTestInterface arg); 1.537 + void exerciseTypedefInterfaces3(YetAnotherNameForTestInterface arg); 1.538 + 1.539 + // Static methods and attributes 1.540 + static attribute boolean staticAttribute; 1.541 + static void staticMethod(boolean arg); 1.542 + static void staticMethodWithContext(any arg); 1.543 + 1.544 + // Overload resolution tests 1.545 + //void overload1(DOMString... strs); 1.546 + boolean overload1(TestInterface arg); 1.547 + TestInterface overload1(DOMString strs, TestInterface arg); 1.548 + void overload2(TestInterface arg); 1.549 + void overload2(optional Dict arg); 1.550 + void overload2(boolean arg); 1.551 + void overload2(DOMString arg); 1.552 + void overload2(Date arg); 1.553 + void overload3(TestInterface arg); 1.554 + void overload3(TestCallback arg); 1.555 + void overload3(boolean arg); 1.556 + void overload4(TestInterface arg); 1.557 + void overload4(TestCallbackInterface arg); 1.558 + void overload4(DOMString arg); 1.559 + void overload5(long arg); 1.560 + void overload5(TestEnum arg); 1.561 + void overload6(long arg); 1.562 + void overload6(boolean arg); 1.563 + void overload7(long arg); 1.564 + void overload7(boolean arg); 1.565 + void overload7(ByteString arg); 1.566 + void overload8(long arg); 1.567 + void overload8(TestInterface arg); 1.568 + void overload9(long? arg); 1.569 + void overload9(DOMString arg); 1.570 + void overload10(long? arg); 1.571 + void overload10(object arg); 1.572 + void overload11(long arg); 1.573 + void overload11(DOMString? arg); 1.574 + void overload12(long arg); 1.575 + void overload12(boolean? arg); 1.576 + void overload13(long? arg); 1.577 + void overload13(boolean arg); 1.578 + void overload14(optional long arg); 1.579 + void overload14(TestInterface arg); 1.580 + void overload15(long arg); 1.581 + void overload15(optional TestInterface arg); 1.582 + void overload16(long arg); 1.583 + void overload16(optional TestInterface? arg); 1.584 + 1.585 + // Variadic handling 1.586 + void passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3); 1.587 + 1.588 + // Conditionally exposed methods/attributes 1.589 + [Pref="abc.def"] 1.590 + readonly attribute boolean prefable1; 1.591 + [Pref="abc.def"] 1.592 + readonly attribute boolean prefable2; 1.593 + [Pref="ghi.jkl"] 1.594 + readonly attribute boolean prefable3; 1.595 + [Pref="ghi.jkl"] 1.596 + readonly attribute boolean prefable4; 1.597 + [Pref="abc.def"] 1.598 + readonly attribute boolean prefable5; 1.599 + [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.600 + readonly attribute boolean prefable6; 1.601 + [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.602 + readonly attribute boolean prefable7; 1.603 + [Pref="ghi.jkl", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.604 + readonly attribute boolean prefable8; 1.605 + [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.606 + readonly attribute boolean prefable9; 1.607 + [Pref="abc.def"] 1.608 + void prefable10(); 1.609 + [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.610 + void prefable11(); 1.611 + [Pref="abc.def", Func="TestFuncControlledMember"] 1.612 + readonly attribute boolean prefable12; 1.613 + [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] 1.614 + void prefable13(); 1.615 + [Pref="abc.def", Func="TestFuncControlledMember"] 1.616 + readonly attribute boolean prefable14; 1.617 + [Func="TestFuncControlledMember"] 1.618 + readonly attribute boolean prefable15; 1.619 + [Func="TestFuncControlledMember"] 1.620 + readonly attribute boolean prefable16; 1.621 + [Pref="abc.def", Func="TestFuncControlledMember"] 1.622 + void prefable17(); 1.623 + [Func="TestFuncControlledMember"] 1.624 + void prefable18(); 1.625 + [Func="TestFuncControlledMember"] 1.626 + void prefable19(); 1.627 + 1.628 + // Miscellania 1.629 + [LenientThis] attribute long attrWithLenientThis; 1.630 + [Unforgeable] readonly attribute long unforgeableAttr; 1.631 + [Unforgeable, ChromeOnly] readonly attribute long unforgeableAttr2; 1.632 + stringifier; 1.633 + void passRenamedInterface(TestRenamedInterface arg); 1.634 + [PutForwards=writableByte] readonly attribute TestExampleInterface putForwardsAttr; 1.635 + [PutForwards=writableByte, LenientThis] readonly attribute TestExampleInterface putForwardsAttr2; 1.636 + [PutForwards=writableByte, ChromeOnly] readonly attribute TestExampleInterface putForwardsAttr3; 1.637 + [Throws] void throwingMethod(); 1.638 + [Throws] attribute boolean throwingAttr; 1.639 + [GetterThrows] attribute boolean throwingGetterAttr; 1.640 + [SetterThrows] attribute boolean throwingSetterAttr; 1.641 + legacycaller short(unsigned long arg1, TestInterface arg2); 1.642 + void passArgsWithDefaults(optional long arg1, 1.643 + optional TestInterface? arg2 = null, 1.644 + optional Dict arg3, optional double arg4 = 5.0, 1.645 + optional float arg5); 1.646 + attribute any jsonifierShouldSkipThis; 1.647 + attribute TestParentInterface jsonifierShouldSkipThis2; 1.648 + attribute TestCallbackInterface jsonifierShouldSkipThis3; 1.649 + jsonifier; 1.650 + 1.651 + // If you add things here, add them to TestCodeGen and TestJSImplGen as well 1.652 +}; 1.653 + 1.654 +interface TestExampleProxyInterface { 1.655 + getter long longIndexedGetter(unsigned long ix); 1.656 + deleter void (unsigned long ix); 1.657 + setter creator void longIndexedSetter(unsigned long y, long z); 1.658 + stringifier DOMString myStringifier(); 1.659 + getter short shortNameGetter(DOMString nom); 1.660 + deleter void (DOMString nomnom); 1.661 + setter creator void shortNamedSetter(DOMString me, short value); 1.662 +};