Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: Source/bindings/tests/idls/TestObj.idl

Issue 14882009: Remove DOM prefix from several IDL interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary formstrArg, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
15 * its contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIE D
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 // This IDL file is for testing the bindings code generator and for tracking
31 // changes in its ouput.
32
33 enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" };
34
35 [
36 Constructor(TestCallback testCallback),
37 InterfaceName=TestObject
38 ] interface TestObj {
39 // Attributes
40 readonly attribute long readOnlyLongAttr;
41 readonly attribute DOMString readOnlyStringAttr;
42 readonly attribute TestObj readOnlyTestObjAttr;
43 static readonly attribute long staticReadOnlyLongAttr;
44 static attribute DOMString staticStringAttr;
45 static readonly attribute TestSubObjConstructor TestSubObj;
46 attribute TestEnumType enumAttr;
47 readonly attribute TestEnumType readOnlyEnumAttr;
48 attribute short shortAttr;
49 attribute unsigned short unsignedShortAttr;
50 attribute long longAttr;
51 attribute long long longLongAttr;
52 attribute unsigned long long unsignedLongLongAttr;
53 attribute DOMString stringAttr;
54 [MeasureAs=TestFeature] attribute TestObj testObjAttr;
55
56 // WK_ucfirst, WK_lcfirst exceptional cases.
57 attribute TestObj XMLObjAttr;
58 attribute boolean create;
59
60 // Reflected DOM attributes
61 [Reflect] attribute DOMString reflectedStringAttr;
62 [Reflect] attribute long reflectedIntegralAttr;
63 [Reflect] attribute unsigned long reflectedUnsignedIntegralAttr;
64 [Reflect] attribute boolean reflectedBooleanAttr;
65 [Reflect, URL] attribute DOMString reflectedURLAttr;
66 [Reflect=customContentStringAttr] attribute DOMString reflectedStringAttr;
67 [Reflect=customContentIntegralAttr] attribute long reflectedCustomIntegralAt tr;
68 [Reflect=customContentBooleanAttr] attribute boolean reflectedCustomBooleanA ttr;
69 [Reflect=customContentURLAttr, URL] attribute DOMString reflectedCustomURLAt tr;
70
71 // TypedArray attribute
72 attribute Float32Array typedArrayAttr;
73
74 // Methods
75 void voidMethod();
76 void voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
77 long longMethod();
78 long longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
79 [MeasureAs=TestFeature] TestObj objMethod();
80 TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
81
82 void methodWithSequenceArg(sequence<ScriptProfile> sequenceArg);
83 sequence<ScriptProfile> methodReturningSequence(long longArg);
84
85 void methodWithEnumArg(TestEnumType enumArg);
86 [RaisesException] TestObj methodThatRequiresAllArgsAndThrows(DOMString strAr g, TestObj objArg);
87
88 void serializedValue(SerializedScriptValue serializedArg);
89 void optionsObject(Dictionary oo, optional Dictionary ooo);
90
91 // Indexed/named properties
92 [ImplementedAs=item] getter Node(unsigned long index);
93
94 // Exceptions
95 [RaisesException] void methodWithException();
96 [GetterRaisesException] attribute long attrWithGetterException;
97 [SetterRaisesException] attribute long attrWithSetterException;
98 [GetterRaisesException] attribute DOMString stringAttrWithGetterException;
99 [SetterRaisesException] attribute DOMString stringAttrWithSetterException;
100
101 // 'Custom' extended attribute
102 [Custom] attribute long customAttr;
103 [Custom, MeasureAs=CustomTestFeature] void customMethod();
104 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObj o bjArg);
105
106 void addEventListener(DOMString type,
107 EventListener listener,
108 optional boolean useCapture);
109 void removeEventListener(DOMString type,
110 EventListener listener,
111 optional boolean useCapture);
112
113 // 'CallWith' extended attribute
114 [CallWith=ScriptState] void withScriptStateVoid();
115 [CallWith=ScriptState] TestObj withScriptStateObj();
116 [CallWith=ScriptState, RaisesException] void withScriptStateVoidException();
117 [CallWith=ScriptState, RaisesException] TestObj withScriptStateObjException( );
118 [CallWith=ScriptExecutionContext] void withScriptExecutionContext();
119 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex tAndScriptState();
120 [CallWith=ScriptExecutionContext|ScriptState, RaisesException] TestObj withS criptExecutionContextAndScriptStateObjException();
121 [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExec utionContextAndScriptStateWithSpaces();
122
123 [CallWith=ScriptState] attribute long withScriptStateAttribute;
124 [CallWith=ScriptExecutionContext] attribute TestObj withScriptExecutionConte xtAttribute;
125 [CallWith=ScriptState, GetterRaisesException] attribute TestObj withScriptSt ateAttributeRaises;
126 [CallWith=ScriptExecutionContext, GetterRaisesException] attribute TestObj w ithScriptExecutionContextAttributeRaises;
127 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObj withScriptEx ecutionContextAndScriptStateAttribute;
128 [CallWith=ScriptExecutionContext|ScriptState, GetterRaisesException] attribu te TestObj withScriptExecutionContextAndScriptStateAttributeRaises;
129 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObj with ScriptExecutionContextAndScriptStateWithSpacesAttribute;
130
131 // optional parameters
132 void methodWithOptionalArg(optional long opt);
133 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long op t);
134 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional lon g opt1, optional long opt2);
135 void methodWithOptionalString(optional DOMString str);
136 void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOM String str);
137 void methodWithOptionalStringIsNullString([Default=NullString] optional D OMString str);
138
139 // Callback parameters
140 void methodWithCallbackArg(TestCallback callback);
141 void methodWithNonCallbackArgAndCallbackArg(long nonCallback, TestCallbac k callback);
142 void methodWithCallbackAndOptionalArg(optional TestCallback callback);
143 // static methods with Callback parameter
144 static void staticMethodWithCallbackAndOptionalArg(optional TestCallback callback);
145 static void staticMethodWithCallbackArg(TestCallback callback);
146
147 // 'EnforceRange' extended attribute
148 void methodWithEnforceRangeInt32([EnforceRange] long value);
149 void methodWithEnforceRangeUInt32([EnforceRange] unsigned long value);
150 void methodWithEnforceRangeInt64([EnforceRange] long long value);
151 void methodWithEnforceRangeUInt64([EnforceRange] unsigned long long value );
152
153 [EnforceRange] attribute long enforcedRangeLongAttr;
154 [EnforceRange] attribute unsigned long enforcedRangeUnsignedLongAttr;
155 [EnforceRange] attribute long long enforcedRangeLongLongAttr;
156 [EnforceRange] attribute unsigned long long enforcedRangeUnsignedLongLongAtt r;
157
158 // 'Conditional' extended attribute
159 [Conditional=Condition1] attribute long conditionalAttr1;
160 [Conditional=Condition1&Condition2] attribute long conditionalAttr2;
161 [Conditional=Condition1|Condition2] attribute long conditionalAttr3;
162
163 // 'Conditional' extended method
164 [Conditional=Condition1] DOMString conditionalMethod1();
165 [Conditional=Condition1&Condition2] void conditionalMethod2();
166 [Conditional=Condition1|Condition2] void conditionalMethod3();
167
168 [Conditional=Condition1] attribute TestObjectAConstructor conditionalAttr4;
169 [Conditional=Condition1&Condition2] attribute TestObjectBConstructor conditi onalAttr5;
170 [Conditional=Condition1|Condition2] attribute TestObjectCConstructor conditi onalAttr6;
171
172 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0;
173
174 [CachedAttribute] readonly attribute any cachedAttribute1;
175 [CachedAttribute] readonly attribute any cachedAttribute2;
176
177 attribute any anyAttribute;
178
179 // Overloads
180 void overloadedMethod(TestObj? objArg, [StrictTypeChecking] DOMString str Arg);
181 void overloadedMethod(TestObj? objArg, optional long longArg);
182 void overloadedMethod([StrictTypeChecking] DOMString strArg);
183 void overloadedMethod(long longArg);
184 void overloadedMethod(TestCallback callback);
185 void overloadedMethod(DOMStringList? listArg);
186 void overloadedMethod(DOMString[]? arrayArg);
187 void overloadedMethod(TestObj objArg);
188 void overloadedMethod(DOMString[] arrayArg);
189 void overloadedMethod(sequence<unsigned long> arrayArg);
190 void overloadedMethod(DOMString strArg);
191
192 // Class methods within JavaScript (like what's used for IDBKeyRange).
193 static void classMethod();
194 static long classMethodWithOptional(optional long arg);
195 [Custom] static void classMethod2(long arg);
196
197 // Static method with conditional on overloaded methods
198 [Conditional=Condition1] static void overloadedMethod1(long arg);
199 [Conditional=Condition1] static void overloadedMethod1([StrictTypeChecking] DOMString type);
200
201 void classMethodWithClamp([Clamp] unsigned short objArgsShort, [Clamp] unsig ned long objArgsLong);
202
203 // 'EnabledAtRuntime' methods and attributes.
204 [EnabledAtRuntime] void enabledAtRuntimeMethod1(long longArg);
205 [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(long longArg);
206 [EnabledAtRuntime] attribute long enabledAtRuntimeAttr1;
207 [EnabledAtRuntime=FeatureName] attribute long enabledAtRuntimeAttr2;
208 // 'EnabledPerContext' methods and attributes.
209 [EnabledPerContext] void enabledPerContextMethod1(long longArg);
210 [EnabledPerContext=FeatureName] void enabledPerContextMethod2(long longArg);
211 [EnabledPerContext] attribute long enabledPerContextAttr1;
212 [EnabledPerContext=FeatureName] attribute long enabledPerContextAttr2;
213
214 attribute float[] floatArray;
215 attribute double[] doubleArray;
216
217 void methodWithUnsignedLongSequence(sequence<unsigned long> unsignedLongSequ ence);
218 [RaisesException] DOMString[] stringArrayFunction(DOMString[] values);
219 [RaisesException] DOMStringList domStringListFunction(DOMStringList values);
220
221 [CheckSecurityForNode] readonly attribute Document contentDocument;
222 [CheckSecurityForNode, RaisesException] SVGDocument getSVGDocument();
223
224 void convert1([TreatReturnedNullStringAs=Null] TestNode value);
225 void convert2([TreatReturnedNullStringAs=Undefined] TestNode value);
226 void convert4([TreatNullAs=NullString] TestNode value);
227 void convert5([TreatNullAs=NullString, TreatUndefinedAs=NullString] TestNode value);
228
229 attribute SVGPoint mutablePoint;
230 [Immutable] attribute SVGPoint immutablePoint;
231 SVGPoint mutablePointFunction();
232 [Immutable] SVGPoint immutablePointFunction();
233
234 [ImplementedAs=banana] void orange();
235 [ImplementedAs=blueberry] attribute long strawberry;
236
237 [StrictTypeChecking] attribute float strictFloat;
238 [StrictTypeChecking, RaisesException] boolean strictFunction(DOMString str, float a, long b);
239
240 // ObjectiveC reserved words.
241 readonly attribute long description;
242 attribute long id;
243 readonly attribute DOMString hash;
244
245 // Check constants and enums.
246 const unsigned short CONST_VALUE_0 = 0;
247 const unsigned short CONST_VALUE_1 = 1;
248 const unsigned short CONST_VALUE_2 = 2;
249 const unsigned short CONST_VALUE_4 = 4;
250 const unsigned short CONST_VALUE_8 = 8;
251 const short CONST_VALUE_9 = -1;
252 const DOMString CONST_VALUE_10 = "my constant string";
253 const unsigned short CONST_VALUE_11 = 0xffffffff;
254 const unsigned short CONST_VALUE_12 = 0x01;
255 const unsigned short CONST_VALUE_13 = 0X20;
256 const unsigned short CONST_VALUE_14 = 0x1abc;
257 [Reflect=CONST_IMPL] const unsigned short CONST_JAVASCRIPT = 15;
258
259 [Replaceable] readonly attribute long replaceableAttribute;
260
261 void variadicStringMethod(DOMString head, DOMString... tail);
262 void variadicDoubleMethod(double head, double... tail);
263 void variadicNodeMethod(Node head, Node... tail);
264
265 // Nullable attributes.
266 readonly attribute double? nullableDoubleAttribute;
267 readonly attribute long? nullableLongAttribute;
268 readonly attribute boolean? nullableBooleanAttribute;
269 readonly attribute DOMString? nullableStringAttribute;
270
271 attribute long? nullableLongSettableAttribute;
272
273 [GetterRaisesException] attribute long? nullableStringValue;
274
275 [PerWorldBindings] readonly attribute TestObj perWorldReadOnlyAttribute;
276 [PerWorldBindings] attribute TestObj perWorldAttribute;
277 [PerWorldBindings] void perWorldMethod();
278 [PerWorldBindings] void overloadedPerWorldMethod(long longArg);
279 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long Arg);
280
281 [ActivityLog=Access] void activityLoggedMethod1(long longArg);
282 [PerWorldBindings, ActivityLog=Access] void activityLoggedMethod2(long longA rg);
283 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] void activityLoggedI nIsolatedWorldMethod(long longArg);
284 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(l ong longArg);
285 [PerWorldBindings, ActivityLog=Access] void overloadedActivityLoggedMethod(D OMString strArg, long longArg);
286 [ActivityLog=Access] attribute long activityLoggedAttr1;
287 [PerWorldBindings, ActivityLog=Access] attribute long activityLoggedAttr2;
288 [PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] attribute long activ ityLoggedInIsolatedWorldsAttr;
289 [ActivityLog=Setter] attribute long activityLoggedAttrSetter1;
290 [PerWorldBindings, ActivityLog=Setter] attribute long activityLoggedAttrSett er2;
291 [PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute long activ ityLoggedInIsolatedWorldsAttrSetter;
292 [ActivityLog=Getter] attribute long activityLoggedAttrGetter1;
293 [PerWorldBindings, ActivityLog=Getter] attribute long activityLoggedAttrGett er2;
294 [PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] attribute long activ ityLoggedInIsolatedWorldsAttrGetter;
295
296 // DeprecateAs
297 [DeprecateAs=StaticReadonlyAttribute] static readonly attribute long depreca tedStaticReadOnlyAttr;
298 [DeprecateAs=StaticAttribute] static attribute long deprecatedStaticAttr;
299 [DeprecateAs=ReadonlyAttribute] readonly attribute long deprecatedReadonlyAt tr;
300 [DeprecateAs=Attribute] attribute long deprecatedAttr;
301
302 [DeprecateAs=Method] void deprecatedMethod();
303 [DeprecateAs=StaticMethod] static void deprecatedStaticMethod();
304
305 [DeprecateAs=Constant] const unsigned short DEPRECATED_CONSTANT = 1;
306 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698