diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index b40630662bb..517e7b38084 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -2978,8 +2978,11 @@ class CGPerSignatureCall(CGThing): isCreator = memberIsCreator(self.idlNode) if isCreator: # We better be returning addrefed things! - assert isResultAlreadyAddRefed(self.descriptor, - self.extendedAttributes) + assert(isResultAlreadyAddRefed(self.descriptor, + self.extendedAttributes) or + # Workers use raw pointers for new-object return + # values or something + self.descriptor.workers) resultTemplateValues = { 'jsvalRef': '*vp', 'jsvalPtr': 'vp', 'isCreator': isCreator} diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py index 71a15fa446f..7953bb74968 100644 --- a/dom/bindings/Configuration.py +++ b/dom/bindings/Configuration.py @@ -290,21 +290,21 @@ class Descriptor(DescriptorProvider): return self.interface.hasInterfaceObject() or self.interface.hasInterfacePrototypeObject() def getExtendedAttributes(self, member, getter=False, setter=False): - def ensureValidInfallibleExtendedAttribute(attr): + def ensureValidInfallibilityExtendedAttribute(name, attr): assert(attr is None or attr is True or len(attr) == 1) if (attr is not None and attr is not True and 'Workers' not in attr and 'MainThread' not in attr): - raise TypeError("Unknown value for 'infallible': " + attr[0]) + raise TypeError(("Unknown value for '%s': " % name) + attr[0]) name = member.identifier.name if member.isMethod(): attrs = self.extendedAttributes['all'].get(name, []) - infallible = member.getExtendedAttribute("Infallible") - ensureValidInfallibleExtendedAttribute(infallible) - if (infallible is not None and - (infallible is True or - ('Workers' in infallible and self.workers) or - ('MainThread' in infallible and not self.workers))): + throws = member.getExtendedAttribute("Throws") + ensureValidInfallibilityExtendedAttribute("Throws", throws) + if (throws is None or + (throws is not True and + ('Workers' not in throws or not self.workers) and + ('MainThread' not in throws or self.workers))): attrs.append("infallible") return attrs @@ -317,7 +317,7 @@ class Descriptor(DescriptorProvider): infallibleAttr = "GetterInfallible" if getter else "SetterInfallible" infallible = member.getExtendedAttribute(infallibleAttr) - ensureValidInfallibleExtendedAttribute(infallible) + ensureValidInfallibilityExtendedAttribute("Infallible", infallible) if (infallible is not None and (infallible is True or ('Workers' in infallible and self.workers) or diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 04da2ca9c79..6f39f3ec304 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -676,9 +676,11 @@ class IDLInterface(IDLObjectWithScope): allowForbidden=True) method = IDLMethod(self.location, identifier, retType, args) - # Constructors are always Creators and never have any - # other extended attributes. - method.addExtendedAttributes(["Creator"]) + # Constructors are always Creators and are always + # assumed to be able to throw (since there's no way to + # indicate otherwise) and never have any other + # extended attributes. + method.addExtendedAttributes([("Creator",), ("Throws",)]) method.resolve(self) self._extendedAttrDict[identifier] = attrlist if len(attrlist) else True diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h index d724d9ee64e..f3c9f48789b 100644 --- a/dom/bindings/test/TestBindingHeader.h +++ b/dom/bindings/test/TestBindingHeader.h @@ -52,7 +52,7 @@ public: bool GetIndirectlyImplementedProperty(ErrorResult&); void SetIndirectlyImplementedProperty(bool, ErrorResult&); - void IndirectlyImplementedMethod(ErrorResult&); + void IndirectlyImplementedMethod(); }; // IID for the TestExternalInterface @@ -131,254 +131,232 @@ public: int8_t GetReadonlyByte(ErrorResult&); int8_t GetWritableByte(ErrorResult&); void SetWritableByte(int8_t, ErrorResult&); - void PassByte(int8_t, ErrorResult&); - int8_t ReceiveByte(ErrorResult&); - void PassOptionalByte(const Optional&, ErrorResult&); - void PassOptionalByteWithDefault(int8_t, ErrorResult&); - void PassNullableByte(Nullable&, ErrorResult&); - void PassOptionalNullableByte(const Optional< Nullable >&, - ErrorResult&); + void PassByte(int8_t); + int8_t ReceiveByte(); + void PassOptionalByte(const Optional&); + void PassOptionalByteWithDefault(int8_t); + void PassNullableByte(Nullable&); + void PassOptionalNullableByte(const Optional< Nullable >&); int16_t GetReadonlyShort(ErrorResult&); int16_t GetWritableShort(ErrorResult&); void SetWritableShort(int16_t, ErrorResult&); - void PassShort(int16_t, ErrorResult&); - int16_t ReceiveShort(ErrorResult&); - void PassOptionalShort(const Optional&, ErrorResult&); - void PassOptionalShortWithDefault(int16_t, ErrorResult&); + void PassShort(int16_t); + int16_t ReceiveShort(); + void PassOptionalShort(const Optional&); + void PassOptionalShortWithDefault(int16_t); int32_t GetReadonlyLong(ErrorResult&); int32_t GetWritableLong(ErrorResult&); void SetWritableLong(int32_t, ErrorResult&); - void PassLong(int32_t, ErrorResult&); - int16_t ReceiveLong(ErrorResult&); - void PassOptionalLong(const Optional&, ErrorResult&); - void PassOptionalLongWithDefault(int32_t, ErrorResult&); + void PassLong(int32_t); + int16_t ReceiveLong(); + void PassOptionalLong(const Optional&); + void PassOptionalLongWithDefault(int32_t); int64_t GetReadonlyLongLong(ErrorResult&); int64_t GetWritableLongLong(ErrorResult&); void SetWritableLongLong(int64_t, ErrorResult&); - void PassLongLong(int64_t, ErrorResult&); - int64_t ReceiveLongLong(ErrorResult&); - void PassOptionalLongLong(const Optional&, ErrorResult&); - void PassOptionalLongLongWithDefault(int64_t, ErrorResult&); + void PassLongLong(int64_t); + int64_t ReceiveLongLong(); + void PassOptionalLongLong(const Optional&); + void PassOptionalLongLongWithDefault(int64_t); uint8_t GetReadonlyOctet(ErrorResult&); uint8_t GetWritableOctet(ErrorResult&); void SetWritableOctet(uint8_t, ErrorResult&); - void PassOctet(uint8_t, ErrorResult&); - uint8_t ReceiveOctet(ErrorResult&); - void PassOptionalOctet(const Optional&, ErrorResult&); - void PassOptionalOctetWithDefault(uint8_t, ErrorResult&); + void PassOctet(uint8_t); + uint8_t ReceiveOctet(); + void PassOptionalOctet(const Optional&); + void PassOptionalOctetWithDefault(uint8_t); uint16_t GetReadonlyUnsignedShort(ErrorResult&); uint16_t GetWritableUnsignedShort(ErrorResult&); void SetWritableUnsignedShort(uint16_t, ErrorResult&); - void PassUnsignedShort(uint16_t, ErrorResult&); - uint16_t ReceiveUnsignedShort(ErrorResult&); - void PassOptionalUnsignedShort(const Optional&, ErrorResult&); - void PassOptionalUnsignedShortWithDefault(uint16_t, ErrorResult&); + void PassUnsignedShort(uint16_t); + uint16_t ReceiveUnsignedShort(); + void PassOptionalUnsignedShort(const Optional&); + void PassOptionalUnsignedShortWithDefault(uint16_t); uint32_t GetReadonlyUnsignedLong(ErrorResult&); uint32_t GetWritableUnsignedLong(ErrorResult&); void SetWritableUnsignedLong(uint32_t, ErrorResult&); - void PassUnsignedLong(uint32_t, ErrorResult&); - uint32_t ReceiveUnsignedLong(ErrorResult&); - void PassOptionalUnsignedLong(const Optional&, ErrorResult&); - void PassOptionalUnsignedLongWithDefault(uint32_t, ErrorResult&); + void PassUnsignedLong(uint32_t); + uint32_t ReceiveUnsignedLong(); + void PassOptionalUnsignedLong(const Optional&); + void PassOptionalUnsignedLongWithDefault(uint32_t); uint64_t GetReadonlyUnsignedLongLong(ErrorResult&); uint64_t GetWritableUnsignedLongLong(ErrorResult&); void SetWritableUnsignedLongLong(uint64_t, ErrorResult&); - void PassUnsignedLongLong(uint64_t, ErrorResult&); - uint64_t ReceiveUnsignedLongLong(ErrorResult&); - void PassOptionalUnsignedLongLong(const Optional&, ErrorResult&); - void PassOptionalUnsignedLongLongWithDefault(uint64_t, ErrorResult&); + void PassUnsignedLongLong(uint64_t); + uint64_t ReceiveUnsignedLongLong(); + void PassOptionalUnsignedLongLong(const Optional&); + void PassOptionalUnsignedLongLongWithDefault(uint64_t); // Interface types - already_AddRefed ReceiveSelf(ErrorResult&); - already_AddRefed ReceiveNullableSelf(ErrorResult&); - TestInterface* ReceiveWeakSelf(ErrorResult&); - TestInterface* ReceiveWeakNullableSelf(ErrorResult&); - void PassSelf(TestInterface&, ErrorResult&); - void PassSelf2(NonNull&, ErrorResult&); - void PassNullableSelf(TestInterface*, ErrorResult&); + already_AddRefed ReceiveSelf(); + already_AddRefed ReceiveNullableSelf(); + TestInterface* ReceiveWeakSelf(); + TestInterface* ReceiveWeakNullableSelf(); + void PassSelf(TestInterface&); + void PassSelf2(NonNull&); + void PassNullableSelf(TestInterface*); already_AddRefed GetNonNullSelf(ErrorResult&); void SetNonNullSelf(TestInterface&, ErrorResult&); already_AddRefed GetNullableSelf(ErrorResult&); void SetNullableSelf(TestInterface*, ErrorResult&); - void PassOptionalSelf(const Optional &, ErrorResult&); - void PassOptionalNonNullSelf(const Optional >&, ErrorResult&); - void PassOptionalSelfWithDefault(TestInterface*, ErrorResult&); + void PassOptionalSelf(const Optional &); + void PassOptionalNonNullSelf(const Optional >&); + void PassOptionalSelfWithDefault(TestInterface*); - already_AddRefed ReceiveNonWrapperCacheInterface(ErrorResult&); - already_AddRefed ReceiveNullableNonWrapperCacheInterface(ErrorResult&); - void ReceiveNonWrapperCacheInterfaceSequence(nsTArray >&, ErrorResult&); - void ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray >&, ErrorResult&); - void ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable > >&, ErrorResult&); - void ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable > >&, ErrorResult&); + already_AddRefed ReceiveNonWrapperCacheInterface(); + already_AddRefed ReceiveNullableNonWrapperCacheInterface(); + void ReceiveNonWrapperCacheInterfaceSequence(nsTArray >&); + void ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray >&); + void ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable > >&); + void ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable > >&); - already_AddRefed ReceiveOther(ErrorResult&); - already_AddRefed ReceiveNullableOther(ErrorResult&); - TestNonCastableInterface* ReceiveWeakOther(ErrorResult&); - TestNonCastableInterface* ReceiveWeakNullableOther(ErrorResult&); - void PassOther(TestNonCastableInterface&, ErrorResult&); - void PassOther2(NonNull&, ErrorResult&); - void PassNullableOther(TestNonCastableInterface*, ErrorResult&); + already_AddRefed ReceiveOther(); + already_AddRefed ReceiveNullableOther(); + TestNonCastableInterface* ReceiveWeakOther(); + TestNonCastableInterface* ReceiveWeakNullableOther(); + void PassOther(TestNonCastableInterface&); + void PassOther2(NonNull&); + void PassNullableOther(TestNonCastableInterface*); already_AddRefed GetNonNullOther(ErrorResult&); void SetNonNullOther(TestNonCastableInterface&, ErrorResult&); already_AddRefed GetNullableOther(ErrorResult&); void SetNullableOther(TestNonCastableInterface*, ErrorResult&); - void PassOptionalOther(const Optional&, ErrorResult&); - void PassOptionalNonNullOther(const Optional >&, ErrorResult&); - void PassOptionalOtherWithDefault(TestNonCastableInterface*, ErrorResult&); + void PassOptionalOther(const Optional&); + void PassOptionalNonNullOther(const Optional >&); + void PassOptionalOtherWithDefault(TestNonCastableInterface*); - already_AddRefed ReceiveExternal(ErrorResult&); - already_AddRefed ReceiveNullableExternal(ErrorResult&); - TestExternalInterface* ReceiveWeakExternal(ErrorResult&); - TestExternalInterface* ReceiveWeakNullableExternal(ErrorResult&); - void PassExternal(TestExternalInterface*, ErrorResult&); - void PassExternal2(TestExternalInterface*, ErrorResult&); - void PassNullableExternal(TestExternalInterface*, ErrorResult&); + already_AddRefed ReceiveExternal(); + already_AddRefed ReceiveNullableExternal(); + TestExternalInterface* ReceiveWeakExternal(); + TestExternalInterface* ReceiveWeakNullableExternal(); + void PassExternal(TestExternalInterface*); + void PassExternal2(TestExternalInterface*); + void PassNullableExternal(TestExternalInterface*); already_AddRefed GetNonNullExternal(ErrorResult&); void SetNonNullExternal(TestExternalInterface*, ErrorResult&); already_AddRefed GetNullableExternal(ErrorResult&); void SetNullableExternal(TestExternalInterface*, ErrorResult&); - void PassOptionalExternal(const Optional&, ErrorResult&); - void PassOptionalNonNullExternal(const Optional&, ErrorResult&); - void PassOptionalExternalWithDefault(TestExternalInterface*, ErrorResult&); + void PassOptionalExternal(const Optional&); + void PassOptionalNonNullExternal(const Optional&); + void PassOptionalExternalWithDefault(TestExternalInterface*); - already_AddRefed ReceiveCallbackInterface(ErrorResult&); - already_AddRefed ReceiveNullableCallbackInterface(ErrorResult&); - TestCallbackInterface* ReceiveWeakCallbackInterface(ErrorResult&); - TestCallbackInterface* ReceiveWeakNullableCallbackInterface(ErrorResult&); - void PassCallbackInterface(TestCallbackInterface&, ErrorResult&); - void PassCallbackInterface2(OwningNonNull, ErrorResult&); - void PassNullableCallbackInterface(TestCallbackInterface*, ErrorResult&); + already_AddRefed ReceiveCallbackInterface(); + already_AddRefed ReceiveNullableCallbackInterface(); + TestCallbackInterface* ReceiveWeakCallbackInterface(); + TestCallbackInterface* ReceiveWeakNullableCallbackInterface(); + void PassCallbackInterface(TestCallbackInterface&); + void PassCallbackInterface2(OwningNonNull); + void PassNullableCallbackInterface(TestCallbackInterface*); already_AddRefed GetNonNullCallbackInterface(ErrorResult&); void SetNonNullCallbackInterface(TestCallbackInterface&, ErrorResult&); already_AddRefed GetNullableCallbackInterface(ErrorResult&); void SetNullableCallbackInterface(TestCallbackInterface*, ErrorResult&); - void PassOptionalCallbackInterface(const Optional >&, ErrorResult&); - void PassOptionalNonNullCallbackInterface(const Optional >&, ErrorResult&); - void PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface*, ErrorResult&); + void PassOptionalCallbackInterface(const Optional >&); + void PassOptionalNonNullCallbackInterface(const Optional >&); + void PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface*); - already_AddRefed ReceiveConsequentialInterface(ErrorResult&); - void PassConsequentialInterface(IndirectlyImplementedInterface&, ErrorResult&); + already_AddRefed ReceiveConsequentialInterface(); + void PassConsequentialInterface(IndirectlyImplementedInterface&); // Sequence types - void ReceiveSequence(nsTArray&, ErrorResult&); - void ReceiveNullableSequence(Nullable< nsTArray >&, ErrorResult&); - void ReceiveSequenceOfNullableInts(nsTArray< Nullable >&, ErrorResult&); - void ReceiveNullableSequenceOfNullableInts(Nullable< nsTArray< Nullable > >&, ErrorResult&); - void PassSequence(const Sequence &, ErrorResult&); - void PassNullableSequence(const Nullable< Sequence >&, ErrorResult&); - void PassSequenceOfNullableInts(const Sequence >&, ErrorResult&); - void PassOptionalSequenceOfNullableInts(const Optional > > &, - ErrorResult&); - void PassOptionalNullableSequenceOfNullableInts(const Optional > > > &, - ErrorResult&); - void ReceiveCastableObjectSequence(nsTArray< nsRefPtr > &, - ErrorResult&); - void ReceiveNullableCastableObjectSequence(nsTArray< nsRefPtr > &, - ErrorResult&); - void ReceiveCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr > >&, - ErrorResult&); - void ReceiveNullableCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr > >&, - ErrorResult&); - void ReceiveWeakCastableObjectSequence(nsTArray &, - ErrorResult&); - void ReceiveWeakNullableCastableObjectSequence(nsTArray &, - ErrorResult&); - void ReceiveWeakCastableObjectNullableSequence(Nullable< nsTArray >&, - ErrorResult&); - void ReceiveWeakNullableCastableObjectNullableSequence(Nullable< nsTArray >&, - ErrorResult&); - void PassCastableObjectSequence(const Sequence< OwningNonNull >&, - ErrorResult&); - void PassNullableCastableObjectSequence(const Sequence< nsRefPtr > &, - ErrorResult&); - void PassCastableObjectNullableSequence(const Nullable< Sequence< OwningNonNull > >&, - ErrorResult&); - void PassNullableCastableObjectNullableSequence(const Nullable< Sequence< nsRefPtr > >&, - ErrorResult&); - void PassOptionalSequence(const Optional >&, - ErrorResult&); - void PassOptionalNullableSequence(const Optional > >&, - ErrorResult&); - void PassOptionalNullableSequenceWithDefaultValue(const Nullable< Sequence >&, - ErrorResult&); - void PassOptionalObjectSequence(const Optional > >&, - ErrorResult&); + void ReceiveSequence(nsTArray&); + void ReceiveNullableSequence(Nullable< nsTArray >&); + void ReceiveSequenceOfNullableInts(nsTArray< Nullable >&); + void ReceiveNullableSequenceOfNullableInts(Nullable< nsTArray< Nullable > >&); + void PassSequence(const Sequence &); + void PassNullableSequence(const Nullable< Sequence >&); + void PassSequenceOfNullableInts(const Sequence >&); + void PassOptionalSequenceOfNullableInts(const Optional > > &); + void PassOptionalNullableSequenceOfNullableInts(const Optional > > > &); + void ReceiveCastableObjectSequence(nsTArray< nsRefPtr > &); + void ReceiveNullableCastableObjectSequence(nsTArray< nsRefPtr > &); + void ReceiveCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr > >&); + void ReceiveNullableCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr > >&); + void ReceiveWeakCastableObjectSequence(nsTArray &); + void ReceiveWeakNullableCastableObjectSequence(nsTArray &); + void ReceiveWeakCastableObjectNullableSequence(Nullable< nsTArray >&); + void ReceiveWeakNullableCastableObjectNullableSequence(Nullable< nsTArray >&); + void PassCastableObjectSequence(const Sequence< OwningNonNull >&); + void PassNullableCastableObjectSequence(const Sequence< nsRefPtr > &); + void PassCastableObjectNullableSequence(const Nullable< Sequence< OwningNonNull > >&); + void PassNullableCastableObjectNullableSequence(const Nullable< Sequence< nsRefPtr > >&); + void PassOptionalSequence(const Optional >&); + void PassOptionalNullableSequence(const Optional > >&); + void PassOptionalNullableSequenceWithDefaultValue(const Nullable< Sequence >&); + void PassOptionalObjectSequence(const Optional > >&); - void ReceiveStringSequence(nsTArray&, ErrorResult&); - void PassStringSequence(const Sequence&, ErrorResult&); + void ReceiveStringSequence(nsTArray&); + void PassStringSequence(const Sequence&); // Typed array types - void PassArrayBuffer(ArrayBuffer&, ErrorResult&); - void PassNullableArrayBuffer(ArrayBuffer*, ErrorResult&); - void PassOptionalArrayBuffer(const Optional&, ErrorResult&); - void PassOptionalNullableArrayBuffer(const Optional&, ErrorResult&); - void PassOptionalNullableArrayBufferWithDefaultValue(ArrayBuffer*, ErrorResult&); - void PassArrayBufferView(ArrayBufferView&, ErrorResult&); - void PassInt8Array(Int8Array&, ErrorResult&); - void PassInt16Array(Int16Array&, ErrorResult&); - void PassInt32Array(Int32Array&, ErrorResult&); - void PassUint8Array(Uint8Array&, ErrorResult&); - void PassUint16Array(Uint16Array&, ErrorResult&); - void PassUint32Array(Uint32Array&, ErrorResult&); - void PassUint8ClampedArray(Uint8ClampedArray&, ErrorResult&); - void PassFloat32Array(Float32Array&, ErrorResult&); - void PassFloat64Array(Float64Array&, ErrorResult&); - JSObject* ReceiveUint8Array(ErrorResult&); + void PassArrayBuffer(ArrayBuffer&); + void PassNullableArrayBuffer(ArrayBuffer*); + void PassOptionalArrayBuffer(const Optional&); + void PassOptionalNullableArrayBuffer(const Optional&); + void PassOptionalNullableArrayBufferWithDefaultValue(ArrayBuffer*); + void PassArrayBufferView(ArrayBufferView&); + void PassInt8Array(Int8Array&); + void PassInt16Array(Int16Array&); + void PassInt32Array(Int32Array&); + void PassUint8Array(Uint8Array&); + void PassUint16Array(Uint16Array&); + void PassUint32Array(Uint32Array&); + void PassUint8ClampedArray(Uint8ClampedArray&); + void PassFloat32Array(Float32Array&); + void PassFloat64Array(Float64Array&); + JSObject* ReceiveUint8Array(); // String types - void PassString(const nsAString&, ErrorResult&); - void PassNullableString(const nsAString&, ErrorResult&); - void PassOptionalString(const Optional&, ErrorResult&); - void PassOptionalStringWithDefaultValue(const nsAString&, ErrorResult&); - void PassOptionalNullableString(const Optional&, ErrorResult&); - void PassOptionalNullableStringWithDefaultValue(const nsAString&, ErrorResult&); + void PassString(const nsAString&); + void PassNullableString(const nsAString&); + void PassOptionalString(const Optional&); + void PassOptionalStringWithDefaultValue(const nsAString&); + void PassOptionalNullableString(const Optional&); + void PassOptionalNullableStringWithDefaultValue(const nsAString&); // Enumarated types - void PassEnum(TestEnum, ErrorResult&); - void PassOptionalEnum(const Optional&, ErrorResult&); - void PassEnumWithDefault(TestEnum, ErrorResult&); - TestEnum ReceiveEnum(ErrorResult&); + void PassEnum(TestEnum); + void PassOptionalEnum(const Optional&); + void PassEnumWithDefault(TestEnum); + TestEnum ReceiveEnum(); TestEnum GetEnumAttribute(ErrorResult&); TestEnum GetReadonlyEnumAttribute(ErrorResult&); void SetEnumAttribute(TestEnum, ErrorResult&); // Callback types - void PassCallback(JSContext*, JSObject*, ErrorResult&); - void PassNullableCallback(JSContext*, JSObject*, ErrorResult&); - void PassOptionalCallback(JSContext*, const Optional&, - ErrorResult&); - void PassOptionalNullableCallback(JSContext*, const Optional&, - ErrorResult&); - void PassOptionalNullableCallbackWithDefaultValue(JSContext*, JSObject*, - ErrorResult&); - JSObject* ReceiveCallback(JSContext*, ErrorResult&); - JSObject* ReceiveNullableCallback(JSContext*, ErrorResult&); + void PassCallback(JSContext*, JSObject*); + void PassNullableCallback(JSContext*, JSObject*); + void PassOptionalCallback(JSContext*, const Optional&); + void PassOptionalNullableCallback(JSContext*, const Optional&); + void PassOptionalNullableCallbackWithDefaultValue(JSContext*, JSObject*); + JSObject* ReceiveCallback(JSContext*); + JSObject* ReceiveNullableCallback(JSContext*); // Any types - void PassAny(JSContext*, JS::Value, ErrorResult&); - void PassOptionalAny(JSContext*, const Optional&, ErrorResult&); - void PassAnyDefaultNull(JSContext*, JS::Value, ErrorResult&); - JS::Value ReceiveAny(JSContext*, ErrorResult&); + void PassAny(JSContext*, JS::Value); + void PassOptionalAny(JSContext*, const Optional&); + void PassAnyDefaultNull(JSContext*, JS::Value); + JS::Value ReceiveAny(JSContext*); // object types - void PassObject(JSContext*, JSObject&, ErrorResult&); - void PassNullableObject(JSContext*, JSObject*, ErrorResult&); - void PassOptionalObject(JSContext*, const Optional >&, ErrorResult&); - void PassOptionalNullableObject(JSContext*, const Optional&, ErrorResult&); - void PassOptionalNullableObjectWithDefaultValue(JSContext*, JSObject*, ErrorResult&); - JSObject* ReceiveObject(JSContext*, ErrorResult&); - JSObject* ReceiveNullableObject(JSContext*, ErrorResult&); + void PassObject(JSContext*, JSObject&); + void PassNullableObject(JSContext*, JSObject*); + void PassOptionalObject(JSContext*, const Optional >&); + void PassOptionalNullableObject(JSContext*, const Optional&); + void PassOptionalNullableObjectWithDefaultValue(JSContext*, JSObject*); + JSObject* ReceiveObject(JSContext*); + JSObject* ReceiveNullableObject(JSContext*); // Union types - void PassUnion(JSContext*, const ObjectOrLong& arg, ErrorResult&); - void PassUnionWithNullable(JSContext*, const ObjectOrNullOrLong& arg, ErrorResult&) + void PassUnion(JSContext*, const ObjectOrLong& arg); + void PassUnionWithNullable(JSContext*, const ObjectOrNullOrLong& arg) { ObjectOrLong returnValue; if (arg.IsNull()) { @@ -391,43 +369,43 @@ public: i += 1; } } - void PassNullableUnion(JSContext*, const Nullable&, ErrorResult&); - void PassOptionalUnion(JSContext*, const Optional&, ErrorResult&); - void PassOptionalNullableUnion(JSContext*, const Optional >&, ErrorResult&); - void PassOptionalNullableUnionWithDefaultValue(JSContext*, const Nullable&, ErrorResult&); - //void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg, ErrorResult&); - //void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg, ErrorResult&); - void PassUnionWithArrayBuffer(const ArrayBufferOrLong&, ErrorResult&); - void PassUnionWithString(JSContext*, const StringOrObject&, ErrorResult&); - //void PassUnionWithEnum(JSContext*, const TestEnumOrObject&, ErrorResult&); - void PassUnionWithCallback(JSContext*, const TestCallbackOrLong&, ErrorResult&); - void PassUnionWithObject(JSContext*, const ObjectOrLong&, ErrorResult&); + void PassNullableUnion(JSContext*, const Nullable&); + void PassOptionalUnion(JSContext*, const Optional&); + void PassOptionalNullableUnion(JSContext*, const Optional >&); + void PassOptionalNullableUnionWithDefaultValue(JSContext*, const Nullable&); + //void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg); + //void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg); + void PassUnionWithArrayBuffer(const ArrayBufferOrLong&); + void PassUnionWithString(JSContext*, const StringOrObject&); + //void PassUnionWithEnum(JSContext*, const TestEnumOrObject&); + void PassUnionWithCallback(JSContext*, const TestCallbackOrLong&); + void PassUnionWithObject(JSContext*, const ObjectOrLong&); // binaryNames tests - void MethodRenamedTo(ErrorResult&); - void MethodRenamedTo(int8_t, ErrorResult&); + void MethodRenamedTo(); + void MethodRenamedTo(int8_t); int8_t GetAttributeGetterRenamedTo(ErrorResult&); int8_t GetAttributeRenamedTo(ErrorResult&); void SetAttributeRenamedTo(int8_t, ErrorResult&); // Dictionary tests - void PassDictionary(const Dict&, ErrorResult&); - void PassOtherDictionary(const GrandparentDict&, ErrorResult&); - void PassSequenceOfDictionaries(const Sequence&, ErrorResult&); - void PassDictionaryOrLong(const Dict&, ErrorResult&); - void PassDictionaryOrLong(int32_t, ErrorResult&); - void PassDictContainingDict(const DictContainingDict&, ErrorResult&); + void PassDictionary(const Dict&); + void PassOtherDictionary(const GrandparentDict&); + void PassSequenceOfDictionaries(const Sequence&); + void PassDictionaryOrLong(const Dict&); + void PassDictionaryOrLong(int32_t); + void PassDictContainingDict(const DictContainingDict&); // Methods and properties imported via "implements" bool GetImplementedProperty(ErrorResult&); void SetImplementedProperty(bool, ErrorResult&); - void ImplementedMethod(ErrorResult&); + void ImplementedMethod(); bool GetImplementedParentProperty(ErrorResult&); void SetImplementedParentProperty(bool, ErrorResult&); - void ImplementedParentMethod(ErrorResult&); + void ImplementedParentMethod(); bool GetIndirectlyImplementedProperty(ErrorResult&); void SetIndirectlyImplementedProperty(bool, ErrorResult&); - void IndirectlyImplementedMethod(ErrorResult&); + void IndirectlyImplementedMethod(); uint32_t GetDiamondImplementedProperty(ErrorResult&); private: @@ -438,124 +416,120 @@ private: template void SetWritableByte(T, ErrorResult&) MOZ_DELETE; template - void PassByte(T, ErrorResult&) MOZ_DELETE; + void PassByte(T) MOZ_DELETE; template - void PassOptionalByte(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalByte(const Optional&) MOZ_DELETE; template - void PassOptionalByteWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalByteWithDefault(T) MOZ_DELETE; void SetReadonlyShort(int16_t, ErrorResult&) MOZ_DELETE; template void SetWritableShort(T, ErrorResult&) MOZ_DELETE; template - void PassShort(T, ErrorResult&) MOZ_DELETE; + void PassShort(T) MOZ_DELETE; template - void PassOptionalShort(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalShort(const Optional&) MOZ_DELETE; template - void PassOptionalShortWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalShortWithDefault(T) MOZ_DELETE; void SetReadonlyLong(int32_t, ErrorResult&) MOZ_DELETE; template void SetWritableLong(T, ErrorResult&) MOZ_DELETE; template - void PassLong(T, ErrorResult&) MOZ_DELETE; + void PassLong(T) MOZ_DELETE; template - void PassOptionalLong(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalLong(const Optional&) MOZ_DELETE; template - void PassOptionalLongWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalLongWithDefault(T) MOZ_DELETE; void SetReadonlyLongLong(int64_t, ErrorResult&) MOZ_DELETE; template void SetWritableLongLong(T, ErrorResult&) MOZ_DELETE; template - void PassLongLong(T, ErrorResult&) MOZ_DELETE; + void PassLongLong(T) MOZ_DELETE; template - void PassOptionalLongLong(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalLongLong(const Optional&) MOZ_DELETE; template - void PassOptionalLongLongWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalLongLongWithDefault(T) MOZ_DELETE; void SetReadonlyOctet(uint8_t, ErrorResult&) MOZ_DELETE; template void SetWritableOctet(T, ErrorResult&) MOZ_DELETE; template - void PassOctet(T, ErrorResult&) MOZ_DELETE; + void PassOctet(T) MOZ_DELETE; template - void PassOptionalOctet(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalOctet(const Optional&) MOZ_DELETE; template - void PassOptionalOctetWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalOctetWithDefault(T) MOZ_DELETE; void SetReadonlyUnsignedShort(uint16_t, ErrorResult&) MOZ_DELETE; template void SetWritableUnsignedShort(T, ErrorResult&) MOZ_DELETE; template - void PassUnsignedShort(T, ErrorResult&) MOZ_DELETE; + void PassUnsignedShort(T) MOZ_DELETE; template - void PassOptionalUnsignedShort(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedShort(const Optional&) MOZ_DELETE; template - void PassOptionalUnsignedShortWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedShortWithDefault(T) MOZ_DELETE; void SetReadonlyUnsignedLong(uint32_t, ErrorResult&) MOZ_DELETE; template void SetWritableUnsignedLong(T, ErrorResult&) MOZ_DELETE; template - void PassUnsignedLong(T, ErrorResult&) MOZ_DELETE; + void PassUnsignedLong(T) MOZ_DELETE; template - void PassOptionalUnsignedLong(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedLong(const Optional&) MOZ_DELETE; template - void PassOptionalUnsignedLongWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedLongWithDefault(T) MOZ_DELETE; void SetReadonlyUnsignedLongLong(uint64_t, ErrorResult&) MOZ_DELETE; template void SetWritableUnsignedLongLong(T, ErrorResult&) MOZ_DELETE; template - void PassUnsignedLongLong(T, ErrorResult&) MOZ_DELETE; + void PassUnsignedLongLong(T) MOZ_DELETE; template - void PassOptionalUnsignedLongLong(const Optional&, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedLongLong(const Optional&) MOZ_DELETE; template - void PassOptionalUnsignedLongLongWithDefault(T, ErrorResult&) MOZ_DELETE; + void PassOptionalUnsignedLongLongWithDefault(T) MOZ_DELETE; // Enforce that only const things are passed for sequences - void PassSequence(Sequence &, ErrorResult&) MOZ_DELETE; - void PassNullableSequence(Nullable< Sequence >&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableSequenceWithDefaultValue(Nullable< Sequence >&, - ErrorResult&) MOZ_DELETE; + void PassSequence(Sequence &) MOZ_DELETE; + void PassNullableSequence(Nullable< Sequence >&) MOZ_DELETE; + void PassOptionalNullableSequenceWithDefaultValue(Nullable< Sequence >&) MOZ_DELETE; // Enforce that only const things are passed for optional - void PassOptionalByte(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableByte(Optional >&, - ErrorResult&) MOZ_DELETE; - void PassOptionalShort(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalLong(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalLongLong(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalOctet(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalUnsignedShort(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalUnsignedLong(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalUnsignedLongLong(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalSelf(Optional &, ErrorResult&) MOZ_DELETE; - void PassOptionalNonNullSelf(Optional >&, ErrorResult&) MOZ_DELETE; - void PassOptionalOther(Optional&, ErrorResult&); - void PassOptionalNonNullOther(Optional >&, ErrorResult&); - void PassOptionalExternal(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalNonNullExternal(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalSequence(Optional >&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableSequence(Optional > >&, - ErrorResult&) MOZ_DELETE; - void PassOptionalObjectSequence(Optional > >&, - ErrorResult&) MOZ_DELETE; - void PassOptionalArrayBuffer(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableArrayBuffer(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalEnum(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalCallback(JSContext*, Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableCallback(JSContext*, Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalAny(Optional&, ErrorResult) MOZ_DELETE; + void PassOptionalByte(Optional&) MOZ_DELETE; + void PassOptionalNullableByte(Optional >&) MOZ_DELETE; + void PassOptionalShort(Optional&) MOZ_DELETE; + void PassOptionalLong(Optional&) MOZ_DELETE; + void PassOptionalLongLong(Optional&) MOZ_DELETE; + void PassOptionalOctet(Optional&) MOZ_DELETE; + void PassOptionalUnsignedShort(Optional&) MOZ_DELETE; + void PassOptionalUnsignedLong(Optional&) MOZ_DELETE; + void PassOptionalUnsignedLongLong(Optional&) MOZ_DELETE; + void PassOptionalSelf(Optional &) MOZ_DELETE; + void PassOptionalNonNullSelf(Optional >&) MOZ_DELETE; + void PassOptionalOther(Optional&); + void PassOptionalNonNullOther(Optional >&); + void PassOptionalExternal(Optional&) MOZ_DELETE; + void PassOptionalNonNullExternal(Optional&) MOZ_DELETE; + void PassOptionalSequence(Optional >&) MOZ_DELETE; + void PassOptionalNullableSequence(Optional > >&) MOZ_DELETE; + void PassOptionalObjectSequence(Optional > >&) MOZ_DELETE; + void PassOptionalArrayBuffer(Optional&) MOZ_DELETE; + void PassOptionalNullableArrayBuffer(Optional&) MOZ_DELETE; + void PassOptionalEnum(Optional&) MOZ_DELETE; + void PassOptionalCallback(JSContext*, Optional&) MOZ_DELETE; + void PassOptionalNullableCallback(JSContext*, Optional&) MOZ_DELETE; + void PassOptionalAny(Optional&) MOZ_DELETE; // And test that string stuff is always const - void PassString(nsAString&, ErrorResult&) MOZ_DELETE; - void PassNullableString(nsAString&, ErrorResult&) MOZ_DELETE; - void PassOptionalString(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalStringWithDefaultValue(nsAString&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableString(Optional&, ErrorResult&) MOZ_DELETE; - void PassOptionalNullableStringWithDefaultValue(nsAString&, ErrorResult&) MOZ_DELETE; + void PassString(nsAString&) MOZ_DELETE; + void PassNullableString(nsAString&) MOZ_DELETE; + void PassOptionalString(Optional&) MOZ_DELETE; + void PassOptionalStringWithDefaultValue(nsAString&) MOZ_DELETE; + void PassOptionalNullableString(Optional&) MOZ_DELETE; + void PassOptionalNullableStringWithDefaultValue(nsAString&) MOZ_DELETE; }; @@ -568,10 +542,10 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - uint32_t IndexedGetter(uint32_t, bool&, ErrorResult&); - uint32_t IndexedGetter(uint32_t, ErrorResult&) MOZ_DELETE; - uint32_t Item(uint32_t, ErrorResult&); - uint32_t Item(uint32_t, bool&, ErrorResult&) MOZ_DELETE; + uint32_t IndexedGetter(uint32_t, bool&); + uint32_t IndexedGetter(uint32_t&) MOZ_DELETE; + uint32_t Item(uint32_t&); + uint32_t Item(uint32_t, bool&) MOZ_DELETE; uint32_t GetLength(); }; @@ -584,7 +558,7 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - void NamedGetter(const nsAString&, bool&, nsAString&, ErrorResult&); + void NamedGetter(const nsAString&, bool&, nsAString&); }; class TestIndexedAndNamedGetterInterface : public nsISupports, @@ -596,9 +570,9 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - uint32_t IndexedGetter(uint32_t, bool&, ErrorResult&); - void NamedGetter(const nsAString&, bool&, nsAString&, ErrorResult&); - void NamedItem(const nsAString&, nsAString&, ErrorResult&); + uint32_t IndexedGetter(uint32_t, bool&); + void NamedGetter(const nsAString&, bool&, nsAString&); + void NamedItem(const nsAString&, nsAString&); uint32_t GetLength(); }; @@ -611,8 +585,8 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - void IndexedSetter(uint32_t, const nsAString&, ErrorResult&); - void SetItem(uint32_t, const nsAString&, ErrorResult&); + void IndexedSetter(uint32_t, const nsAString&); + void SetItem(uint32_t, const nsAString&); }; class TestNamedSetterInterface : public nsISupports, @@ -624,7 +598,7 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - void NamedSetter(const nsAString&, TestIndexedSetterInterface&, ErrorResult&); + void NamedSetter(const nsAString&, TestIndexedSetterInterface&); }; class TestIndexedAndNamedSetterInterface : public nsISupports, @@ -636,21 +610,21 @@ public: // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); - void IndexedSetter(uint32_t, TestIndexedSetterInterface&, ErrorResult&); - void NamedSetter(const nsAString&, TestIndexedSetterInterface&, ErrorResult&); - void SetNamedItem(const nsAString&, TestIndexedSetterInterface&, ErrorResult&); + void IndexedSetter(uint32_t, TestIndexedSetterInterface&); + void NamedSetter(const nsAString&, TestIndexedSetterInterface&); + void SetNamedItem(const nsAString&, TestIndexedSetterInterface&); }; class TestIndexedAndNamedGetterAndSetterInterface : public TestIndexedSetterInterface { public: - uint32_t IndexedGetter(uint32_t, bool&, ErrorResult&); - uint32_t Item(uint32_t, ErrorResult&); - void NamedGetter(const nsAString&, bool&, nsAString&, ErrorResult&); - void NamedItem(const nsAString&, nsAString&, ErrorResult&); - void IndexedSetter(uint32_t, int32_t&, ErrorResult&); - void IndexedSetter(uint32_t, const nsAString&, ErrorResult&) MOZ_DELETE; - void NamedSetter(const nsAString&, const nsAString&, ErrorResult&); + uint32_t IndexedGetter(uint32_t, bool&); + uint32_t Item(uint32_t); + void NamedGetter(const nsAString&, bool&, nsAString&); + void NamedItem(const nsAString&, nsAString&); + void IndexedSetter(uint32_t, int32_t&); + void IndexedSetter(uint32_t, const nsAString&) MOZ_DELETE; + void NamedSetter(const nsAString&, const nsAString&); void Stringify(nsAString&); uint32_t GetLength(); }; diff --git a/dom/bindings/test/TestCodeGen.webidl b/dom/bindings/test/TestCodeGen.webidl index c6591671fce..74354b2beda 100644 --- a/dom/bindings/test/TestCodeGen.webidl +++ b/dom/bindings/test/TestCodeGen.webidl @@ -36,7 +36,7 @@ interface OnlyForUseInConstructor { ] interface TestInterface { // Integer types - // XXXbz add tests for infallible versions of all the integer stuff + // XXXbz add tests for throwing versions of all the integer stuff readonly attribute byte readonlyByte; attribute byte writableByte; void passByte(byte arg); @@ -96,7 +96,7 @@ interface TestInterface { void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17); // Castable interface types - // XXXbz add tests for infallible versions of all the castable interface stuff + // XXXbz add tests for throwing versions of all the castable interface stuff TestInterface receiveSelf(); TestInterface? receiveNullableSelf(); TestInterface receiveWeakSelf(); diff --git a/dom/webidl/CSSStyleDeclaration.webidl b/dom/webidl/CSSStyleDeclaration.webidl index faa6e8519e3..05c02ded7ef 100644 --- a/dom/webidl/CSSStyleDeclaration.webidl +++ b/dom/webidl/CSSStyleDeclaration.webidl @@ -16,17 +16,19 @@ interface CSSStyleDeclaration { [Infallible] readonly attribute unsigned long length; - [Infallible] getter DOMString item(unsigned long index); + [Throws] DOMString getPropertyValue(DOMString property); // Mozilla extension, sort of + [Throws] CSSValue getPropertyCSSValue(DOMString property); - [Infallible] DOMString getPropertyPriority(DOMString property); // This would be nicer if it used a string default value of "". // See bug 759622. + [Throws] void setProperty(DOMString property, DOMString value, [TreatNullAs=EmptyString] optional DOMString priority); + [Throws] DOMString removeProperty(DOMString property); [Infallible] diff --git a/dom/webidl/CanvasRenderingContext2D.webidl b/dom/webidl/CanvasRenderingContext2D.webidl index 4dff95aaa1e..d40b2b70fd9 100644 --- a/dom/webidl/CanvasRenderingContext2D.webidl +++ b/dom/webidl/CanvasRenderingContext2D.webidl @@ -29,17 +29,20 @@ interface CanvasRenderingContext2D { readonly attribute HTMLCanvasElement canvas; // state - [Infallible] void save(); // push state on state stack - [Infallible] void restore(); // pop state stack and restore state // transformations (default transform is the identity matrix) // NOT IMPLEMENTED attribute SVGMatrix currentTransform; + [Throws] void scale(double x, double y); + [Throws] void rotate(double angle); + [Throws] void translate(double x, double y); + [Throws] void transform(double a, double b, double c, double d, double e, double f); + [Throws] void setTransform(double a, double b, double c, double d, double e, double f); // NOT IMPLEMENTED void resetTransform(); @@ -53,8 +56,11 @@ interface CanvasRenderingContext2D { attribute any strokeStyle; // (default black) [SetterInfallible] attribute any fillStyle; // (default black) + [Throws] CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1); + [Throws] CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); + [Throws] CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition); // shadows @@ -68,20 +74,14 @@ interface CanvasRenderingContext2D { attribute DOMString shadowColor; // (default transparent black) // rects - [Infallible] void clearRect(double x, double y, double w, double h); - [Infallible] void fillRect(double x, double y, double w, double h); - [Infallible] void strokeRect(double x, double y, double w, double h); // path API (see also CanvasPathMethods) - [Infallible] void beginPath(); - [Infallible] void fill(); // NOT IMPLEMENTED void fill(Path path); - [Infallible] void stroke(); // NOT IMPLEMENTED void stroke(Path path); // NOT IMPLEMENTED void drawSystemFocusRing(Element element); @@ -90,33 +90,42 @@ interface CanvasRenderingContext2D { // NOT IMPLEMENTED boolean drawCustomFocusRing(Path path, Element element); // NOT IMPLEMENTED void scrollPathIntoView(); // NOT IMPLEMENTED void scrollPathIntoView(Path path); - [Infallible] void clip(); // NOT IMPLEMENTED void clip(Path path); // NOT IMPLEMENTED void resetClip(); - [Infallible] boolean isPointInPath(double x, double y); // NOT IMPLEMENTED boolean isPointInPath(Path path, double x, double y); // text (see also the CanvasDrawingStyles interface) + [Throws] void fillText(DOMString text, double x, double y, optional double maxWidth); + [Throws] void strokeText(DOMString text, double x, double y, optional double maxWidth); + [Throws] TextMetrics measureText(DOMString text); // drawing images // NOT IMPLEMENTED attribute boolean imageSmoothingEnabled; // (default true) + [Throws] void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy); + [Throws] void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy, double dw, double dh); + [Throws] void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh); // hit regions // NOT IMPLEMENTED void addHitRegion(HitRegionOptions options); // pixel manipulation - [Creator] ImageData createImageData(double sw, double sh); - [Creator] ImageData createImageData(ImageData imagedata); - [Creator] ImageData getImageData(double sx, double sy, double sw, double sh); + [Creator, Throws] + ImageData createImageData(double sw, double sh); + [Creator, Throws] + ImageData createImageData(ImageData imagedata); + [Creator, Throws] + ImageData getImageData(double sx, double sy, double sw, double sh); + [Throws] void putImageData(ImageData imagedata, double dx, double dy); + [Throws] void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight); // Mozilla-specific stuff @@ -192,8 +201,10 @@ interface CanvasRenderingContext2D { * FIXME Bug 767931 - Mark drawWindow and asyncDrawXULElement as ChromeOnly * in WebIDL */ + [Throws] void drawWindow(Window window, double x, double y, double w, double h, DOMString bgColor, optional unsigned long flags = 0); + [Throws] void asyncDrawXULElement(XULElement elem, double x, double y, double w, double h, DOMString bgColor, optional unsigned long flags = 0); @@ -230,27 +241,20 @@ interface CanvasDrawingStyles { [NoInterfaceObject] interface CanvasPathMethods { // shared path API methods - [Infallible] void closePath(); - - [Infallible] void moveTo(double x, double y); - - [Infallible] void lineTo(double x, double y); - - [Infallible] void quadraticCurveTo(double cpx, double cpy, double x, double y); - [Infallible] void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); + [Throws] void arcTo(double x1, double y1, double x2, double y2, double radius); // NOT IMPLEMENTED void arcTo(double x1, double y1, double x2, double y2, double radiusX, double radiusY, double rotation); - [Infallible] void rect(double x, double y, double w, double h); + [Throws] void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false); // NOT IMPLEMENTED void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise); }; diff --git a/dom/webidl/EventTarget.webidl b/dom/webidl/EventTarget.webidl index 45f38f5fd6e..b4b2ac88b3c 100644 --- a/dom/webidl/EventTarget.webidl +++ b/dom/webidl/EventTarget.webidl @@ -17,12 +17,15 @@ interface EventTarget { differs in content and chrome. In content that default boolean value is true, while in chrome the default boolean value is false. */ + [Throws] void addEventListener(DOMString type, EventListener? listener, optional boolean capture = false, optional boolean? wantsUntrusted = null); + [Throws] void removeEventListener(DOMString type, EventListener? listener, optional boolean capture = false); + [Throws] boolean dispatchEvent(Event event); }; diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl index 4e71bc843e4..7d3fb83057e 100644 --- a/dom/webidl/Performance.webidl +++ b/dom/webidl/Performance.webidl @@ -14,7 +14,6 @@ interface Performance { // DOMHighResTimeStamp now(); - [Infallible] double now(); [Infallible] diff --git a/dom/webidl/WebGLRenderingContext.webidl b/dom/webidl/WebGLRenderingContext.webidl index 7de4e31777f..3b1e9c2dfff 100644 --- a/dom/webidl/WebGLRenderingContext.webidl +++ b/dom/webidl/WebGLRenderingContext.webidl @@ -481,426 +481,308 @@ interface WebGLRenderingContext { [Infallible] readonly attribute long drawingBufferHeight; - [WebGLHandlesContextLoss] WebGLContextAttributes getContextAttributes(); - [WebGLHandlesContextLoss, Infallible] boolean isContextLost(); + [WebGLHandlesContextLoss, Throws] WebGLContextAttributes getContextAttributes(); + [WebGLHandlesContextLoss] boolean isContextLost(); - [Infallible] sequence? getSupportedExtensions(); // XXXbz In the spec, this is "object?"; I'm making it // WebGLExtension? just for ease of implementation. - [Infallible] WebGLExtension? getExtension(DOMString name); - [Infallible] void activeTexture(unsigned long texture); - [Infallible] void attachShader(WebGLProgram? program, WebGLShader? shader); - [Infallible] void bindAttribLocation(WebGLProgram? program, unsigned long index, DOMString name); - [Infallible] void bindBuffer(unsigned long target, WebGLBuffer? buffer); - [Infallible] void bindFramebuffer(unsigned long target, WebGLFramebuffer? framebuffer); - [Infallible] void bindRenderbuffer(unsigned long target, WebGLRenderbuffer? renderbuffer); - [Infallible] void bindTexture(unsigned long target, WebGLTexture? texture); - [Infallible] void blendColor(float red, float green, float blue, float alpha); - [Infallible] void blendEquation(unsigned long mode); - [Infallible] void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha); - [Infallible] void blendFunc(unsigned long sfactor, unsigned long dfactor); - [Infallible] void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha); - [Infallible] void bufferData(unsigned long target, long long size, unsigned long usage); - [Infallible] void bufferData(unsigned long target, ArrayBufferView data, unsigned long usage); - [Infallible] void bufferData(unsigned long target, ArrayBuffer? data, unsigned long usage); - [Infallible] void bufferSubData(unsigned long target, long long offset, ArrayBufferView data); - [Infallible] void bufferSubData(unsigned long target, long long offset, ArrayBuffer? data); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] unsigned long checkFramebufferStatus(unsigned long target); - [Infallible] void clear(unsigned long mask); - [Infallible] void clearColor(float red, float green, float blue, float alpha); - [Infallible] void clearDepth(float depth); - [Infallible] void clearStencil(long s); - [Infallible] void colorMask(boolean red, boolean green, boolean blue, boolean alpha); - [Infallible] void compileShader(WebGLShader? shader); - [Infallible] void compressedTexImage2D(unsigned long target, long level, unsigned long internalformat, long width, long height, long border, ArrayBufferView data); - [Infallible] void compressedTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long width, long height, unsigned long format, ArrayBufferView data); - [Infallible] void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, long width, long height, long border); - [Infallible] void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, long width, long height); - [Infallible] WebGLBuffer? createBuffer(); - [Infallible] WebGLFramebuffer? createFramebuffer(); - [Infallible] WebGLProgram? createProgram(); - [Infallible] WebGLRenderbuffer? createRenderbuffer(); - [Infallible] WebGLShader? createShader(unsigned long type); - [Infallible] WebGLTexture? createTexture(); - [Infallible] void cullFace(unsigned long mode); - [Infallible] void deleteBuffer(WebGLBuffer? buffer); - [Infallible] void deleteFramebuffer(WebGLFramebuffer? framebuffer); - [Infallible] void deleteProgram(WebGLProgram? program); - [Infallible] void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer); - [Infallible] void deleteShader(WebGLShader? shader); - [Infallible] void deleteTexture(WebGLTexture? texture); - [Infallible] void depthFunc(unsigned long func); - [Infallible] void depthMask(boolean flag); - [Infallible] void depthRange(float zNear, float zFar); - [Infallible] void detachShader(WebGLProgram? program, WebGLShader? shader); - [Infallible] void disable(unsigned long cap); - [Infallible] void disableVertexAttribArray(unsigned long index); - [Infallible] void drawArrays(unsigned long mode, long first, long count); - [Infallible] void drawElements(unsigned long mode, long count, unsigned long type, long long offset); - [Infallible] void enable(unsigned long cap); - [Infallible] void enableVertexAttribArray(unsigned long index); - [Infallible] void finish(); - [Infallible] void flush(); - [Infallible] void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer? renderbuffer); - [Infallible] void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture? texture, long level); - [Infallible] void frontFace(unsigned long mode); - [Infallible] void generateMipmap(unsigned long target); - [Infallible] WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, unsigned long index); - [Infallible] WebGLActiveInfo? getActiveUniform(WebGLProgram? program, unsigned long index); - [Infallible] sequence? getAttachedShaders(WebGLProgram? program); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] long getAttribLocation(WebGLProgram? program, DOMString name); - [Infallible] any getBufferParameter(unsigned long target, unsigned long pname); + [Throws] any getParameter(unsigned long pname); - [WebGLHandlesContextLoss, Infallible] unsigned long getError(); + [WebGLHandlesContextLoss] unsigned long getError(); + [Throws] any getFramebufferAttachmentParameter(unsigned long target, unsigned long attachment, unsigned long pname); - [Infallible] any getProgramParameter(WebGLProgram? program, unsigned long pname); - [Infallible] DOMString? getProgramInfoLog(WebGLProgram? program); - [Infallible] any getRenderbufferParameter(unsigned long target, unsigned long pname); - [Infallible] any getShaderParameter(WebGLShader? shader, unsigned long pname); - [Infallible] WebGLShaderPrecisionFormat? getShaderPrecisionFormat(unsigned long shadertype, unsigned long precisiontype); - [Infallible] DOMString? getShaderInfoLog(WebGLShader? shader); - [Infallible] DOMString? getShaderSource(WebGLShader? shader); - [Infallible] any getTexParameter(unsigned long target, unsigned long pname); + [Throws] any getUniform(WebGLProgram? program, WebGLUniformLocation? location); - [Creator, Infallible] + [Creator] WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name); + [Throws] any getVertexAttrib(unsigned long index, unsigned long pname); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] long long getVertexAttribOffset(unsigned long index, unsigned long pname); - [Infallible] void hint(unsigned long target, unsigned long mode); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isBuffer(WebGLBuffer? buffer); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isEnabled(unsigned long cap); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isFramebuffer(WebGLFramebuffer? framebuffer); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isProgram(WebGLProgram? program); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isRenderbuffer(WebGLRenderbuffer? renderbuffer); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isShader(WebGLShader? shader); - [WebGLHandlesContextLoss, Infallible] + [WebGLHandlesContextLoss] boolean isTexture(WebGLTexture? texture); - [Infallible] void lineWidth(float width); - [Infallible] void linkProgram(WebGLProgram? program); - [Infallible] void pixelStorei(unsigned long pname, long param); - [Infallible] void polygonOffset(float factor, float units); + [Throws] void readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView? pixels); - [Infallible] void renderbufferStorage(unsigned long target, unsigned long internalformat, long width, long height); - [Infallible] void sampleCoverage(float value, boolean invert); - [Infallible] void scissor(long x, long y, long width, long height); - [Infallible] void shaderSource(WebGLShader? shader, DOMString source); - [Infallible] void stencilFunc(unsigned long func, long ref, unsigned long mask); - [Infallible] void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask); - [Infallible] void stencilMask(unsigned long mask); - [Infallible] void stencilMaskSeparate(unsigned long face, unsigned long mask); - [Infallible] void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass); - [Infallible] void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass); + [Throws] void texImage2D(unsigned long target, long level, unsigned long internalformat, long width, long height, long border, unsigned long format, unsigned long type, ArrayBufferView? pixels); + [Throws] void texImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long format, unsigned long type, ImageData? pixels); + [Throws] void texImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long format, unsigned long type, HTMLImageElement image); // May throw DOMException + [Throws] void texImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long format, unsigned long type, HTMLCanvasElement canvas); // May throw DOMException + [Throws] void texImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long format, unsigned long type, HTMLVideoElement video); // May throw DOMException - [Infallible] void texParameterf(unsigned long target, unsigned long pname, float param); - [Infallible] void texParameteri(unsigned long target, unsigned long pname, long param); + [Throws] void texSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long width, long height, unsigned long format, unsigned long type, ArrayBufferView? pixels); + [Throws] void texSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long format, unsigned long type, ImageData? pixels); + [Throws] void texSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long format, unsigned long type, HTMLImageElement image); // May throw DOMException + [Throws] void texSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long format, unsigned long type, HTMLCanvasElement canvas); // May throw DOMException + [Throws] void texSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long format, unsigned long type, HTMLVideoElement video); // May throw DOMException - [Infallible] void uniform1f(WebGLUniformLocation? location, float x); - [Infallible] void uniform1fv(WebGLUniformLocation? location, Float32Array v); - [Infallible] void uniform1fv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform1i(WebGLUniformLocation? location, long x); - [Infallible] void uniform1iv(WebGLUniformLocation? location, Int32Array v); - [Infallible] void uniform1iv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform2f(WebGLUniformLocation? location, float x, float y); - [Infallible] void uniform2fv(WebGLUniformLocation? location, Float32Array v); - [Infallible] void uniform2fv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform2i(WebGLUniformLocation? location, long x, long y); - [Infallible] void uniform2iv(WebGLUniformLocation? location, Int32Array v); - [Infallible] void uniform2iv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform3f(WebGLUniformLocation? location, float x, float y, float z); - [Infallible] void uniform3fv(WebGLUniformLocation? location, Float32Array v); - [Infallible] void uniform3fv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform3i(WebGLUniformLocation? location, long x, long y, long z); - [Infallible] void uniform3iv(WebGLUniformLocation? location, Int32Array v); - [Infallible] void uniform3iv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform4f(WebGLUniformLocation? location, float x, float y, float z, float w); - [Infallible] void uniform4fv(WebGLUniformLocation? location, Float32Array v); - [Infallible] void uniform4fv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniform4i(WebGLUniformLocation? location, long x, long y, long z, long w); - [Infallible] void uniform4iv(WebGLUniformLocation? location, Int32Array v); - [Infallible] void uniform4iv(WebGLUniformLocation? location, sequence v); - [Infallible] void uniformMatrix2fv(WebGLUniformLocation? location, boolean transpose, Float32Array value); - [Infallible] void uniformMatrix2fv(WebGLUniformLocation? location, boolean transpose, sequence value); - [Infallible] void uniformMatrix3fv(WebGLUniformLocation? location, boolean transpose, Float32Array value); - [Infallible] void uniformMatrix3fv(WebGLUniformLocation? location, boolean transpose, sequence value); - [Infallible] void uniformMatrix4fv(WebGLUniformLocation? location, boolean transpose, Float32Array value); - [Infallible] void uniformMatrix4fv(WebGLUniformLocation? location, boolean transpose, sequence value); - [Infallible] void useProgram(WebGLProgram? program); - [Infallible] void validateProgram(WebGLProgram? program); - [Infallible] void vertexAttrib1f(unsigned long indx, float x); - [Infallible] void vertexAttrib1fv(unsigned long indx, Float32Array values); - [Infallible] void vertexAttrib1fv(unsigned long indx, sequence values); - [Infallible] void vertexAttrib2f(unsigned long indx, float x, float y); - [Infallible] void vertexAttrib2fv(unsigned long indx, Float32Array values); - [Infallible] void vertexAttrib2fv(unsigned long indx, sequence values); - [Infallible] void vertexAttrib3f(unsigned long indx, float x, float y, float z); - [Infallible] void vertexAttrib3fv(unsigned long indx, Float32Array values); - [Infallible] void vertexAttrib3fv(unsigned long indx, sequence values); - [Infallible] void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w); - [Infallible] void vertexAttrib4fv(unsigned long indx, Float32Array values); - [Infallible] void vertexAttrib4fv(unsigned long indx, sequence values); - [Infallible] void vertexAttribPointer(unsigned long indx, long size, unsigned long type, boolean normalized, long stride, long long offset); - [Infallible] void viewport(long x, long y, long width, long height); }; diff --git a/dom/webidl/XMLHttpRequest.webidl b/dom/webidl/XMLHttpRequest.webidl index d83011565e3..a745ce1fbc4 100644 --- a/dom/webidl/XMLHttpRequest.webidl +++ b/dom/webidl/XMLHttpRequest.webidl @@ -68,8 +68,10 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { readonly attribute unsigned short readyState; // request + [Throws] void open(DOMString method, DOMString url, optional boolean async = true, optional DOMString? user, optional DOMString? password); + [Throws] void setRequestHeader(DOMString header, DOMString value); [GetterInfallible] @@ -81,15 +83,22 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { [Infallible=MainThread] readonly attribute XMLHttpRequestUpload upload; + [Throws] void send(); + [Throws] void send(ArrayBuffer data); + [Throws] void send(Blob data); + [Throws] void send(Document data); + [Throws] void send(DOMString? data); + [Throws] void send(FormData data); + [Throws] void send(InputStream data); - [Infallible=MainThread] + [Throws=Workers] void abort(); // response @@ -98,12 +107,13 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { [Infallible] readonly attribute DOMString statusText; + [Throws] DOMString? getResponseHeader(DOMString header); - [Infallible=MainThread] + [Throws=Workers] DOMString getAllResponseHeaders(); - [Infallible=MainThread] + [Throws=Workers] void overrideMimeType(DOMString mime); [GetterInfallible] @@ -124,7 +134,9 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { [ChromeOnly, GetterInfallible] readonly attribute MozChannel channel; + [Throws] void sendAsBinary(DOMString body); + [Throws] any getInterface(IID iid); [Infallible]