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 getter DOMString namedItem(DOMString name); | 93 getter DOMString namedItem(DOMString name); |
94 | 94 |
95 // Exceptions | 95 // Exceptions |
96 [RaisesException] void methodWithException(); | 96 [RaisesException] void methodWithException(); |
97 [GetterRaisesException] attribute long attrWithGetterException; | 97 [GetterRaisesException] attribute long attrWithGetterException; |
98 [SetterRaisesException] attribute long attrWithSetterException; | 98 [SetterRaisesException] attribute long attrWithSetterException; |
99 [GetterRaisesException] attribute DOMString stringAttrWithGetterException; | 99 [GetterRaisesException] attribute DOMString stringAttrWithGetterException; |
100 [SetterRaisesException] attribute DOMString stringAttrWithSetterException; | 100 [SetterRaisesException] attribute DOMString stringAttrWithSetterException; |
101 | 101 |
102 // 'Custom' extended attribute | 102 // 'Custom' extended attribute |
103 [Custom] attribute long customAttr; | 103 [Custom] attribute long customAttr; |
104 [Custom, MeasureAs=CustomTestFeature] void customMethod(); | 104 [Custom, MeasureAs=CustomTestFeature] void customMethod(); |
105 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObj o
bjArg); | 105 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObjec
t objArg); |
106 | 106 |
107 void addEventListener(DOMString type, | 107 void addEventListener(DOMString type, |
108 EventListener listener, | 108 EventListener listener, |
109 optional boolean useCapture); | 109 optional boolean useCapture); |
110 void removeEventListener(DOMString type, | 110 void removeEventListener(DOMString type, |
111 EventListener listener, | 111 EventListener listener, |
112 optional boolean useCapture); | 112 optional boolean useCapture); |
113 | 113 |
114 // 'CallWith' extended attribute | 114 // 'CallWith' extended attribute |
115 [CallWith=ScriptState] void withScriptStateVoid(); | 115 [CallWith=ScriptState] void withScriptStateVoid(); |
116 [CallWith=ScriptState] TestObj withScriptStateObj(); | 116 [CallWith=ScriptState] TestObject withScriptStateObj(); |
117 [CallWith=ScriptState, RaisesException] void withScriptStateVoidException(); | 117 [CallWith=ScriptState, RaisesException] void withScriptStateVoidException(); |
118 [CallWith=ScriptState, RaisesException] TestObj withScriptStateObjException(
); | 118 [CallWith=ScriptState, RaisesException] TestObject withScriptStateObjExcepti
on(); |
119 [CallWith=ScriptExecutionContext] void withScriptExecutionContext(); | 119 [CallWith=ScriptExecutionContext] void withScriptExecutionContext(); |
120 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex
tAndScriptState(); | 120 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex
tAndScriptState(); |
121 [CallWith=ScriptExecutionContext|ScriptState, RaisesException] TestObj withS
criptExecutionContextAndScriptStateObjException(); | 121 [CallWith=ScriptExecutionContext|ScriptState, RaisesException] TestObject wi
thScriptExecutionContextAndScriptStateObjException(); |
122 [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExec
utionContextAndScriptStateWithSpaces(); | 122 [CallWith= ScriptExecutionContext | ScriptState ] TestObject withScriptE
xecutionContextAndScriptStateWithSpaces(); |
123 | 123 |
124 [CallWith=ScriptState] attribute long withScriptStateAttribute; | 124 [CallWith=ScriptState] attribute long withScriptStateAttribute; |
125 [CallWith=ScriptExecutionContext] attribute TestObj withScriptExecutionConte
xtAttribute; | 125 [CallWith=ScriptExecutionContext] attribute TestObject withScriptExecutionCo
ntextAttribute; |
126 [CallWith=ScriptState, GetterRaisesException] attribute TestObj withScriptSt
ateAttributeRaises; | 126 [CallWith=ScriptState, GetterRaisesException] attribute TestObject withScrip
tStateAttributeRaises; |
127 [CallWith=ScriptExecutionContext, GetterRaisesException] attribute TestObj w
ithScriptExecutionContextAttributeRaises; | 127 [CallWith=ScriptExecutionContext, GetterRaisesException] attribute TestObjec
t withScriptExecutionContextAttributeRaises; |
128 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObj withScriptEx
ecutionContextAndScriptStateAttribute; | 128 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObject withScrip
tExecutionContextAndScriptStateAttribute; |
129 [CallWith=ScriptExecutionContext|ScriptState, GetterRaisesException] attribu
te TestObj withScriptExecutionContextAndScriptStateAttributeRaises; | 129 [CallWith=ScriptExecutionContext|ScriptState, GetterRaisesException] attribu
te TestObject withScriptExecutionContextAndScriptStateAttributeRaises; |
130 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObj with
ScriptExecutionContextAndScriptStateWithSpacesAttribute; | 130 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObject w
ithScriptExecutionContextAndScriptStateWithSpacesAttribute; |
131 | 131 |
132 // optional parameters | 132 // optional parameters |
133 void methodWithOptionalArg(optional long opt); | 133 void methodWithOptionalArg(optional long opt); |
134 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long op
t); | 134 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long op
t); |
135 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional lon
g opt1, optional long opt2); | 135 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional lon
g opt1, optional long opt2); |
136 void methodWithOptionalString(optional DOMString str); | 136 void methodWithOptionalString(optional DOMString str); |
137 void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOM
String str); | 137 void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOM
String str); |
138 void methodWithOptionalStringIsNullString([Default=NullString] optional D
OMString str); | 138 void methodWithOptionalStringIsNullString([Default=NullString] optional D
OMString str); |
139 | 139 |
140 // Callback parameters | 140 // Callback parameters |
(...skipping 18 matching lines...) Expand all Loading... |
159 // 'Conditional' extended attribute | 159 // 'Conditional' extended attribute |
160 [Conditional=Condition1] attribute long conditionalAttr1; | 160 [Conditional=Condition1] attribute long conditionalAttr1; |
161 [Conditional=Condition1&Condition2] attribute long conditionalAttr2; | 161 [Conditional=Condition1&Condition2] attribute long conditionalAttr2; |
162 [Conditional=Condition1|Condition2] attribute long conditionalAttr3; | 162 [Conditional=Condition1|Condition2] attribute long conditionalAttr3; |
163 | 163 |
164 // 'Conditional' extended method | 164 // 'Conditional' extended method |
165 [Conditional=Condition1] DOMString conditionalMethod1(); | 165 [Conditional=Condition1] DOMString conditionalMethod1(); |
166 [Conditional=Condition1&Condition2] void conditionalMethod2(); | 166 [Conditional=Condition1&Condition2] void conditionalMethod2(); |
167 [Conditional=Condition1|Condition2] void conditionalMethod3(); | 167 [Conditional=Condition1|Condition2] void conditionalMethod3(); |
168 | 168 |
169 [Conditional=Condition1] attribute TestObjectAConstructor conditionalAttr4; | 169 [Conditional=Condition1] attribute TestObjectectAConstructor conditionalAttr
4; |
170 [Conditional=Condition1&Condition2] attribute TestObjectBConstructor conditi
onalAttr5; | 170 [Conditional=Condition1&Condition2] attribute TestObjectectBConstructor cond
itionalAttr5; |
171 [Conditional=Condition1|Condition2] attribute TestObjectCConstructor conditi
onalAttr6; | 171 [Conditional=Condition1|Condition2] attribute TestObjectectCConstructor cond
itionalAttr6; |
172 | 172 |
173 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; | 173 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; |
174 | 174 |
175 [CachedAttribute] readonly attribute any cachedAttribute1; | 175 [CachedAttribute] readonly attribute any cachedAttribute1; |
176 [CachedAttribute] readonly attribute any cachedAttribute2; | 176 [CachedAttribute] readonly attribute any cachedAttribute2; |
177 | 177 |
178 attribute any anyAttribute; | 178 attribute any anyAttribute; |
179 | 179 |
180 // Overloads | 180 // Overloads |
181 void overloadedMethod(TestObj? objArg, [StrictTypeChecking] DOMString str
Arg); | 181 void overloadedMethod(TestObject? objArg, [StrictTypeChecking] DOMString
strArg); |
182 void overloadedMethod(TestObj? objArg, optional long longArg); | 182 void overloadedMethod(TestObject? objArg, optional long longArg); |
183 void overloadedMethod([StrictTypeChecking] DOMString strArg); | 183 void overloadedMethod([StrictTypeChecking] DOMString strArg); |
184 void overloadedMethod(long longArg); | 184 void overloadedMethod(long longArg); |
185 void overloadedMethod(TestCallback callback); | 185 void overloadedMethod(TestCallback callback); |
186 void overloadedMethod(DOMStringList? listArg); | 186 void overloadedMethod(DOMStringList? listArg); |
187 void overloadedMethod(DOMString[]? arrayArg); | 187 void overloadedMethod(DOMString[]? arrayArg); |
188 void overloadedMethod(TestObj objArg); | 188 void overloadedMethod(TestObject objArg); |
189 void overloadedMethod(DOMString[] arrayArg); | 189 void overloadedMethod(DOMString[] arrayArg); |
190 void overloadedMethod(sequence<unsigned long> arrayArg); | 190 void overloadedMethod(sequence<unsigned long> arrayArg); |
191 void overloadedMethod(DOMString strArg); | 191 void overloadedMethod(DOMString strArg); |
192 | 192 |
193 // Class methods within JavaScript (like what's used for IDBKeyRange). | 193 // Class methods within JavaScript (like what's used for IDBKeyRange). |
194 static void classMethod(); | 194 static void classMethod(); |
195 static long classMethodWithOptional(optional long arg); | 195 static long classMethodWithOptional(optional long arg); |
196 [Custom] static void classMethod2(long arg); | 196 [Custom] static void classMethod2(long arg); |
197 | 197 |
198 // Static method with conditional on overloaded methods | 198 // Static method with conditional on overloaded methods |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Nullable attributes. | 266 // Nullable attributes. |
267 readonly attribute double? nullableDoubleAttribute; | 267 readonly attribute double? nullableDoubleAttribute; |
268 readonly attribute long? nullableLongAttribute; | 268 readonly attribute long? nullableLongAttribute; |
269 readonly attribute boolean? nullableBooleanAttribute; | 269 readonly attribute boolean? nullableBooleanAttribute; |
270 readonly attribute DOMString? nullableStringAttribute; | 270 readonly attribute DOMString? nullableStringAttribute; |
271 | 271 |
272 attribute long? nullableLongSettableAttribute; | 272 attribute long? nullableLongSettableAttribute; |
273 | 273 |
274 [GetterRaisesException] attribute long? nullableStringValue; | 274 [GetterRaisesException] attribute long? nullableStringValue; |
275 | 275 |
276 [PerWorldBindings] readonly attribute TestObj perWorldReadOnlyAttribute; | 276 [PerWorldBindings] readonly attribute TestObject perWorldReadOnlyAttribute; |
277 [PerWorldBindings] attribute TestObj perWorldAttribute; | 277 [PerWorldBindings] attribute TestObject perWorldAttribute; |
278 [PerWorldBindings] void perWorldMethod(); | 278 [PerWorldBindings] void perWorldMethod(); |
279 [PerWorldBindings] void overloadedPerWorldMethod(long longArg); | 279 [PerWorldBindings] void overloadedPerWorldMethod(long longArg); |
280 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long
Arg); | 280 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long
Arg); |
281 | 281 |
282 [ActivityLog=Access] void activityLoggedMethod1(long longArg); | 282 [ActivityLog=Access] void activityLoggedMethod1(long longArg); |
283 [PerWorldBindings, ActivityLog=Access] void activityLoggedMethod2(long longA
rg); | 283 [PerWorldBindings, ActivityLog=Access] void activityLoggedMethod2(long longA
rg); |
284 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] void activityLoggedI
nIsolatedWorldMethod(long longArg); | 284 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] void activityLoggedI
nIsolatedWorldMethod(long longArg); |
285 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(l
ong longArg); | 285 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(l
ong longArg); |
286 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(D
OMString strArg, long longArg); | 286 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(D
OMString strArg, long longArg); |
287 [ActivityLog=Access] attribute long activityLoggedAttr1; | 287 [ActivityLog=Access] attribute long activityLoggedAttr1; |
(...skipping 10 matching lines...) Expand all Loading... |
298 [DeprecateAs=StaticReadonlyAttribute] static readonly attribute long depreca
tedStaticReadOnlyAttr; | 298 [DeprecateAs=StaticReadonlyAttribute] static readonly attribute long depreca
tedStaticReadOnlyAttr; |
299 [DeprecateAs=StaticAttribute] static attribute long deprecatedStaticAttr; | 299 [DeprecateAs=StaticAttribute] static attribute long deprecatedStaticAttr; |
300 [DeprecateAs=ReadonlyAttribute] readonly attribute long deprecatedReadonlyAt
tr; | 300 [DeprecateAs=ReadonlyAttribute] readonly attribute long deprecatedReadonlyAt
tr; |
301 [DeprecateAs=Attribute] attribute long deprecatedAttr; | 301 [DeprecateAs=Attribute] attribute long deprecatedAttr; |
302 | 302 |
303 [DeprecateAs=Method] void deprecatedMethod(); | 303 [DeprecateAs=Method] void deprecatedMethod(); |
304 [DeprecateAs=StaticMethod] static void deprecatedStaticMethod(); | 304 [DeprecateAs=StaticMethod] static void deprecatedStaticMethod(); |
305 | 305 |
306 [DeprecateAs=Constant] const unsigned short DEPRECATED_CONSTANT = 1; | 306 [DeprecateAs=Constant] const unsigned short DEPRECATED_CONSTANT = 1; |
307 }; | 307 }; |
OLD | NEW |