| OLD | NEW |
| (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([Callback] 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 attribute short shortAttr; | |
| 48 attribute unsigned short unsignedShortAttr; | |
| 49 attribute long longAttr; | |
| 50 attribute long long longLongAttr; | |
| 51 attribute unsigned long long unsignedLongLongAttr; | |
| 52 attribute DOMString stringAttr; | |
| 53 [MeasureAs=TestFeature] attribute TestObj testObjAttr; | |
| 54 | |
| 55 // WK_ucfirst, WK_lcfirst exceptional cases. | |
| 56 attribute TestObj XMLObjAttr; | |
| 57 attribute boolean create; | |
| 58 | |
| 59 // Reflected DOM attributes | |
| 60 [Reflect] attribute DOMString reflectedStringAttr; | |
| 61 [Reflect] attribute long reflectedIntegralAttr; | |
| 62 [Reflect] attribute unsigned long reflectedUnsignedIntegralAttr; | |
| 63 [Reflect] attribute boolean reflectedBooleanAttr; | |
| 64 [Reflect, URL] attribute DOMString reflectedURLAttr; | |
| 65 [Reflect=customContentStringAttr] attribute DOMString reflectedStringAttr; | |
| 66 [Reflect=customContentIntegralAttr] attribute long reflectedCustomIntegralAt
tr; | |
| 67 [Reflect=customContentBooleanAttr] attribute boolean reflectedCustomBooleanA
ttr; | |
| 68 [Reflect=customContentURLAttr, URL] attribute DOMString reflectedCustomURLAt
tr; | |
| 69 | |
| 70 // TypedArray attribute | |
| 71 attribute Float32Array typedArrayAttr; | |
| 72 | |
| 73 // Methods | |
| 74 void voidMethod(); | |
| 75 void voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | |
| 76 long longMethod(); | |
| 77 long longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | |
| 78 [MeasureAs=TestFeature] TestObj objMethod(); | |
| 79 TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg); | |
| 80 | |
| 81 void methodWithSequenceArg(sequence<ScriptProfile> sequenceArg); | |
| 82 sequence<ScriptProfile> methodReturningSequence(long longArg); | |
| 83 | |
| 84 void methodWithEnumArg(TestEnumType enumArg); | |
| 85 TestObj methodThatRequiresAllArgsAndThrows(DOMString strArg, TestObj objArg) | |
| 86 raises(DOMException); | |
| 87 | |
| 88 void serializedValue(SerializedScriptValue serializedArg); | |
| 89 void optionsObject(Dictionary oo, [Optional] Dictionary ooo); | |
| 90 | |
| 91 // Exceptions | |
| 92 void methodWithException() raises(DOMException); | |
| 93 attribute long attrWithGetterException getter raises(DOMException); | |
| 94 attribute long attrWithSetterException setter raises(DOMException); | |
| 95 attribute DOMString stringAttrWithGetterException getter raises(DOMException
); | |
| 96 attribute DOMString stringAttrWithSetterException setter raises(DOMException
); | |
| 97 | |
| 98 // 'Custom' extended attribute | |
| 99 [Custom] attribute long customAttr; | |
| 100 [Custom, MeasureAs=CustomTestFeature] void customMethod(); | |
| 101 [Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObj o
bjArg); | |
| 102 | |
| 103 void addEventListener(DOMString type, | |
| 104 EventListener listener, | |
| 105 [Optional] boolean useCapture); | |
| 106 void removeEventListener(DOMString type, | |
| 107 EventListener listener, | |
| 108 [Optional] boolean useCapture); | |
| 109 | |
| 110 // 'CallWith' extended attribute | |
| 111 [CallWith=ScriptState] void withScriptStateVoid(); | |
| 112 [CallWith=ScriptState] TestObj withScriptStateObj(); | |
| 113 [CallWith=ScriptState] void withScriptStateVoidException() | |
| 114 raises(DOMException); | |
| 115 [CallWith=ScriptState] TestObj withScriptStateObjException() | |
| 116 raises(DOMException); | |
| 117 [CallWith=ScriptExecutionContext] void withScriptExecutionContext(); | |
| 118 [CallWith=ScriptExecutionContext|ScriptState] void withScriptExecutionContex
tAndScriptState(); | |
| 119 [CallWith=ScriptExecutionContext|ScriptState] TestObj withScriptExecutionCon
textAndScriptStateObjException() | |
| 120 raises(DOMException); | |
| 121 [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExec
utionContextAndScriptStateWithSpaces(); | |
| 122 [CallWith=ScriptArguments|CallStack] void withScriptArgumentsAndCallStack(); | |
| 123 | |
| 124 [CallWith=ScriptState] attribute long withScriptStateAttribute; | |
| 125 [CallWith=ScriptExecutionContext] attribute TestObj withScriptExecutionConte
xtAttribute; | |
| 126 [CallWith=ScriptState] attribute TestObj withScriptStateAttributeRaises | |
| 127 getter raises(DOMException); | |
| 128 [CallWith=ScriptExecutionContext] attribute TestObj withScriptExecutionConte
xtAttributeRaises | |
| 129 getter raises(DOMException); | |
| 130 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObj withScriptEx
ecutionContextAndScriptStateAttribute; | |
| 131 [CallWith=ScriptExecutionContext|ScriptState] attribute TestObj withScriptEx
ecutionContextAndScriptStateAttributeRaises | |
| 132 getter raises(DOMException); | |
| 133 [CallWith= ScriptExecutionContext | ScriptState ] attribute TestObj with
ScriptExecutionContextAndScriptStateWithSpacesAttribute; | |
| 134 [CallWith=ScriptArguments|CallStack] attribute TestObj withScriptArgumentsAn
dCallStackAttribute; | |
| 135 | |
| 136 // 'Optional' extended attribute | |
| 137 void methodWithOptionalArg([Optional] long opt); | |
| 138 void methodWithNonOptionalArgAndOptionalArg(long nonOpt, [Optional] long
opt); | |
| 139 void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, [Optional] l
ong opt1, [Optional] long opt2); | |
| 140 void methodWithOptionalString([Optional] DOMString str); | |
| 141 void methodWithOptionalStringIsUndefined([Optional=DefaultIsUndefined] DO
MString str); | |
| 142 void methodWithOptionalStringIsNullString([Optional=DefaultIsNullString]
DOMString str); | |
| 143 | |
| 144 #if defined(TESTING_V8) || defined(TESTING_JS) | |
| 145 // 'Callback' extended attribute | |
| 146 void methodWithCallbackArg([Callback] TestCallback callback); | |
| 147 void methodWithNonCallbackArgAndCallbackArg(long nonCallback, [Callback]
TestCallback callback); | |
| 148 void methodWithCallbackAndOptionalArg([Callback, Optional] TestCallback c
allback); | |
| 149 // static methods with 'Callback' extended attribute | |
| 150 static void staticMethodWithCallbackAndOptionalArg([Callback, Optional] T
estCallback callback); | |
| 151 static void staticMethodWithCallbackArg([Callback] TestCallback callback)
; | |
| 152 #endif | |
| 153 | |
| 154 #if defined(TESTING_V8) | |
| 155 // 'EnforceRange' extended attribute | |
| 156 void methodWithEnforceRangeInt32([EnforceRange] long value); | |
| 157 void methodWithEnforceRangeUInt32([EnforceRange] unsigned long value); | |
| 158 void methodWithEnforceRangeInt64([EnforceRange] long long value); | |
| 159 void methodWithEnforceRangeUInt64([EnforceRange] unsigned long long value
); | |
| 160 | |
| 161 attribute [EnforceRange] long enforcedRangeLongAttr; | |
| 162 attribute [EnforceRange] unsigned long enforcedRangeUnsignedLongAttr; | |
| 163 attribute [EnforceRange] long long enforcedRangeLongLongAttr; | |
| 164 attribute [EnforceRange] unsigned long long enforcedRangeUnsignedLongLongAtt
r; | |
| 165 #endif | |
| 166 | |
| 167 // 'Conditional' extended attribute | |
| 168 [Conditional=Condition1] attribute long conditionalAttr1; | |
| 169 [Conditional=Condition1&Condition2] attribute long conditionalAttr2; | |
| 170 [Conditional=Condition1|Condition2] attribute long conditionalAttr3; | |
| 171 | |
| 172 // 'Conditional' extended method | |
| 173 [Conditional=Condition1] DOMString conditionalMethod1(); | |
| 174 [Conditional=Condition1&Condition2] void conditionalMethod2(); | |
| 175 [Conditional=Condition1|Condition2] void conditionalMethod3(); | |
| 176 | |
| 177 [Conditional=Condition1] attribute TestObjectAConstructor conditionalAttr4; | |
| 178 [Conditional=Condition1&Condition2] attribute TestObjectBConstructor conditi
onalAttr5; | |
| 179 [Conditional=Condition1|Condition2] attribute TestObjectCConstructor conditi
onalAttr6; | |
| 180 | |
| 181 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; | |
| 182 | |
| 183 #if defined(TESTING_V8) || defined(TESTING_JS) | |
| 184 [CachedAttribute] readonly attribute any cachedAttribute1; | |
| 185 [CachedAttribute] readonly attribute any cachedAttribute2; | |
| 186 #endif | |
| 187 | |
| 188 attribute any anyAttribute; | |
| 189 | |
| 190 #if defined(TESTING_V8) || defined(TESTING_JS) | |
| 191 // Overloads | |
| 192 void overloadedMethod(TestObj? objArg, [StrictTypeChecking] DOMString str
Arg); | |
| 193 void overloadedMethod(TestObj? objArg, [Optional] long longArg); | |
| 194 void overloadedMethod([StrictTypeChecking] DOMString strArg); | |
| 195 void overloadedMethod(long longArg); | |
| 196 void overloadedMethod([Callback] TestCallback callback); | |
| 197 void overloadedMethod(DOMStringList? listArg); | |
| 198 void overloadedMethod(DOMString[]? arrayArg); | |
| 199 void overloadedMethod(TestObj objArg); | |
| 200 void overloadedMethod(DOMString[] arrayArg); | |
| 201 void overloadedMethod(sequence<unsigned long> arrayArg); | |
| 202 void overloadedMethod(DOMString strArg); | |
| 203 #endif | |
| 204 | |
| 205 // Class methods within JavaScript (like what's used for IDBKeyRange). | |
| 206 static void classMethod(); | |
| 207 static long classMethodWithOptional([Optional] long arg); | |
| 208 [Custom] static void classMethod2(long arg); | |
| 209 | |
| 210 // Static method with conditional on overloaded methods | |
| 211 [Conditional=Condition1] static void overloadedMethod1(long arg); | |
| 212 [Conditional=Condition1] static void overloadedMethod1([StrictTypeChecking]
DOMString type); | |
| 213 | |
| 214 void classMethodWithClamp([Clamp] unsigned short objArgsShort, [Clamp] unsig
ned long objArgsLong); | |
| 215 | |
| 216 #if defined(TESTING_V8) | |
| 217 // 'EnabledAtRuntime' methods and attributes. | |
| 218 [EnabledAtRuntime] void enabledAtRuntimeMethod1(long longArg); | |
| 219 [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(long longArg); | |
| 220 [EnabledAtRuntime] attribute long enabledAtRuntimeAttr1; | |
| 221 [EnabledAtRuntime=FeatureName] attribute long enabledAtRuntimeAttr2; | |
| 222 // 'EnabledPerContext' methods and attributes. | |
| 223 [EnabledPerContext] void enabledPerContextMethod1(long longArg); | |
| 224 [EnabledPerContext=FeatureName] void enabledPerContextMethod2(long longArg); | |
| 225 [EnabledPerContext] attribute long enabledPerContextAttr1; | |
| 226 [EnabledPerContext=FeatureName] attribute long enabledPerContextAttr2; | |
| 227 #endif | |
| 228 | |
| 229 | |
| 230 #if defined(TESTING_V8) | |
| 231 attribute float[] floatArray; | |
| 232 attribute double[] doubleArray; | |
| 233 #endif | |
| 234 | |
| 235 #if defined(TESTING_JS) | |
| 236 void methodWithUnsignedLongSequence(sequence<unsigned long> unsignedLongSequ
ence); | |
| 237 #endif | |
| 238 #if defined(TESTING_V8) || defined(TESTING_JS) | |
| 239 DOMString[] stringArrayFunction(DOMString[] values) raises(DOMException); | |
| 240 DOMStringList domStringListFunction(DOMStringList values) raises(DOMExceptio
n); | |
| 241 #endif | |
| 242 | |
| 243 [CheckSecurityForNode] readonly attribute Document contentDocument; | |
| 244 [CheckSecurityForNode] SVGDocument getSVGDocument() | |
| 245 raises(DOMException); | |
| 246 | |
| 247 void convert1([TreatReturnedNullStringAs=Null] a value); | |
| 248 void convert2([TreatReturnedNullStringAs=Undefined] b value); | |
| 249 void convert4([TreatNullAs=NullString] d value); | |
| 250 void convert5([TreatNullAs=NullString, TreatUndefinedAs=NullString] e value)
; | |
| 251 | |
| 252 attribute SVGPoint mutablePoint; | |
| 253 [Immutable] attribute SVGPoint immutablePoint; | |
| 254 SVGPoint mutablePointFunction(); | |
| 255 [Immutable] SVGPoint immutablePointFunction(); | |
| 256 | |
| 257 [ImplementedAs=banana] void orange(); | |
| 258 [ImplementedAs=blueberry] attribute long strawberry; | |
| 259 | |
| 260 [StrictTypeChecking] attribute float strictFloat; | |
| 261 [StrictTypeChecking] bool strictFunction(DOMString str, float a, long b) | |
| 262 raises(DOMException); | |
| 263 | |
| 264 // ObjectiveC reserved words. | |
| 265 readonly attribute long description; | |
| 266 attribute long id; | |
| 267 readonly attribute DOMString hash; | |
| 268 | |
| 269 // Check constants and enums. | |
| 270 const unsigned short CONST_VALUE_0 = 0; | |
| 271 const unsigned short CONST_VALUE_1 = 1; | |
| 272 const unsigned short CONST_VALUE_2 = 2; | |
| 273 const unsigned short CONST_VALUE_4 = 4; | |
| 274 const unsigned short CONST_VALUE_8 = 8; | |
| 275 const short CONST_VALUE_9 = -1; | |
| 276 const DOMString CONST_VALUE_10 = "my constant string"; | |
| 277 const unsigned short CONST_VALUE_11 = 0xffffffff; | |
| 278 const unsigned short CONST_VALUE_12 = 0x01; | |
| 279 const unsigned short CONST_VALUE_13 = 0X20; | |
| 280 const unsigned short CONST_VALUE_14 = 0x1abc; | |
| 281 [Reflect=CONST_IMPL] const unsigned short CONST_JAVASCRIPT = 15; | |
| 282 | |
| 283 [Replaceable] readonly attribute long replaceableAttribute; | |
| 284 | |
| 285 void variadicStringMethod(DOMString head, DOMString... tail); | |
| 286 void variadicDoubleMethod(double head, double... tail); | |
| 287 void variadicNodeMethod(Node head, Node... tail); | |
| 288 | |
| 289 // Nullable attributes. | |
| 290 readonly attribute double? nullableDoubleAttribute; | |
| 291 readonly attribute long? nullableLongAttribute; | |
| 292 readonly attribute boolean? nullableBooleanAttribute; | |
| 293 readonly attribute DOMString? nullableStringAttribute; | |
| 294 | |
| 295 attribute long? nullableLongSettableAttribute; | |
| 296 | |
| 297 attribute long? nullableStringValue | |
| 298 getter raises(DOMException); | |
| 299 | |
| 300 #if defined(TESTING_V8) | |
| 301 [PerWorldBindings] readonly attribute TestObj perWorldReadOnlyAttribute; | |
| 302 [PerWorldBindings] attribute TestObj perWorldAttribute; | |
| 303 [PerWorldBindings] void perWorldMethod(); | |
| 304 [PerWorldBindings] void overloadedPerWorldMethod(long longArg); | |
| 305 [PerWorldBindings] void overloadedPerWorldMethod(DOMString strArg, long long
Arg); | |
| 306 #endif | |
| 307 }; | |
| OLD | NEW |