OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary formstrArg, with or without | 5 * Redistribution and use in source and binary formstrArg, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 16 matching lines...) Expand all Loading... |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 // This IDL file is for testing the bindings code generator and for tracking | 30 // This IDL file is for testing the bindings code generator and for tracking |
31 // changes in its ouput. | 31 // changes in its ouput. |
32 | 32 |
33 enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" }; | 33 enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" }; |
34 | 34 |
35 [ | 35 [ |
36 Constructor(TestCallback testCallback), | 36 Constructor(TestCallback testCallback), |
37 InterfaceName=TestObject | 37 ImplementedAs=TestObj |
38 ] interface TestObj { | 38 ] interface TestObject { |
39 // Attributes | 39 // Attributes |
40 readonly attribute long readOnlyLongAttr; | 40 readonly attribute long readOnlyLongAttr; |
41 readonly attribute DOMString readOnlyStringAttr; | 41 readonly attribute DOMString readOnlyStringAttr; |
42 readonly attribute TestObj readOnlyTestObjAttr; | 42 readonly attribute TestObject readOnlyTestObjectAttr; |
43 static readonly attribute long staticReadOnlyLongAttr; | 43 static readonly attribute long staticReadOnlyLongAttr; |
44 static attribute DOMString staticStringAttr; | 44 static attribute DOMString staticStringAttr; |
45 static readonly attribute TestSubObjConstructor TestSubObj; | 45 static readonly attribute TestSubObjConstructor TestSubObj; |
46 attribute TestEnumType enumAttr; | 46 attribute TestEnumType enumAttr; |
47 readonly attribute TestEnumType readOnlyEnumAttr; | 47 readonly attribute TestEnumType readOnlyEnumAttr; |
48 attribute short shortAttr; | 48 attribute short shortAttr; |
49 attribute unsigned short unsignedShortAttr; | 49 attribute unsigned short unsignedShortAttr; |
50 attribute long longAttr; | 50 attribute long longAttr; |
51 attribute long long longLongAttr; | 51 attribute long long longLongAttr; |
52 attribute unsigned long long unsignedLongLongAttr; | 52 attribute unsigned long long unsignedLongLongAttr; |
53 attribute DOMString stringAttr; | 53 attribute DOMString stringAttr; |
54 [MeasureAs=TestFeature] attribute TestObj testObjAttr; | 54 [MeasureAs=TestFeature] attribute TestObject testObjAttr; |
55 | 55 |
56 // WK_ucfirst, WK_lcfirst exceptional cases. | 56 // WK_ucfirst, WK_lcfirst exceptional cases. |
57 attribute TestObj XMLObjAttr; | 57 attribute TestObject XMLObjAttr; |
58 attribute boolean create; | 58 attribute boolean create; |
59 | 59 |
60 // Reflected DOM attributes | 60 // Reflected DOM attributes |
61 [Reflect] attribute DOMString reflectedStringAttr; | 61 [Reflect] attribute DOMString reflectedStringAttr; |
62 [Reflect] attribute long reflectedIntegralAttr; | 62 [Reflect] attribute long reflectedIntegralAttr; |
63 [Reflect] attribute unsigned long reflectedUnsignedIntegralAttr; | 63 [Reflect] attribute unsigned long reflectedUnsignedIntegralAttr; |
64 [Reflect] attribute boolean reflectedBooleanAttr; | 64 [Reflect] attribute boolean reflectedBooleanAttr; |
65 [Reflect, URL] attribute DOMString reflectedURLAttr; | 65 [Reflect, URL] attribute DOMString reflectedURLAttr; |
66 [Reflect=customContentStringAttr] attribute DOMString reflectedStringAttr; | 66 [Reflect=customContentStringAttr] attribute DOMString reflectedStringAttr; |
67 [Reflect=customContentIntegralAttr] attribute long reflectedCustomIntegralAt
tr; | 67 [Reflect=customContentIntegralAttr] attribute long reflectedCustomIntegralAt
tr; |
68 [Reflect=customContentBooleanAttr] attribute boolean reflectedCustomBooleanA
ttr; | 68 [Reflect=customContentBooleanAttr] attribute boolean reflectedCustomBooleanA
ttr; |
69 [Reflect=customContentURLAttr, URL] attribute DOMString reflectedCustomURLAt
tr; | 69 [Reflect=customContentURLAttr, URL] attribute DOMString reflectedCustomURLAt
tr; |
70 | 70 |
71 // TypedArray attribute | 71 // TypedArray attribute |
72 attribute Float32Array typedArrayAttr; | 72 attribute Float32Array typedArrayAttr; |
73 | 73 |
74 // Methods | 74 // Methods |
75 void voidMethod(); | 75 void voidMethod(); |
76 void voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | 76 void voidMethodWithArgs(long longArg, DOMString strArg, TestObject objArg
); |
77 long longMethod(); | 77 long longMethod(); |
78 long longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | 78 long longMethodWithArgs(long longArg, DOMString strArg, TestObject objArg
); |
79 [MeasureAs=TestFeature] TestObj objMethod(); | 79 [MeasureAs=TestFeature] TestObject objMethod(); |
80 TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | 80 TestObject objMethodWithArgs(long longArg, DOMString strArg, TestObject objA
rg); |
81 | 81 |
82 void methodWithSequenceArg(sequence<ScriptProfile> sequenceArg); | 82 void methodWithSequenceArg(sequence<ScriptProfile> sequenceArg); |
83 sequence<ScriptProfile> methodReturningSequence(long longArg); | 83 sequence<ScriptProfile> methodReturningSequence(long longArg); |
84 | 84 |
85 void methodWithEnumArg(TestEnumType enumArg); | 85 void methodWithEnumArg(TestEnumType enumArg); |
86 [RaisesException] TestObj methodThatRequiresAllArgsAndThrows(DOMString strAr
g, TestObj objArg); | 86 [RaisesException] TestObject methodThatRequiresAllArgsAndThrows(DOMString st
rArg, TestObject objArg); |
87 | 87 |
88 void serializedValue(SerializedScriptValue serializedArg); | 88 void serializedValue(SerializedScriptValue serializedArg); |
89 void optionsObject(Dictionary oo, optional Dictionary ooo); | 89 void optionsObject(Dictionary oo, optional Dictionary ooo); |
90 | 90 |
91 // Indexed/named properties | 91 // Indexed/named properties |
92 [ImplementedAs=item] getter Node(unsigned long index); | 92 [ImplementedAs=item] getter Node(unsigned long index); |
93 | 93 |
94 // Exceptions | 94 // Exceptions |
95 [RaisesException] void methodWithException(); | 95 [RaisesException] void methodWithException(); |
96 [GetterRaisesException] attribute long attrWithGetterException; | 96 [GetterRaisesException] attribute long attrWithGetterException; |
97 [SetterRaisesException] attribute long attrWithSetterException; | 97 [SetterRaisesException] attribute long attrWithSetterException; |
98 [GetterRaisesException] attribute DOMString stringAttrWithGetterException; | 98 [GetterRaisesException] attribute DOMString stringAttrWithGetterException; |
99 [SetterRaisesException] attribute DOMString stringAttrWithSetterException; | 99 [SetterRaisesException] attribute DOMString stringAttrWithSetterException; |
100 | 100 |
101 // 'Custom' extended attribute | 101 // 'Custom' extended attribute |
102 [Custom] attribute long customAttr; | 102 [Custom] attribute long customAttr; |
103 [Custom, MeasureAs=CustomTestFeature] void customMethod(); | 103 [Custom, MeasureAs=CustomTestFeature] void customMethod(); |
104 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObj o
bjArg); | 104 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObjec
t objArg); |
105 | 105 |
106 void addEventListener(DOMString type, | 106 void addEventListener(DOMString type, |
107 EventListener listener, | 107 EventListener listener, |
108 optional boolean useCapture); | 108 optional boolean useCapture); |
109 void removeEventListener(DOMString type, | 109 void removeEventListener(DOMString type, |
110 EventListener listener, | 110 EventListener listener, |
111 optional boolean useCapture); | 111 optional boolean useCapture); |
112 | 112 |
113 // 'CallWith' extended attribute | 113 // 'CallWith' extended attribute |
114 [CallWith=ScriptState] void withScriptStateVoid(); | 114 [CallWith=ScriptState] void withScriptStateVoid(); |
115 [CallWith=ScriptState] TestObj withScriptStateObj(); | 115 [CallWith=ScriptState] TestObject withScriptStateObj(); |
116 [CallWith=ScriptState, RaisesException] void withScriptStateVoidException(); | 116 [CallWith=ScriptState, RaisesException] void withScriptStateVoidException(); |
117 [CallWith=ScriptState, RaisesException] TestObj withScriptStateObjException(
); | 117 [CallWith=ScriptState, RaisesException] TestObject withScriptStateObjExcepti
on(); |
118 [CallWith=ScriptExecutionContext] void withScriptExecutionContext(); | 118 [CallWith=ScriptExecutionContext] void withScriptExecutionContext(); |
119 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex
tAndScriptState(); | 119 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex
tAndScriptState(); |
120 [CallWith=ScriptExecutionContext|ScriptState, RaisesException] TestObj withS
criptExecutionContextAndScriptStateObjException(); | 120 [CallWith=ScriptExecutionContext|ScriptState, RaisesException] TestObject wi
thScriptExecutionContextAndScriptStateObjException(); |
121 [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExec
utionContextAndScriptStateWithSpaces(); | 121 [CallWith= ScriptExecutionContext | ScriptState ] TestObject withScriptE
xecutionContextAndScriptStateWithSpaces(); |
122 | 122 |
123 [CallWith=ScriptState] attribute long withScriptStateAttribute; | 123 [CallWith=ScriptState] attribute long withScriptStateAttribute; |
124 [CallWith=ScriptExecutionContext] attribute TestObj withScriptExecutionConte
xtAttribute; | 124 [CallWith=ScriptExecutionContext] attribute TestObject withScriptExecutionCo
ntextAttribute; |
125 [CallWith=ScriptState, GetterRaisesException] attribute TestObj withScriptSt
ateAttributeRaises; | 125 [CallWith=ScriptState, GetterRaisesException] attribute TestObject withScrip
tStateAttributeRaises; |
126 [CallWith=ScriptExecutionContext, GetterRaisesException] attribute TestObj w
ithScriptExecutionContextAttributeRaises; | 126 [CallWith=ScriptExecutionContext, GetterRaisesException] attribute TestObjec
t withScriptExecutionContextAttributeRaises; |
127 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObj withScriptEx
ecutionContextAndScriptStateAttribute; | 127 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObject withScrip
tExecutionContextAndScriptStateAttribute; |
128 [CallWith=ScriptExecutionContext|ScriptState, GetterRaisesException] attribu
te TestObj withScriptExecutionContextAndScriptStateAttributeRaises; | 128 [CallWith=ScriptExecutionContext|ScriptState, GetterRaisesException] attribu
te TestObject withScriptExecutionContextAndScriptStateAttributeRaises; |
129 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObj with
ScriptExecutionContextAndScriptStateWithSpacesAttribute; | 129 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObject w
ithScriptExecutionContextAndScriptStateWithSpacesAttribute; |
130 | 130 |
131 // optional parameters | 131 // optional parameters |
132 void methodWithOptionalArg(optional long opt); | 132 void methodWithOptionalArg(optional long opt); |
133 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long op
t); | 133 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long op
t); |
134 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional lon
g opt1, optional long opt2); | 134 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional lon
g opt1, optional long opt2); |
135 void methodWithOptionalString(optional DOMString str); | 135 void methodWithOptionalString(optional DOMString str); |
136 void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOM
String str); | 136 void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOM
String str); |
137 void methodWithOptionalStringIsNullString([Default=NullString] optional D
OMString str); | 137 void methodWithOptionalStringIsNullString([Default=NullString] optional D
OMString str); |
138 | 138 |
139 // Callback parameters | 139 // Callback parameters |
(...skipping 18 matching lines...) Expand all Loading... |
158 // 'Conditional' extended attribute | 158 // 'Conditional' extended attribute |
159 [Conditional=Condition1] attribute long conditionalAttr1; | 159 [Conditional=Condition1] attribute long conditionalAttr1; |
160 [Conditional=Condition1&Condition2] attribute long conditionalAttr2; | 160 [Conditional=Condition1&Condition2] attribute long conditionalAttr2; |
161 [Conditional=Condition1|Condition2] attribute long conditionalAttr3; | 161 [Conditional=Condition1|Condition2] attribute long conditionalAttr3; |
162 | 162 |
163 // 'Conditional' extended method | 163 // 'Conditional' extended method |
164 [Conditional=Condition1] DOMString conditionalMethod1(); | 164 [Conditional=Condition1] DOMString conditionalMethod1(); |
165 [Conditional=Condition1&Condition2] void conditionalMethod2(); | 165 [Conditional=Condition1&Condition2] void conditionalMethod2(); |
166 [Conditional=Condition1|Condition2] void conditionalMethod3(); | 166 [Conditional=Condition1|Condition2] void conditionalMethod3(); |
167 | 167 |
168 [Conditional=Condition1] attribute TestObjectAConstructor conditionalAttr4; | 168 [Conditional=Condition1] attribute TestObjectectAConstructor conditionalAttr
4; |
169 [Conditional=Condition1&Condition2] attribute TestObjectBConstructor conditi
onalAttr5; | 169 [Conditional=Condition1&Condition2] attribute TestObjectectBConstructor cond
itionalAttr5; |
170 [Conditional=Condition1|Condition2] attribute TestObjectCConstructor conditi
onalAttr6; | 170 [Conditional=Condition1|Condition2] attribute TestObjectectCConstructor cond
itionalAttr6; |
171 | 171 |
172 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; | 172 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; |
173 | 173 |
174 [CachedAttribute] readonly attribute any cachedAttribute1; | 174 [CachedAttribute] readonly attribute any cachedAttribute1; |
175 [CachedAttribute] readonly attribute any cachedAttribute2; | 175 [CachedAttribute] readonly attribute any cachedAttribute2; |
176 | 176 |
177 attribute any anyAttribute; | 177 attribute any anyAttribute; |
178 | 178 |
179 // Overloads | 179 // Overloads |
180 void overloadedMethod(TestObj? objArg, [StrictTypeChecking] DOMString str
Arg); | 180 void overloadedMethod(TestObject? objArg, [StrictTypeChecking] DOMString
strArg); |
181 void overloadedMethod(TestObj? objArg, optional long longArg); | 181 void overloadedMethod(TestObject? objArg, optional long longArg); |
182 void overloadedMethod([StrictTypeChecking] DOMString strArg); | 182 void overloadedMethod([StrictTypeChecking] DOMString strArg); |
183 void overloadedMethod(long longArg); | 183 void overloadedMethod(long longArg); |
184 void overloadedMethod(TestCallback callback); | 184 void overloadedMethod(TestCallback callback); |
185 void overloadedMethod(DOMStringList? listArg); | 185 void overloadedMethod(DOMStringList? listArg); |
186 void overloadedMethod(DOMString[]? arrayArg); | 186 void overloadedMethod(DOMString[]? arrayArg); |
187 void overloadedMethod(TestObj objArg); | 187 void overloadedMethod(TestObject objArg); |
188 void overloadedMethod(DOMString[] arrayArg); | 188 void overloadedMethod(DOMString[] arrayArg); |
189 void overloadedMethod(sequence<unsigned long> arrayArg); | 189 void overloadedMethod(sequence<unsigned long> arrayArg); |
190 void overloadedMethod(DOMString strArg); | 190 void overloadedMethod(DOMString strArg); |
191 | 191 |
192 // Class methods within JavaScript (like what's used for IDBKeyRange). | 192 // Class methods within JavaScript (like what's used for IDBKeyRange). |
193 static void classMethod(); | 193 static void classMethod(); |
194 static long classMethodWithOptional(optional long arg); | 194 static long classMethodWithOptional(optional long arg); |
195 [Custom] static void classMethod2(long arg); | 195 [Custom] static void classMethod2(long arg); |
196 | 196 |
197 // Static method with conditional on overloaded methods | 197 // Static method with conditional on overloaded methods |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Nullable attributes. | 265 // Nullable attributes. |
266 readonly attribute double? nullableDoubleAttribute; | 266 readonly attribute double? nullableDoubleAttribute; |
267 readonly attribute long? nullableLongAttribute; | 267 readonly attribute long? nullableLongAttribute; |
268 readonly attribute boolean? nullableBooleanAttribute; | 268 readonly attribute boolean? nullableBooleanAttribute; |
269 readonly attribute DOMString? nullableStringAttribute; | 269 readonly attribute DOMString? nullableStringAttribute; |
270 | 270 |
271 attribute long? nullableLongSettableAttribute; | 271 attribute long? nullableLongSettableAttribute; |
272 | 272 |
273 [GetterRaisesException] attribute long? nullableStringValue; | 273 [GetterRaisesException] attribute long? nullableStringValue; |
274 | 274 |
275 [PerWorldBindings] readonly attribute TestObj perWorldReadOnlyAttribute; | 275 [PerWorldBindings] readonly attribute TestObject perWorldReadOnlyAttribute; |
276 [PerWorldBindings] attribute TestObj perWorldAttribute; | 276 [PerWorldBindings] attribute TestObject perWorldAttribute; |
277 [PerWorldBindings] void perWorldMethod(); | 277 [PerWorldBindings] void perWorldMethod(); |
278 [PerWorldBindings] void overloadedPerWorldMethod(long longArg); | 278 [PerWorldBindings] void overloadedPerWorldMethod(long longArg); |
279 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long
Arg); | 279 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long
Arg); |
280 | 280 |
281 [ActivityLog=Access] void activityLoggedMethod1(long longArg); | 281 [ActivityLog=Access] void activityLoggedMethod1(long longArg); |
282 [PerWorldBindings, ActivityLog=Access] void activityLoggedMethod2(long longA
rg); | 282 [PerWorldBindings, ActivityLog=Access] void activityLoggedMethod2(long longA
rg); |
283 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] void activityLoggedI
nIsolatedWorldMethod(long longArg); | 283 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] void activityLoggedI
nIsolatedWorldMethod(long longArg); |
284 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(l
ong longArg); | 284 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(l
ong longArg); |
285 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(D
OMString strArg, long longArg); | 285 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(D
OMString strArg, long longArg); |
286 [ActivityLog=Access] attribute long activityLoggedAttr1; | 286 [ActivityLog=Access] attribute long activityLoggedAttr1; |
(...skipping 10 matching lines...) Expand all Loading... |
297 [DeprecateAs=StaticReadonlyAttribute] static readonly attribute long depreca
tedStaticReadOnlyAttr; | 297 [DeprecateAs=StaticReadonlyAttribute] static readonly attribute long depreca
tedStaticReadOnlyAttr; |
298 [DeprecateAs=StaticAttribute] static attribute long deprecatedStaticAttr; | 298 [DeprecateAs=StaticAttribute] static attribute long deprecatedStaticAttr; |
299 [DeprecateAs=ReadonlyAttribute] readonly attribute long deprecatedReadonlyAt
tr; | 299 [DeprecateAs=ReadonlyAttribute] readonly attribute long deprecatedReadonlyAt
tr; |
300 [DeprecateAs=Attribute] attribute long deprecatedAttr; | 300 [DeprecateAs=Attribute] attribute long deprecatedAttr; |
301 | 301 |
302 [DeprecateAs=Method] void deprecatedMethod(); | 302 [DeprecateAs=Method] void deprecatedMethod(); |
303 [DeprecateAs=StaticMethod] static void deprecatedStaticMethod(); | 303 [DeprecateAs=StaticMethod] static void deprecatedStaticMethod(); |
304 | 304 |
305 [DeprecateAs=Constant] const unsigned short DEPRECATED_CONSTANT = 1; | 305 [DeprecateAs=Constant] const unsigned short DEPRECATED_CONSTANT = 1; |
306 }; | 306 }; |
OLD | NEW |