author | Boris Zbarsky <bzbarsky@mit.edu> |
Thu, 12 Sep 2019 11:01:17 +0000 | |
changeset 492913 | 9298e3ec3f1ff2caf60deb9471bc2e9f2ebe7948 |
parent 492912 | 7d7af740de08a4d358a1ab5a0bd618f41e2d335c |
child 492914 | 6c961a3deed941c931608297006e251d44a1a801 |
push id | 36569 |
push user | nerli@mozilla.com |
push date | Fri, 13 Sep 2019 04:42:54 +0000 |
treeherder | mozilla-central@9b65c42a8736 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | edgar |
bugs | 1578173 |
milestone | 71.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/ChromeNodeList.cpp +++ b/dom/base/ChromeNodeList.cpp @@ -6,17 +6,17 @@ #include "mozilla/dom/ChromeNodeList.h" #include "mozilla/dom/ChromeNodeListBinding.h" using namespace mozilla; using namespace mozilla::dom; already_AddRefed<ChromeNodeList> ChromeNodeList::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(aGlobal.GetAsSupports()); Document* root = win ? win->GetExtantDoc() : nullptr; RefPtr<ChromeNodeList> list = new ChromeNodeList(root); return list.forget(); } JSObject* ChromeNodeList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
--- a/dom/base/ChromeNodeList.h +++ b/dom/base/ChromeNodeList.h @@ -13,17 +13,17 @@ class ErrorResult; namespace dom { class GlobalObject; class ChromeNodeList final : public nsSimpleContentList { public: explicit ChromeNodeList(nsINode* aOwner) : nsSimpleContentList(aOwner) {} static already_AddRefed<ChromeNodeList> Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv); + const GlobalObject& aGlobal); virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; void Append(nsINode& aNode, ErrorResult& aError); void Remove(nsINode& aNode, ErrorResult& aError); };
--- a/dom/base/DOMException.cpp +++ b/dom/base/DOMException.cpp @@ -353,17 +353,17 @@ void DOMException::ToString(JSContext* a aReturn.AppendPrintf(format, msg, mCode, static_cast<uint32_t>(mResult), resultName, location.get()); } void DOMException::GetName(nsString& retval) { CopyUTF8toUTF16(mName, retval); } already_AddRefed<DOMException> DOMException::Constructor( GlobalObject& /* unused */, const nsAString& aMessage, - const Optional<nsAString>& aName, ErrorResult& aError) { + const Optional<nsAString>& aName) { nsresult exceptionResult = NS_OK; uint16_t exceptionCode = 0; nsCString name(NS_LITERAL_CSTRING("Error")); if (aName.WasPassed()) { CopyUTF16toUTF8(aName.Value(), name); for (uint32_t idx = 0; idx < ArrayLength(sDOMErrorMsgMap); idx++) { if (name.EqualsASCII(sDOMErrorMsgMap[idx].mName)) {
--- a/dom/base/DOMException.h +++ b/dom/base/DOMException.h @@ -142,17 +142,17 @@ class DOMException : public Exception { NS_INLINE_DECL_REFCOUNTING_INHERITED(DOMException, Exception) // nsWrapperCache overrides virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<DOMException> Constructor( GlobalObject& /* unused */, const nsAString& aMessage, - const Optional<nsAString>& aName, ErrorResult& aError); + const Optional<nsAString>& aName); uint16_t Code() const { return mCode; } // Intentionally shadow the Exception version. void GetName(nsString& retval); // Exception overrides void ToString(JSContext* aCx, nsACString& aReturn) override;
--- a/dom/base/DOMPoint.cpp +++ b/dom/base/DOMPoint.cpp @@ -20,18 +20,17 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(D already_AddRefed<DOMPointReadOnly> DOMPointReadOnly::FromPoint( const GlobalObject& aGlobal, const DOMPointInit& aParams) { RefPtr<DOMPointReadOnly> obj = new DOMPointReadOnly( aGlobal.GetAsSupports(), aParams.mX, aParams.mY, aParams.mZ, aParams.mW); return obj.forget(); } already_AddRefed<DOMPointReadOnly> DOMPointReadOnly::Constructor( - const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW, - ErrorResult& aRV) { + const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW) { RefPtr<DOMPointReadOnly> obj = new DOMPointReadOnly(aGlobal.GetAsSupports(), aX, aY, aZ, aW); return obj.forget(); } JSObject* DOMPointReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return DOMPointReadOnly_Binding::Wrap(aCx, this, aGivenProto); @@ -101,18 +100,17 @@ already_AddRefed<DOMPoint> DOMPoint::Fro const DOMPointInit& aParams) { RefPtr<DOMPoint> obj = new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY, aParams.mZ, aParams.mW); return obj.forget(); } already_AddRefed<DOMPoint> DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY, - double aZ, double aW, - ErrorResult& aRV) { + double aZ, double aW) { RefPtr<DOMPoint> obj = new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW); return obj.forget(); } JSObject* DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return DOMPoint_Binding::Wrap(aCx, this, aGivenProto); }
--- a/dom/base/DOMPoint.h +++ b/dom/base/DOMPoint.h @@ -29,18 +29,17 @@ class DOMPointReadOnly : public nsWrappe public: explicit DOMPointReadOnly(nsISupports* aParent, double aX = 0.0, double aY = 0.0, double aZ = 0.0, double aW = 1.0) : mParent(aParent), mX(aX), mY(aY), mZ(aZ), mW(aW) {} static already_AddRefed<DOMPointReadOnly> FromPoint( const GlobalObject& aGlobal, const DOMPointInit& aParams); static already_AddRefed<DOMPointReadOnly> Constructor( - const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW, - ErrorResult& aRV); + const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW); NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPointReadOnly) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPointReadOnly) double X() const { return mX; } double Y() const { return mY; } double Z() const { return mZ; } double W() const { return mW; } @@ -75,17 +74,17 @@ class DOMPoint final : public DOMPointRe explicit DOMPoint(nsISupports* aParent, double aX = 0.0, double aY = 0.0, double aZ = 0.0, double aW = 1.0) : DOMPointReadOnly(aParent, aX, aY, aZ, aW) {} static already_AddRefed<DOMPoint> FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams); static already_AddRefed<DOMPoint> Constructor(const GlobalObject& aGlobal, double aX, double aY, double aZ, - double aW, ErrorResult& aRV); + double aW); virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<DOMPoint> ReadStructuredClone( JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader); using DOMPointReadOnly::ReadStructuredClone;
--- a/dom/base/DOMQuad.cpp +++ b/dom/base/DOMQuad.cpp @@ -59,29 +59,27 @@ already_AddRefed<DOMQuad> DOMQuad::FromQ obj->mPoints[3] = DOMPoint::FromPoint(aGlobal, aInit.mP4); return obj.forget(); } already_AddRefed<DOMQuad> DOMQuad::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aP1, const DOMPointInit& aP2, const DOMPointInit& aP3, - const DOMPointInit& aP4, - ErrorResult& aRV) { + const DOMPointInit& aP4) { RefPtr<DOMQuad> obj = new DOMQuad(aGlobal.GetAsSupports()); obj->mPoints[0] = DOMPoint::FromPoint(aGlobal, aP1); obj->mPoints[1] = DOMPoint::FromPoint(aGlobal, aP2); obj->mPoints[2] = DOMPoint::FromPoint(aGlobal, aP3); obj->mPoints[3] = DOMPoint::FromPoint(aGlobal, aP4); return obj.forget(); } already_AddRefed<DOMQuad> DOMQuad::Constructor(const GlobalObject& aGlobal, - const DOMRectReadOnly& aRect, - ErrorResult& aRV) { + const DOMRectReadOnly& aRect) { CSSPoint points[4]; Float x = aRect.X(), y = aRect.Y(), w = aRect.Width(), h = aRect.Height(); points[0] = CSSPoint(x, y); points[1] = CSSPoint(x + w, y); points[2] = CSSPoint(x + w, y + h); points[3] = CSSPoint(x, y + h); RefPtr<DOMQuad> obj = new DOMQuad(aGlobal.GetAsSupports(), points); return obj.forget();
--- a/dom/base/DOMQuad.h +++ b/dom/base/DOMQuad.h @@ -47,21 +47,19 @@ class DOMQuad final : public nsWrapperCa static already_AddRefed<DOMQuad> FromQuad(const GlobalObject& aGlobal, const DOMQuadInit& aInit); static already_AddRefed<DOMQuad> Constructor(const GlobalObject& aGlobal, const DOMPointInit& aP1, const DOMPointInit& aP2, const DOMPointInit& aP3, - const DOMPointInit& aP4, - ErrorResult& aRV); + const DOMPointInit& aP4); static already_AddRefed<DOMQuad> Constructor(const GlobalObject& aGlobal, - const DOMRectReadOnly& aRect, - ErrorResult& aRV); + const DOMRectReadOnly& aRect); already_AddRefed<DOMRectReadOnly> GetBounds() const; DOMPoint* P1() const { return mPoints[0]; } DOMPoint* P2() const { return mPoints[1]; } DOMPoint* P3() const { return mPoints[2]; } DOMPoint* P4() const { return mPoints[3]; } DOMPoint* Point(uint32_t aIndex) const { return mPoints[aIndex]; }
--- a/dom/base/DOMRect.cpp +++ b/dom/base/DOMRect.cpp @@ -31,17 +31,17 @@ already_AddRefed<DOMRectReadOnly> DOMRec const GlobalObject& aGlobal, const DOMRectInit& aInit) { RefPtr<DOMRectReadOnly> obj = new DOMRectReadOnly( aGlobal.GetAsSupports(), aInit.mX, aInit.mY, aInit.mWidth, aInit.mHeight); return obj.forget(); } already_AddRefed<DOMRectReadOnly> DOMRectReadOnly::Constructor( const GlobalObject& aGlobal, double aX, double aY, double aWidth, - double aHeight, ErrorResult& aRv) { + double aHeight) { RefPtr<DOMRectReadOnly> obj = new DOMRectReadOnly(aGlobal.GetAsSupports(), aX, aY, aWidth, aHeight); return obj.forget(); } // https://drafts.fxtf.org/geometry/#structured-serialization bool DOMRectReadOnly::WriteStructuredClone( JSContext* aCx, JSStructuredCloneWriter* aWriter) const { @@ -98,18 +98,17 @@ already_AddRefed<DOMRect> DOMRect::FromR const DOMRectInit& aInit) { RefPtr<DOMRect> obj = new DOMRect(aGlobal.GetAsSupports(), aInit.mX, aInit.mY, aInit.mWidth, aInit.mHeight); return obj.forget(); } already_AddRefed<DOMRect> DOMRect::Constructor(const GlobalObject& aGlobal, double aX, double aY, - double aWidth, double aHeight, - ErrorResult& aRv) { + double aWidth, double aHeight) { RefPtr<DOMRect> obj = new DOMRect(aGlobal.GetAsSupports(), aX, aY, aWidth, aHeight); return obj.forget(); } // static already_AddRefed<DOMRect> DOMRect::ReadStructuredClone( JSContext* aCx, nsIGlobalObject* aGlobal,
--- a/dom/base/DOMRect.h +++ b/dom/base/DOMRect.h @@ -45,17 +45,17 @@ class DOMRectReadOnly : public nsISuppor virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<DOMRectReadOnly> FromRect(const GlobalObject& aGlobal, const DOMRectInit& aInit); static already_AddRefed<DOMRectReadOnly> Constructor( const GlobalObject& aGlobal, double aX, double aY, double aWidth, - double aHeight, ErrorResult& aRv); + double aHeight); double X() const { return mX; } double Y() const { return mY; } double Width() const { return mWidth; } double Height() const { return mHeight; } double Left() const { double x = X(), w = Width(); @@ -98,18 +98,17 @@ class DOMRect final : public DOMRectRead NS_INLINE_DECL_REFCOUNTING_INHERITED(DOMRect, DOMRectReadOnly) static already_AddRefed<DOMRect> FromRect(const GlobalObject& aGlobal, const DOMRectInit& aInit); static already_AddRefed<DOMRect> Constructor(const GlobalObject& aGlobal, double aX, double aY, - double aWidth, double aHeight, - ErrorResult& aRv); + double aWidth, double aHeight); virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<DOMRect> ReadStructuredClone( JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader); using DOMRectReadOnly::ReadStructuredClone;
--- a/dom/base/StructuredCloneTester.cpp +++ b/dom/base/StructuredCloneTester.cpp @@ -31,17 +31,17 @@ StructuredCloneTester::StructuredCloneTe const bool aDeserializable) : mParent(aParent), mSerializable(aSerializable), mDeserializable(aDeserializable) {} /* static */ already_AddRefed<StructuredCloneTester> StructuredCloneTester::Constructor( const GlobalObject& aGlobal, const bool aSerializable, - const bool aDeserializable, ErrorResult& aRv) { + const bool aDeserializable) { RefPtr<StructuredCloneTester> sct = new StructuredCloneTester( aGlobal.GetAsSupports(), aSerializable, aDeserializable); return sct.forget(); } bool StructuredCloneTester::Serializable() const { return mSerializable; } bool StructuredCloneTester::Deserializable() const { return mDeserializable; }
--- a/dom/base/StructuredCloneTester.h +++ b/dom/base/StructuredCloneTester.h @@ -26,17 +26,17 @@ class GlobalObject; class StructuredCloneTester final : public nsISupports, public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StructuredCloneTester) static already_AddRefed<StructuredCloneTester> Constructor( const GlobalObject& aGlobal, const bool aSerializable, - const bool aDeserializable, ErrorResult& aRv); + const bool aDeserializable); bool Serializable() const; bool Deserializable() const; static already_AddRefed<StructuredCloneTester> ReadStructuredClone( JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader);
--- a/dom/base/nsDOMSerializer.h +++ b/dom/base/nsDOMSerializer.h @@ -14,18 +14,18 @@ class nsINode; class nsIOutputStream; class nsDOMSerializer final : public mozilla::dom::NonRefcountedDOMObject { public: nsDOMSerializer(); // WebIDL API - static nsDOMSerializer* Constructor(const mozilla::dom::GlobalObject& aOwner, - mozilla::ErrorResult& rv) { + static nsDOMSerializer* Constructor( + const mozilla::dom::GlobalObject& aOwner) { return new nsDOMSerializer(); } void SerializeToString(nsINode& aRoot, nsAString& aStr, mozilla::ErrorResult& rv); void SerializeToStream(nsINode& aRoot, nsIOutputStream* aStream, const nsAString& aCharset, mozilla::ErrorResult& aRv);
--- a/dom/bindings/test/TestFunctions.cpp +++ b/dom/bindings/test/TestFunctions.cpp @@ -11,18 +11,17 @@ #include "nsStringBuffer.h" #include "mozITestInterfaceJS.h" #include "nsComponentManagerUtils.h" namespace mozilla { namespace dom { /* static */ -TestFunctions* TestFunctions::Constructor(GlobalObject& aGlobal, - ErrorResult& aRv) { +TestFunctions* TestFunctions::Constructor(GlobalObject& aGlobal) { return new TestFunctions; } /* static */ void TestFunctions::ThrowUncatchableException(GlobalObject& aGlobal, ErrorResult& aRv) { aRv.ThrowUncatchableException(); }
--- a/dom/bindings/test/TestFunctions.h +++ b/dom/bindings/test/TestFunctions.h @@ -16,17 +16,17 @@ namespace mozilla { namespace dom { class Promise; class PromiseReturner; class WrapperCachedNonISupportsTestInterface; class TestFunctions : public NonRefcountedDOMObject { public: - static TestFunctions* Constructor(GlobalObject& aGlobal, ErrorResult& aRv); + static TestFunctions* Constructor(GlobalObject& aGlobal); static void ThrowUncatchableException(GlobalObject& aGlobal, ErrorResult& aRv); static Promise* PassThroughPromise(GlobalObject& aGlobal, Promise& aPromise); MOZ_CAN_RUN_SCRIPT static already_AddRefed<Promise> PassThroughCallbackPromise(
--- a/dom/canvas/CanvasPath.h +++ b/dom/canvas/CanvasPath.h @@ -23,24 +23,21 @@ class CanvasPath final : public nsWrappe NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath) nsCOMPtr<nsISupports> GetParentObject() { return mParent; } JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; - static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, - ErrorResult& rv); + static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal); static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, - CanvasPath& aCanvasPath, - ErrorResult& rv); + CanvasPath& aCanvasPath); static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, - const nsAString& aPathString, - ErrorResult& rv); + const nsAString& aPathString); void ClosePath(); void MoveTo(double x, double y); void LineTo(double x, double y); void QuadraticCurveTo(double cpx, double cpy, double x, double y); void BezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); void ArcTo(double x1, double y1, double x2, double y2, double radius,
--- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -5455,38 +5455,37 @@ CanvasPath::CanvasPath(nsISupports* aPar } JSObject* CanvasPath::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return Path2D_Binding::Wrap(aCx, this, aGivenProto); } already_AddRefed<CanvasPath> CanvasPath::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<CanvasPath> path = new CanvasPath(aGlobal.GetAsSupports()); return path.forget(); } already_AddRefed<CanvasPath> CanvasPath::Constructor( - const GlobalObject& aGlobal, CanvasPath& aCanvasPath, ErrorResult& aRv) { + const GlobalObject& aGlobal, CanvasPath& aCanvasPath) { RefPtr<gfx::Path> tempPath = aCanvasPath.GetPath( CanvasWindingRule::Nonzero, gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get()); RefPtr<CanvasPath> path = new CanvasPath(aGlobal.GetAsSupports(), tempPath->CopyToBuilder()); return path.forget(); } already_AddRefed<CanvasPath> CanvasPath::Constructor( - const GlobalObject& aGlobal, const nsAString& aPathString, - ErrorResult& aRv) { + const GlobalObject& aGlobal, const nsAString& aPathString) { RefPtr<gfx::Path> tempPath = SVGContentUtils::GetPath(aPathString); if (!tempPath) { - return Constructor(aGlobal, aRv); + return Constructor(aGlobal); } RefPtr<CanvasPath> path = new CanvasPath(aGlobal.GetAsSupports(), tempPath->CopyToBuilder()); return path.forget(); } void CanvasPath::ClosePath() {
--- a/dom/canvas/OffscreenCanvas.cpp +++ b/dom/canvas/OffscreenCanvas.cpp @@ -52,18 +52,17 @@ OffscreenCanvas::~OffscreenCanvas() { Cl JSObject* OffscreenCanvas::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return OffscreenCanvas_Binding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed<OffscreenCanvas> OffscreenCanvas::Constructor( - const GlobalObject& aGlobal, uint32_t aWidth, uint32_t aHeight, - ErrorResult& aRv) { + const GlobalObject& aGlobal, uint32_t aWidth, uint32_t aHeight) { nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr<OffscreenCanvas> offscreenCanvas = new OffscreenCanvas( global, aWidth, aHeight, layers::LayersBackend::LAYERS_NONE, nullptr); return offscreenCanvas.forget(); } void OffscreenCanvas::ClearResources() { if (mCanvasClient) {
--- a/dom/canvas/OffscreenCanvas.h +++ b/dom/canvas/OffscreenCanvas.h @@ -60,18 +60,17 @@ class OffscreenCanvas final : public DOM layers::AsyncCanvasRenderer* aRenderer); nsCOMPtr<nsIGlobalObject> GetParentObject() const { return GetOwnerGlobal(); } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<OffscreenCanvas> Constructor( - const GlobalObject& aGlobal, uint32_t aWidth, uint32_t aHeight, - ErrorResult& aRv); + const GlobalObject& aGlobal, uint32_t aWidth, uint32_t aHeight); void ClearResources(); uint32_t Width() const { return mWidth; } uint32_t Height() const { return mHeight; } void SetWidth(uint32_t aWidth, ErrorResult& aRv) {
--- a/dom/encoding/TextEncoder.cpp +++ b/dom/encoding/TextEncoder.cpp @@ -7,18 +7,16 @@ #include "mozilla/dom/TextEncoder.h" #include "mozilla/CheckedInt.h" #include "mozilla/UniquePtrExtensions.h" #include "nsReadableUtils.h" namespace mozilla { namespace dom { -void TextEncoder::Init() {} - void TextEncoder::Encode(JSContext* aCx, JS::Handle<JSObject*> aObj, const nsAString& aString, JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv) { // Given nsTSubstring<char16_t>::kMaxCapacity, it should be // impossible for the length computation to overflow, but // let's use checked math in case someone changes something // in the future.
--- a/dom/encoding/TextEncoder.h +++ b/dom/encoding/TextEncoder.h @@ -16,35 +16,29 @@ namespace mozilla { class ErrorResult; namespace dom { class TextEncoder final : public NonRefcountedDOMObject { public: // The WebIDL constructor. - static TextEncoder* Constructor(const GlobalObject& aGlobal, - ErrorResult& aRv) { - nsAutoPtr<TextEncoder> txtEncoder(new TextEncoder()); - txtEncoder->Init(); - return txtEncoder.forget(); + static TextEncoder* Constructor(const GlobalObject& aGlobal) { + return new TextEncoder(); } TextEncoder() {} virtual ~TextEncoder() {} bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) { return TextEncoder_Binding::Wrap(aCx, this, aGivenProto, aReflector); } - protected: - void Init(); - public: /** * Return the encoding name. * * @param aEncoding, current encoding. */ void GetEncoding(nsAString& aEncoding);
--- a/dom/events/DataTransfer.cpp +++ b/dom/events/DataTransfer.cpp @@ -231,17 +231,17 @@ DataTransfer::DataTransfer(nsISupports* NS_ASSERTION(aEventMessage != eDragStart, "invalid event type for DataTransfer constructor"); } DataTransfer::~DataTransfer() {} // static already_AddRefed<DataTransfer> DataTransfer::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<DataTransfer> transfer = new DataTransfer(aGlobal.GetAsSupports(), eCopy, /* is external */ false, /* clipboard type */ -1); transfer->mEffectAllowed = nsIDragService::DRAGDROP_ACTION_NONE; return transfer.forget(); } JSObject* DataTransfer::WrapObject(JSContext* aCx,
--- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -110,18 +110,18 @@ class DataTransfer final : public nsISup void SetParentObject(nsISupports* aNewParent) { MOZ_ASSERT(aNewParent); // Setting the parent after we've been wrapped is pointless, so // make sure we aren't wrapped yet. MOZ_ASSERT(!GetWrapperPreserveColor()); mParent = aNewParent; } - static already_AddRefed<DataTransfer> Constructor(const GlobalObject& aGlobal, - ErrorResult& aRv); + static already_AddRefed<DataTransfer> Constructor( + const GlobalObject& aGlobal); /** * The actual effect that will be used, and should always be one of the * possible values of effectAllowed. * * For dragstart, drag and dragleave events, the dropEffect is initialized * to none. Any value assigned to the dropEffect will be set, but the value * isn't used for anything.
--- a/dom/events/SpeechRecognitionError.cpp +++ b/dom/events/SpeechRecognitionError.cpp @@ -13,17 +13,17 @@ SpeechRecognitionError::SpeechRecognitio mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, WidgetEvent* aEvent) : Event(aOwner, aPresContext, aEvent), mError() {} SpeechRecognitionError::~SpeechRecognitionError() {} already_AddRefed<SpeechRecognitionError> SpeechRecognitionError::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, ErrorResult& aRv) { + const SpeechRecognitionErrorInit& aParam) { nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr<SpeechRecognitionError> e = new SpeechRecognitionError(t, nullptr, nullptr); bool trusted = e->Init(t); e->InitSpeechRecognitionError(aType, aParam.mBubbles, aParam.mCancelable, aParam.mError, aParam.mMessage); e->SetTrusted(trusted);
--- a/dom/events/SpeechRecognitionError.h +++ b/dom/events/SpeechRecognitionError.h @@ -16,17 +16,17 @@ namespace dom { class SpeechRecognitionError : public Event { public: SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, WidgetEvent* aEvent); virtual ~SpeechRecognitionError(); static already_AddRefed<SpeechRecognitionError> Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, ErrorResult& aRv); + const SpeechRecognitionErrorInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override { return mozilla::dom::SpeechRecognitionError_Binding::Wrap(aCx, this, aGivenProto); } void GetMessage(nsAString& aString) { aString = mMessage; }
--- a/dom/events/Touch.cpp +++ b/dom/events/Touch.cpp @@ -12,18 +12,17 @@ #include "nsContentUtils.h" #include "nsIContent.h" namespace mozilla { namespace dom { // static already_AddRefed<Touch> Touch::Constructor(const GlobalObject& aGlobal, - const TouchInit& aParam, - ErrorResult& aRv) { + const TouchInit& aParam) { // Annoyingly many parameters, make sure the ordering is the same as in the // Touch constructor. RefPtr<Touch> touch = new Touch( aParam.mTarget, aParam.mIdentifier, aParam.mPageX, aParam.mPageY, aParam.mScreenX, aParam.mScreenY, aParam.mClientX, aParam.mClientY, aParam.mRadiusX, aParam.mRadiusY, aParam.mRotationAngle, aParam.mForce); return touch.forget(); }
--- a/dom/events/Touch.h +++ b/dom/events/Touch.h @@ -24,18 +24,17 @@ class EventTarget; class Touch final : public nsISupports, public nsWrapperCache, public WidgetPointerHelper { public: static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal); static already_AddRefed<Touch> Constructor(const GlobalObject& aGlobal, - const TouchInit& aParam, - ErrorResult& aRv); + const TouchInit& aParam); Touch(EventTarget* aTarget, int32_t aIdentifier, int32_t aPageX, int32_t aPageY, int32_t aScreenX, int32_t aScreenY, int32_t aClientX, int32_t aClientY, int32_t aRadiusX, int32_t aRadiusY, float aRotationAngle, float aForce); Touch(int32_t aIdentifier, LayoutDeviceIntPoint aPoint, LayoutDeviceIntPoint aRadius, float aRotationAngle, float aForce); Touch(const Touch& aOther);
--- a/dom/file/FileReader.cpp +++ b/dom/file/FileReader.cpp @@ -115,17 +115,17 @@ FileReader::FileReader(nsIGlobalObject* FileReader::~FileReader() { Shutdown(); DropJSObjects(this); } /* static */ already_AddRefed<FileReader> FileReader::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr<WeakWorkerRef> workerRef; if (!NS_IsMainThread()) { JSContext* cx = aGlobal.Context(); WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(cx); workerRef = WeakWorkerRef::Create(workerPrivate);
--- a/dom/file/FileReader.h +++ b/dom/file/FileReader.h @@ -64,18 +64,17 @@ class FileReader final : public DOMEvent NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(FileReader, DOMEventTargetHelper) virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; // WebIDL - static already_AddRefed<FileReader> Constructor(const GlobalObject& aGlobal, - ErrorResult& aRv); + static already_AddRefed<FileReader> Constructor(const GlobalObject& aGlobal); void ReadAsArrayBuffer(JSContext* aCx, Blob& aBlob, ErrorResult& aRv) { ReadFileContent(aBlob, EmptyString(), FILE_AS_ARRAYBUFFER, aRv); } void ReadAsText(Blob& aBlob, const Optional<nsAString>& aLabel, ErrorResult& aRv) { if (aLabel.WasPassed()) { ReadFileContent(aBlob, aLabel.Value(), FILE_AS_TEXT, aRv);
--- a/dom/file/FileReaderSync.cpp +++ b/dom/file/FileReaderSync.cpp @@ -32,17 +32,17 @@ using namespace mozilla; using namespace mozilla::dom; using mozilla::dom::GlobalObject; using mozilla::dom::Optional; // static already_AddRefed<FileReaderSync> FileReaderSync::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<FileReaderSync> frs = new FileReaderSync(); return frs.forget(); } bool FileReaderSync::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) {
--- a/dom/file/FileReaderSync.h +++ b/dom/file/FileReaderSync.h @@ -34,17 +34,17 @@ class FileReaderSync final { uint64_t aStreamSize, already_AddRefed<nsIInputStream> aAsyncStream, nsIInputStream** aSyncStream); nsresult SyncRead(nsIInputStream* aStream, char* aBuffer, uint32_t aBufferSize, uint32_t* aRead); public: static already_AddRefed<FileReaderSync> Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv); + const GlobalObject& aGlobal); bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); void ReadAsArrayBuffer(JSContext* aCx, JS::Handle<JSObject*> aScopeObj, Blob& aBlob, JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv); void ReadAsBinaryString(Blob& aBlob, nsAString& aResult, ErrorResult& aRv);
--- a/dom/media/webaudio/AudioBufferSourceNode.cpp +++ b/dom/media/webaudio/AudioBufferSourceNode.cpp @@ -601,17 +601,17 @@ AudioBufferSourceNode::AudioBufferSource aContext->Graph()); engine->SetSourceStream(mStream); mStream->AddMainThreadListener(this); } /* static */ already_AddRefed<AudioBufferSourceNode> AudioBufferSourceNode::Create( JSContext* aCx, AudioContext& aAudioContext, - const AudioBufferSourceOptions& aOptions, ErrorResult& aRv) { + const AudioBufferSourceOptions& aOptions) { RefPtr<AudioBufferSourceNode> audioNode = new AudioBufferSourceNode(&aAudioContext); if (aOptions.mBuffer.WasPassed()) { MOZ_ASSERT(aCx); audioNode->SetBuffer(aCx, aOptions.mBuffer.Value()); }
--- a/dom/media/webaudio/AudioBufferSourceNode.h +++ b/dom/media/webaudio/AudioBufferSourceNode.h @@ -16,30 +16,30 @@ namespace dom { struct AudioBufferSourceOptions; class AudioParam; class AudioBufferSourceNode final : public AudioScheduledSourceNode, public MainThreadMediaStreamListener { public: static already_AddRefed<AudioBufferSourceNode> Create( JSContext* aCx, AudioContext& aAudioContext, - const AudioBufferSourceOptions& aOptions, ErrorResult& aRv); + const AudioBufferSourceOptions& aOptions); void DestroyMediaStream() override; uint16_t NumberOfInputs() const final { return 0; } AudioBufferSourceNode* AsAudioBufferSourceNode() override { return this; } NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode, AudioScheduledSourceNode) static already_AddRefed<AudioBufferSourceNode> Constructor( const GlobalObject& aGlobal, AudioContext& aAudioContext, - const AudioBufferSourceOptions& aOptions, ErrorResult& aRv) { - return Create(aGlobal.Context(), aAudioContext, aOptions, aRv); + const AudioBufferSourceOptions& aOptions) { + return Create(aGlobal.Context(), aAudioContext, aOptions); } JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; void Start(double aWhen, double aOffset, const Optional<double>& aDuration, ErrorResult& aRv);
--- a/dom/media/webaudio/AudioContext.cpp +++ b/dom/media/webaudio/AudioContext.cpp @@ -326,24 +326,22 @@ already_AddRefed<AudioContext> AudioCont RefPtr<AudioContext> object = new AudioContext(window, true, aNumberOfChannels, aLength, aSampleRate); RegisterWeakMemoryReporter(object); return object.forget(); } -already_AddRefed<AudioBufferSourceNode> AudioContext::CreateBufferSource( - ErrorResult& aRv) { +already_AddRefed<AudioBufferSourceNode> AudioContext::CreateBufferSource() { return AudioBufferSourceNode::Create(nullptr, *this, - AudioBufferSourceOptions(), aRv); + AudioBufferSourceOptions()); } -already_AddRefed<ConstantSourceNode> AudioContext::CreateConstantSource( - ErrorResult& aRv) { +already_AddRefed<ConstantSourceNode> AudioContext::CreateConstantSource() { RefPtr<ConstantSourceNode> constantSourceNode = new ConstantSourceNode(this); return constantSourceNode.forget(); } already_AddRefed<AudioBuffer> AudioContext::CreateBuffer( uint32_t aNumberOfChannels, uint32_t aLength, float aSampleRate, ErrorResult& aRv) { if (!aNumberOfChannels) {
--- a/dom/media/webaudio/AudioContext.h +++ b/dom/media/webaudio/AudioContext.h @@ -226,19 +226,19 @@ class AudioContext final : public DOMEve IMPL_EVENT_HANDLER(statechange) // These two functions are similar with Suspend() and Resume(), the difference // is they are designed for calling from chrome side, not content side. eg. // calling from inner window, so we won't need to return promise for caller. void SuspendFromChrome(); void ResumeFromChrome(); - already_AddRefed<AudioBufferSourceNode> CreateBufferSource(ErrorResult& aRv); + already_AddRefed<AudioBufferSourceNode> CreateBufferSource(); - already_AddRefed<ConstantSourceNode> CreateConstantSource(ErrorResult& aRv); + already_AddRefed<ConstantSourceNode> CreateConstantSource(); already_AddRefed<AudioBuffer> CreateBuffer(uint32_t aNumberOfChannels, uint32_t aLength, float aSampleRate, ErrorResult& aRv); already_AddRefed<MediaStreamAudioDestinationNode> CreateMediaStreamDestination(ErrorResult& aRv);
--- a/dom/media/webaudio/AudioWorkletProcessor.cpp +++ b/dom/media/webaudio/AudioWorkletProcessor.cpp @@ -19,18 +19,17 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Au NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AudioWorkletProcessor, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AudioWorkletProcessor, Release) AudioWorkletProcessor::AudioWorkletProcessor(nsIGlobalObject* aParent) : mParent(aParent) {} /* static */ already_AddRefed<AudioWorkletProcessor> AudioWorkletProcessor::Constructor( - const GlobalObject& aGlobal, const AudioWorkletNodeOptions& aOptions, - ErrorResult& aRv) { + const GlobalObject& aGlobal, const AudioWorkletNodeOptions& aOptions) { nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports()); MOZ_ASSERT(global); RefPtr<AudioWorkletProcessor> audioWorkletProcessor = new AudioWorkletProcessor(global); return audioWorkletProcessor.forget(); }
--- a/dom/media/webaudio/AudioWorkletProcessor.h +++ b/dom/media/webaudio/AudioWorkletProcessor.h @@ -23,18 +23,17 @@ class GlobalObject; class MessagePort; class AudioWorkletProcessor final : public nsWrapperCache { public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioWorkletProcessor) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioWorkletProcessor) static already_AddRefed<AudioWorkletProcessor> Constructor( - const GlobalObject& aGlobal, const AudioWorkletNodeOptions& aOptions, - ErrorResult& aRv); + const GlobalObject& aGlobal, const AudioWorkletNodeOptions& aOptions); nsIGlobalObject* GetParentObject() const { return mParent; } JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; MessagePort* GetPort(ErrorResult& aRv) const;
--- a/dom/media/webaudio/ConstantSourceNode.cpp +++ b/dom/media/webaudio/ConstantSourceNode.cpp @@ -184,17 +184,17 @@ size_t ConstantSourceNode::SizeOfIncludi JSObject* ConstantSourceNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return ConstantSourceNode_Binding::Wrap(aCx, this, aGivenProto); } already_AddRefed<ConstantSourceNode> ConstantSourceNode::Constructor( const GlobalObject& aGlobal, AudioContext& aContext, - const ConstantSourceOptions& aOptions, ErrorResult& aRv) { + const ConstantSourceOptions& aOptions) { RefPtr<ConstantSourceNode> object = new ConstantSourceNode(&aContext); object->mOffset->SetValue(aOptions.mOffset); return object.forget(); } void ConstantSourceNode::DestroyMediaStream() { if (mStream) { mStream->RemoveMainThreadListener(this);
--- a/dom/media/webaudio/ConstantSourceNode.h +++ b/dom/media/webaudio/ConstantSourceNode.h @@ -25,17 +25,17 @@ class ConstantSourceNode final : public NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConstantSourceNode, AudioScheduledSourceNode) JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<ConstantSourceNode> Constructor( const GlobalObject& aGlobal, AudioContext& aContext, - const ConstantSourceOptions& aOptions, ErrorResult& aRv); + const ConstantSourceOptions& aOptions); void DestroyMediaStream() override; uint16_t NumberOfInputs() const final { return 0; } AudioParam* Offset() const { return mOffset; } void Start(double aWhen, ErrorResult& rv) override;
--- a/dom/media/webspeech/recognition/SpeechGrammar.cpp +++ b/dom/media/webspeech/recognition/SpeechGrammar.cpp @@ -19,17 +19,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END SpeechGrammar::SpeechGrammar(nsISupports* aParent) : mParent(aParent) {} SpeechGrammar::~SpeechGrammar() = default; already_AddRefed<SpeechGrammar> SpeechGrammar::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<SpeechGrammar> speechGrammar = new SpeechGrammar(aGlobal.GetAsSupports()); return speechGrammar.forget(); } nsISupports* SpeechGrammar::GetParentObject() const { return mParent; } JSObject* SpeechGrammar::WrapObject(JSContext* aCx,
--- a/dom/media/webspeech/recognition/SpeechGrammar.h +++ b/dom/media/webspeech/recognition/SpeechGrammar.h @@ -29,17 +29,17 @@ class SpeechGrammar final : public nsISu NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammar) nsISupports* GetParentObject() const; JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; static already_AddRefed<SpeechGrammar> Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv); + const GlobalObject& aGlobal); void GetSrc(nsString& aRetVal, ErrorResult& aRv) const; void SetSrc(const nsAString& aArg, ErrorResult& aRv); float GetWeight(ErrorResult& aRv) const; void SetWeight(float aArg, ErrorResult& aRv);
--- a/dom/media/webspeech/recognition/SpeechGrammarList.cpp +++ b/dom/media/webspeech/recognition/SpeechGrammarList.cpp @@ -22,17 +22,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END SpeechGrammarList::SpeechGrammarList(nsISupports* aParent) : mParent(aParent) {} SpeechGrammarList::~SpeechGrammarList() = default; already_AddRefed<SpeechGrammarList> SpeechGrammarList::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<SpeechGrammarList> speechGrammarList = new SpeechGrammarList(aGlobal.GetAsSupports()); return speechGrammarList.forget(); } JSObject* SpeechGrammarList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return SpeechGrammarList_Binding::Wrap(aCx, this, aGivenProto);
--- a/dom/media/webspeech/recognition/SpeechGrammarList.h +++ b/dom/media/webspeech/recognition/SpeechGrammarList.h @@ -28,17 +28,17 @@ class Optional; class SpeechGrammarList final : public nsISupports, public nsWrapperCache { public: explicit SpeechGrammarList(nsISupports* aParent); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammarList) static already_AddRefed<SpeechGrammarList> Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv); + const GlobalObject& aGlobal); nsISupports* GetParentObject() const; JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; uint32_t Length() const;
--- a/dom/reporting/TestingDeprecatedInterface.cpp +++ b/dom/reporting/TestingDeprecatedInterface.cpp @@ -16,18 +16,17 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(Testing NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestingDeprecatedInterface) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END /* static */ already_AddRefed<TestingDeprecatedInterface> -TestingDeprecatedInterface::Constructor(const GlobalObject& aGlobal, - ErrorResult& aRv) { +TestingDeprecatedInterface::Constructor(const GlobalObject& aGlobal) { nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports()); MOZ_ASSERT(global); RefPtr<TestingDeprecatedInterface> obj = new TestingDeprecatedInterface(global); return obj.forget(); }
--- a/dom/reporting/TestingDeprecatedInterface.h +++ b/dom/reporting/TestingDeprecatedInterface.h @@ -17,17 +17,17 @@ namespace dom { class TestingDeprecatedInterface final : public nsISupports, public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestingDeprecatedInterface) static already_AddRefed<TestingDeprecatedInterface> Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv); + const GlobalObject& aGlobal); JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; nsIGlobalObject* GetParentObject() const { return mGlobal; } void DeprecatedMethod() const;
--- a/dom/vr/VRDisplay.cpp +++ b/dom/vr/VRDisplay.cpp @@ -669,17 +669,17 @@ VRFrameData::VRFrameData(nsISupports* aP mozilla::HoldJSObjects(this); mPose = new VRPose(aParent); } VRFrameData::~VRFrameData() { mozilla::DropJSObjects(this); } /* static */ already_AddRefed<VRFrameData> VRFrameData::Constructor( - const GlobalObject& aGlobal, ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<VRFrameData> obj = new VRFrameData(aGlobal.GetAsSupports()); return obj.forget(); } JSObject* VRFrameData::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return VRFrameData_Binding::Wrap(aCx, this, aGivenProto); }
--- a/dom/vr/VRDisplay.h +++ b/dom/vr/VRDisplay.h @@ -150,18 +150,17 @@ struct VRFrameInfo { }; class VRFrameData final : public nsWrapperCache { public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRFrameData) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRFrameData) explicit VRFrameData(nsISupports* aParent); - static already_AddRefed<VRFrameData> Constructor(const GlobalObject& aGlobal, - ErrorResult& aRv); + static already_AddRefed<VRFrameData> Constructor(const GlobalObject& aGlobal); void Update(const VRFrameInfo& aFrameInfo); // WebIDL Members double Timestamp() const; void GetLeftProjectionMatrix(JSContext* aCx, JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv);
--- a/dom/webidl/AbortController.webidl +++ b/dom/webidl/AbortController.webidl @@ -2,14 +2,17 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * https://dom.spec.whatwg.org/#abortcontroller */ -[Constructor(), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface AbortController { + [Throws] + constructor(); + readonly attribute AbortSignal signal; void abort(); };
--- a/dom/webidl/AnalyserNode.webidl +++ b/dom/webidl/AnalyserNode.webidl @@ -12,19 +12,21 @@ dictionary AnalyserOptions : AudioNodeOptions { unsigned long fftSize = 2048; double maxDecibels = -30; double minDecibels = -100; double smoothingTimeConstant = 0.8; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional AnalyserOptions options = {})] +[Pref="dom.webaudio.enabled"] interface AnalyserNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional AnalyserOptions options = {}); // Real-time frequency-domain data void getFloatFrequencyData(Float32Array array); void getByteFrequencyData(Uint8Array array); // Real-time waveform data void getFloatTimeDomainData(Float32Array array); void getByteTimeDomainData(Uint8Array array);
--- a/dom/webidl/Animation.webidl +++ b/dom/webidl/Animation.webidl @@ -9,19 +9,21 @@ * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ enum AnimationPlayState { "idle", "running", "paused", "finished" }; enum AnimationReplaceState { "active", "removed", "persisted" }; -[Constructor(optional AnimationEffect? effect = null, - optional AnimationTimeline? timeline)] interface Animation : EventTarget { + [Throws] + constructor(optional AnimationEffect? effect = null, + optional AnimationTimeline? timeline); + attribute DOMString id; [Func="Document::IsWebAnimationsEnabled", Pure] attribute AnimationEffect? effect; [Func="Document::AreWebAnimationsTimelinesEnabled"] attribute AnimationTimeline? timeline; [BinaryName="startTimeAsDouble"] attribute double? startTime; [SetterThrows, BinaryName="currentTimeAsDouble"]
--- a/dom/webidl/AudioBuffer.webidl +++ b/dom/webidl/AudioBuffer.webidl @@ -11,19 +11,20 @@ */ dictionary AudioBufferOptions { unsigned long numberOfChannels = 1; required unsigned long length; required float sampleRate; }; -[Pref="dom.webaudio.enabled", - Constructor(AudioBufferOptions options)] +[Pref="dom.webaudio.enabled"] interface AudioBuffer { + [Throws] + constructor(AudioBufferOptions options); readonly attribute float sampleRate; readonly attribute unsigned long length; // in seconds readonly attribute double duration; readonly attribute unsigned long numberOfChannels;
--- a/dom/webidl/AudioBufferSourceNode.webidl +++ b/dom/webidl/AudioBufferSourceNode.webidl @@ -14,19 +14,20 @@ dictionary AudioBufferSourceOptions { AudioBuffer? buffer; float detune = 0; boolean loop = false; double loopEnd = 0; double loopStart = 0; float playbackRate = 1; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options = {})] +[Pref="dom.webaudio.enabled"] interface AudioBufferSourceNode : AudioScheduledSourceNode { + constructor(BaseAudioContext context, + optional AudioBufferSourceOptions options = {}); attribute AudioBuffer? buffer; readonly attribute AudioParam playbackRate; readonly attribute AudioParam detune; attribute boolean loop; attribute double loopStart;
--- a/dom/webidl/AudioContext.webidl +++ b/dom/webidl/AudioContext.webidl @@ -14,19 +14,20 @@ dictionary AudioContextOptions { float sampleRate = 0; }; dictionary AudioTimestamp { double contextTime; DOMHighResTimeStamp performanceTime; }; -[Pref="dom.webaudio.enabled", - Constructor(optional AudioContextOptions contextOptions = {})] +[Pref="dom.webaudio.enabled"] interface AudioContext : BaseAudioContext { + [Throws] + constructor(optional AudioContextOptions contextOptions = {}); readonly attribute double baseLatency; readonly attribute double outputLatency; AudioTimestamp getOutputTimestamp(); [Throws] Promise<void> suspend(); [Throws]
--- a/dom/webidl/AudioWorkletNode.webidl +++ b/dom/webidl/AudioWorkletNode.webidl @@ -13,17 +13,20 @@ dictionary AudioWorkletNodeOptions : AudioNodeOptions { unsigned long numberOfInputs = 1; unsigned long numberOfOutputs = 1; sequence<unsigned long> outputChannelCount; record<DOMString, double> parameterData; object? processorOptions = null; }; -[SecureContext, Pref="dom.audioworklet.enabled", - Constructor (BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options = {})] +[SecureContext, Pref="dom.audioworklet.enabled"] interface AudioWorkletNode : AudioNode { [Throws] + constructor(BaseAudioContext context, DOMString name, + optional AudioWorkletNodeOptions options = {}); + + [Throws] readonly attribute AudioParamMap parameters; [Throws] readonly attribute MessagePort port; attribute EventHandler onprocessorerror; };
--- a/dom/webidl/AudioWorkletProcessor.webidl +++ b/dom/webidl/AudioWorkletProcessor.webidl @@ -5,14 +5,15 @@ * * The origin of this IDL file is * https://webaudio.github.io/web-audio-api/#audioworkletprocessor * * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Exposed=AudioWorklet, - Constructor (optional AudioWorkletNodeOptions options = {})] +[Exposed=AudioWorklet] interface AudioWorkletProcessor { + constructor(optional AudioWorkletNodeOptions options = {}); + [Throws] readonly attribute MessagePort port; };
--- a/dom/webidl/BaseAudioContext.webidl +++ b/dom/webidl/BaseAudioContext.webidl @@ -39,20 +39,20 @@ interface BaseAudioContext : EventTarget float sampleRate); [Throws] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional DecodeSuccessCallback successCallback, optional DecodeErrorCallback errorCallback); // AudioNode creation - [NewObject, Throws] + [NewObject] AudioBufferSourceNode createBufferSource(); - [NewObject, Throws] + [NewObject] ConstantSourceNode createConstantSource(); [NewObject, Throws] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, optional unsigned long numberOfInputChannels = 2, optional unsigned long numberOfOutputChannels = 2); [NewObject, Throws]
--- a/dom/webidl/BiquadFilterNode.webidl +++ b/dom/webidl/BiquadFilterNode.webidl @@ -24,19 +24,21 @@ enum BiquadFilterType { dictionary BiquadFilterOptions : AudioNodeOptions { BiquadFilterType type = "lowpass"; float Q = 1; float detune = 0; float frequency = 350; float gain = 0; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional BiquadFilterOptions options = {})] +[Pref="dom.webaudio.enabled"] interface BiquadFilterNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional BiquadFilterOptions options = {}); attribute BiquadFilterType type; readonly attribute AudioParam frequency; // in Hertz readonly attribute AudioParam detune; // in Cents readonly attribute AudioParam Q; // Quality factor readonly attribute AudioParam gain; // in Decibels [Throws]
--- a/dom/webidl/Blob.webidl +++ b/dom/webidl/Blob.webidl @@ -7,20 +7,21 @@ * https://w3c.github.io/FileAPI/#blob * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ typedef (BufferSource or Blob or USVString) BlobPart; -[Constructor(optional sequence<BlobPart> blobParts, - optional BlobPropertyBag options = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Blob { + [Throws] + constructor(optional sequence<BlobPart> blobParts, + optional BlobPropertyBag options = {}); [GetterThrows] readonly attribute unsigned long long size; readonly attribute DOMString type; //slice Blob into byte-ranged chunks
--- a/dom/webidl/BroadcastChannel.webidl +++ b/dom/webidl/BroadcastChannel.webidl @@ -2,19 +2,21 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * For more information on this interface, please see * https://html.spec.whatwg.org/#broadcastchannel */ -[Constructor(DOMString channel), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface BroadcastChannel : EventTarget { + [Throws] + constructor(DOMString channel); + readonly attribute DOMString name; [Throws] void postMessage(any message); void close(); attribute EventHandler onmessage;
--- a/dom/webidl/CanvasRenderingContext2D.webidl +++ b/dom/webidl/CanvasRenderingContext2D.webidl @@ -368,17 +368,18 @@ interface TextMetrics { readonly attribute double emHeightDescent; readonly attribute double hangingBaseline; readonly attribute double alphabeticBaseline; readonly attribute double ideographicBaseline; */ }; -[Pref="canvas.path.enabled", - Constructor, - Constructor(Path2D other), - Constructor(DOMString pathString)] +[Pref="canvas.path.enabled"] interface Path2D { + constructor(); + constructor(Path2D other); + constructor(DOMString pathString); + [Throws] void addPath(Path2D path, optional DOMMatrix2DInit transform = {}); }; Path2D includes CanvasPathMethods;
--- a/dom/webidl/ChannelMergerNode.webidl +++ b/dom/webidl/ChannelMergerNode.webidl @@ -9,12 +9,14 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary ChannelMergerOptions : AudioNodeOptions { unsigned long numberOfInputs = 6; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional ChannelMergerOptions options = {})] +[Pref="dom.webaudio.enabled"] interface ChannelMergerNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional ChannelMergerOptions options = {}); };
--- a/dom/webidl/ChannelSplitterNode.webidl +++ b/dom/webidl/ChannelSplitterNode.webidl @@ -9,14 +9,15 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary ChannelSplitterOptions : AudioNodeOptions { unsigned long numberOfOutputs = 6; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional ChannelSplitterOptions options = {})] +[Pref="dom.webaudio.enabled"] interface ChannelSplitterNode : AudioNode { - + [Throws] + constructor(BaseAudioContext context, + optional ChannelSplitterOptions options = {}); };
--- a/dom/webidl/CheckerboardReportService.webidl +++ b/dom/webidl/CheckerboardReportService.webidl @@ -23,19 +23,20 @@ dictionary CheckerboardReport { unsigned long severity; DOMTimeStamp timestamp; // milliseconds since epoch DOMString log; CheckerboardReason reason; }; // The guard function only allows creation of this interface on the // about:checkerboard page, and only if it's in the parent process. -[Func="mozilla::dom::CheckerboardReportService::IsEnabled", - Constructor] +[Func="mozilla::dom::CheckerboardReportService::IsEnabled"] interface CheckerboardReportService { + constructor(); + /** * Gets the available checkerboard reports. */ sequence<CheckerboardReport> getReports(); /** * Gets the state of the apz.record_checkerboarding pref. */
--- a/dom/webidl/ChromeNodeList.webidl +++ b/dom/webidl/ChromeNodeList.webidl @@ -1,13 +1,15 @@ /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor, Func="IsChromeOrXBL"] +[Func="IsChromeOrXBL"] interface ChromeNodeList : NodeList { + constructor(); + [Throws] void append(Node aNode); [Throws] void remove(Node aNode); };
--- a/dom/webidl/Comment.webidl +++ b/dom/webidl/Comment.webidl @@ -5,11 +5,12 @@ * * The origin of this IDL file is * http://dom.spec.whatwg.org/#comment * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor(optional DOMString data = "")] interface Comment : CharacterData { + [Throws] + constructor(optional DOMString data = ""); };
--- a/dom/webidl/ConstantSourceNode.webidl +++ b/dom/webidl/ConstantSourceNode.webidl @@ -9,13 +9,15 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary ConstantSourceOptions { float offset = 1; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional ConstantSourceOptions options = {})] +[Pref="dom.webaudio.enabled"] interface ConstantSourceNode : AudioScheduledSourceNode { + constructor(BaseAudioContext context, + optional ConstantSourceOptions options = {}); + readonly attribute AudioParam offset; };
--- a/dom/webidl/ConvolverNode.webidl +++ b/dom/webidl/ConvolverNode.webidl @@ -10,19 +10,21 @@ * liability, trademark and document use rules apply. */ dictionary ConvolverOptions : AudioNodeOptions { AudioBuffer? buffer; boolean disableNormalization = false; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional ConvolverOptions options = {})] +[Pref="dom.webaudio.enabled"] interface ConvolverNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, optional + ConvolverOptions options = {}); [SetterThrows] attribute AudioBuffer? buffer; attribute boolean normalize; }; // Mozilla extension
--- a/dom/webidl/DOMException.webidl +++ b/dom/webidl/DOMException.webidl @@ -62,19 +62,20 @@ interface Exception { stringifier; }; Exception implements ExceptionMembers; // XXXkhuey this is an 'exception', not an interface, but we don't have any // parser or codegen mechanisms for dealing with exceptions. [ExceptionClass, - Exposed=(Window, Worker), - Constructor(optional DOMString message = "", optional DOMString name)] + Exposed=(Window, Worker)] interface DOMException { + constructor(optional DOMString message = "", optional DOMString name); + // The name of the error code (ie, a string repr of |result|). readonly attribute DOMString name; // A custom message set by the thrower. [BinaryName="messageMoz"] readonly attribute DOMString message; readonly attribute unsigned short code; const unsigned short INDEX_SIZE_ERR = 1;
--- a/dom/webidl/DOMMatrix.webidl +++ b/dom/webidl/DOMMatrix.webidl @@ -6,20 +6,22 @@ * The origin of this IDL file is * https://drafts.fxtf.org/geometry/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ [Pref="layout.css.DOMMatrix.enabled", - Constructor(optional (DOMString or sequence<unrestricted double> or DOMMatrixReadOnly) init), Exposed=(Window,Worker), Serializable] interface DOMMatrixReadOnly { + [Throws] + constructor(optional (DOMString or sequence<unrestricted double> or DOMMatrixReadOnly) init); + [NewObject, Throws] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other = {}); [NewObject, Throws] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32); [NewObject, Throws] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64); // These attributes are simple aliases for certain elements of the 4x4 matrix readonly attribute unrestricted double a; readonly attribute unrestricted double b; @@ -83,21 +85,23 @@ interface DOMMatrixReadOnly { DOMPoint transformPoint(optional DOMPointInit point = {}); [Throws] Float32Array toFloat32Array(); [Throws] Float64Array toFloat64Array(); [Exposed=Window, Throws] stringifier; [Default] object toJSON(); }; [Pref="layout.css.DOMMatrix.enabled", - Constructor(optional (DOMString or sequence<unrestricted double> or DOMMatrixReadOnly) init), Exposed=(Window,Worker), Serializable, LegacyWindowAlias=WebKitCSSMatrix] interface DOMMatrix : DOMMatrixReadOnly { + [Throws] + constructor(optional (DOMString or sequence<unrestricted double> or DOMMatrixReadOnly) init); + [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other = {}); [NewObject, Throws] static DOMMatrix fromFloat32Array(Float32Array array32); [NewObject, Throws] static DOMMatrix fromFloat64Array(Float64Array array64); // These attributes are simple aliases for certain elements of the 4x4 matrix inherit attribute unrestricted double a; inherit attribute unrestricted double b;
--- a/dom/webidl/DOMParser.webidl +++ b/dom/webidl/DOMParser.webidl @@ -13,19 +13,20 @@ interface InputStream; enum SupportedType { "text/html", "text/xml", "application/xml", "application/xhtml+xml", "image/svg+xml" }; -// the latter is Mozilla-specific -[Constructor] interface DOMParser { + [Throws] + constructor(); + [NewObject, Throws] Document parseFromString(DOMString str, SupportedType type); // Mozilla-specific stuff [NewObject, Throws, ChromeOnly] Document parseFromBuffer(sequence<octet> buf, SupportedType type); [NewObject, Throws, ChromeOnly] Document parseFromBuffer(Uint8Array buf, SupportedType type);
--- a/dom/webidl/DOMPoint.webidl +++ b/dom/webidl/DOMPoint.webidl @@ -6,39 +6,45 @@ * The origin of this IDL file is * https://drafts.fxtf.org/geometry/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ [Pref="layout.css.DOMPoint.enabled", - Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double z = 0, optional unrestricted double w = 1), Exposed=(Window,Worker), Serializable] interface DOMPointReadOnly { + constructor(optional unrestricted double x = 0, + optional unrestricted double y = 0, + optional unrestricted double z = 0, + optional unrestricted double w = 1); + [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other = {}); readonly attribute unrestricted double x; readonly attribute unrestricted double y; readonly attribute unrestricted double z; readonly attribute unrestricted double w; [NewObject, Throws] DOMPoint matrixTransform(optional DOMMatrixInit matrix = {}); [Default] object toJSON(); }; [Pref="layout.css.DOMPoint.enabled", - Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double z = 0, optional unrestricted double w = 1), Exposed=(Window,Worker), Serializable] interface DOMPoint : DOMPointReadOnly { + constructor(optional unrestricted double x = 0, + optional unrestricted double y = 0, + optional unrestricted double z = 0, + optional unrestricted double w = 1); + [NewObject] static DOMPoint fromPoint(optional DOMPointInit other = {}); inherit attribute unrestricted double x; inherit attribute unrestricted double y; inherit attribute unrestricted double z; inherit attribute unrestricted double w; };
--- a/dom/webidl/DOMQuad.webidl +++ b/dom/webidl/DOMQuad.webidl @@ -6,22 +6,23 @@ * The origin of this IDL file is * https://drafts.fxtf.org/geometry/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ [Pref="layout.css.DOMQuad.enabled", - Constructor(optional DOMPointInit p1 = {}, optional DOMPointInit p2 = {}, - optional DOMPointInit p3 = {}, optional DOMPointInit p4 = {}), - Constructor(DOMRectReadOnly rect), Exposed=(Window,Worker), Serializable] interface DOMQuad { + constructor(optional DOMPointInit p1 = {}, optional DOMPointInit p2 = {}, + optional DOMPointInit p3 = {}, optional DOMPointInit p4 = {}); + constructor(DOMRectReadOnly rect); + [NewObject] static DOMQuad fromRect(optional DOMRectInit other = {}); [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other = {}); [SameObject] readonly attribute DOMPoint p1; [SameObject] readonly attribute DOMPoint p2; [SameObject] readonly attribute DOMPoint p3; [SameObject] readonly attribute DOMPoint p4; [NewObject] DOMRectReadOnly getBounds();
--- a/dom/webidl/DOMRect.webidl +++ b/dom/webidl/DOMRect.webidl @@ -5,35 +5,41 @@ * * The origin of this IDL file is * https://drafts.fxtf.org/geometry/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double width = 0, optional unrestricted double height = 0), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Serializable] interface DOMRect : DOMRectReadOnly { + constructor(optional unrestricted double x = 0, + optional unrestricted double y = 0, + optional unrestricted double width = 0, + optional unrestricted double height = 0); + [NewObject] static DOMRect fromRect(optional DOMRectInit other = {}); inherit attribute unrestricted double x; inherit attribute unrestricted double y; inherit attribute unrestricted double width; inherit attribute unrestricted double height; }; [ProbablyShortLivingWrapper, - Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double width = 0, optional unrestricted double height = 0), Exposed=(Window,Worker), Serializable] interface DOMRectReadOnly { + constructor(optional unrestricted double x = 0, + optional unrestricted double y = 0, + optional unrestricted double width = 0, + optional unrestricted double height = 0); + [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other = {}); readonly attribute unrestricted double x; readonly attribute unrestricted double y; readonly attribute unrestricted double width; readonly attribute unrestricted double height; readonly attribute unrestricted double top; readonly attribute unrestricted double right;
--- a/dom/webidl/DataTransfer.webidl +++ b/dom/webidl/DataTransfer.webidl @@ -3,18 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is: * http://www.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface */ interface ContentSecurityPolicy; -[Constructor] interface DataTransfer { + constructor(); + attribute DOMString dropEffect; attribute DOMString effectAllowed; readonly attribute DataTransferItemList items; void setDragImage(Element image, long x, long y); // ReturnValueNeedsContainsHack on .types because lots of extension
--- a/dom/webidl/DelayNode.webidl +++ b/dom/webidl/DelayNode.webidl @@ -10,19 +10,20 @@ * liability, trademark and document use rules apply. */ dictionary DelayOptions : AudioNodeOptions { double maxDelayTime = 1; double delayTime = 0; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional DelayOptions options = {})] +[Pref="dom.webaudio.enabled"] interface DelayNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, optional DelayOptions options = {}); readonly attribute AudioParam delayTime; }; // Mozilla extension DelayNode implements AudioNodePassThrough;
--- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -31,19 +31,21 @@ enum VisibilityState { "hidden", "visibl dictionary ElementCreationOptions { DOMString is; [ChromeOnly] DOMString pseudo; }; /* https://dom.spec.whatwg.org/#interface-document */ -[Constructor] interface Document : Node { [Throws] + constructor(); + + [Throws] readonly attribute DOMImplementation implementation; [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType] readonly attribute DOMString URL; [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType] readonly attribute DOMString documentURI; [Pure] readonly attribute DOMString compatMode; [Pure]
--- a/dom/webidl/DocumentFragment.webidl +++ b/dom/webidl/DocumentFragment.webidl @@ -6,18 +6,20 @@ * The origin of this IDL file is * http://www.w3.org/TR/2012/WD-dom-20120405/#interface-documentfragment * http://www.w3.org/TR/2012/WD-selectors-api-20120628/#interface-definitions * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor] interface DocumentFragment : Node { + [Throws] + constructor(); + Element? getElementById(DOMString elementId); }; // http://www.w3.org/TR/2012/WD-selectors-api-20120628/#interface-definitions partial interface DocumentFragment { [Throws] Element? querySelector(DOMString selectors); [Throws]
--- a/dom/webidl/DocumentTimeline.webidl +++ b/dom/webidl/DocumentTimeline.webidl @@ -9,12 +9,13 @@ * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary DocumentTimelineOptions { DOMHighResTimeStamp originTime = 0; }; -[Func="Document::AreWebAnimationsTimelinesEnabled", - Constructor(optional DocumentTimelineOptions options = {})] +[Func="Document::AreWebAnimationsTimelinesEnabled"] interface DocumentTimeline : AnimationTimeline { + [Throws] + constructor(optional DocumentTimelineOptions options = {}); };
--- a/dom/webidl/DynamicsCompressorNode.webidl +++ b/dom/webidl/DynamicsCompressorNode.webidl @@ -13,19 +13,21 @@ dictionary DynamicsCompressorOptions : AudioNodeOptions { float attack = 0.003; float knee = 30; float ratio = 12; float release = 0.25; float threshold = -24; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional DynamicsCompressorOptions options = {})] +[Pref="dom.webaudio.enabled"] interface DynamicsCompressorNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional DynamicsCompressorOptions options = {}); readonly attribute AudioParam threshold; // in Decibels readonly attribute AudioParam knee; // in Decibels readonly attribute AudioParam ratio; // unit-less readonly attribute float reduction; // in Decibels readonly attribute AudioParam attack; // in Seconds [BinaryName="getRelease"] readonly attribute AudioParam release; // in Seconds
--- a/dom/webidl/EventSource.webidl +++ b/dom/webidl/EventSource.webidl @@ -6,19 +6,21 @@ * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface * * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and * Opera Software ASA. You are granted a license to use, reproduce * and create derivative works of this document. */ -[Exposed=(Window,DedicatedWorker,SharedWorker), - Constructor(USVString url, optional EventSourceInit eventSourceInitDict = {})] +[Exposed=(Window,DedicatedWorker,SharedWorker)] interface EventSource : EventTarget { + [Throws] + constructor(USVString url, optional EventSourceInit eventSourceInitDict = {}); + [Constant] readonly attribute DOMString url; [Constant] readonly attribute boolean withCredentials; // ready state const unsigned short CONNECTING = 0; const unsigned short OPEN = 1;
--- a/dom/webidl/EventTarget.webidl +++ b/dom/webidl/EventTarget.webidl @@ -20,19 +20,21 @@ dictionary EventListenerOptions { dictionary AddEventListenerOptions : EventListenerOptions { boolean passive; boolean once = false; [ChromeOnly] boolean wantUntrusted; }; -[Constructor, - Exposed=(Window,Worker,WorkerDebugger,AudioWorklet)] +[Exposed=(Window,Worker,WorkerDebugger,AudioWorklet)] interface EventTarget { + [Throws] + constructor(); + /* Passing null for wantsUntrusted means "default behavior", which 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 (AddEventListenerOptions or boolean) options = {},
--- a/dom/webidl/File.webidl +++ b/dom/webidl/File.webidl @@ -5,20 +5,22 @@ * * The origin of this IDL file is * https://w3c.github.io/FileAPI/#file * https://wicg.github.io/entries-api */ interface nsIFile; -[Constructor(sequence<BlobPart> fileBits, - USVString fileName, optional FilePropertyBag options = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface File : Blob { + [Throws] + constructor(sequence<BlobPart> fileBits, + USVString fileName, optional FilePropertyBag options = {}); + readonly attribute DOMString name; [GetterThrows] readonly attribute long long lastModified; }; dictionary FilePropertyBag : BlobPropertyBag { long long lastModified;
--- a/dom/webidl/FileReader.webidl +++ b/dom/webidl/FileReader.webidl @@ -5,19 +5,20 @@ * * The origin of this IDL file is * https://w3c.github.io/FileAPI/#APIASynch * * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor, - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface FileReader : EventTarget { + constructor(); + // async read methods [Throws] void readAsArrayBuffer(Blob blob); [Throws] void readAsBinaryString(Blob filedata); [Throws] void readAsText(Blob blob, optional DOMString label); [Throws]
--- a/dom/webidl/FileReaderSync.webidl +++ b/dom/webidl/FileReaderSync.webidl @@ -5,20 +5,20 @@ * * The origin of this IDL file is * http://dev.w3.org/2006/webapi/FileAPI/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor, - Exposed=(DedicatedWorker,SharedWorker)] +[Exposed=(DedicatedWorker,SharedWorker)] interface FileReaderSync { - + constructor(); + // Synchronously return strings [Throws] ArrayBuffer readAsArrayBuffer(Blob blob); [Throws] DOMString readAsBinaryString(Blob blob); [Throws] DOMString readAsText(Blob blob, optional DOMString encoding);
--- a/dom/webidl/FontFace.webidl +++ b/dom/webidl/FontFace.webidl @@ -22,21 +22,23 @@ dictionary FontFaceDescriptors { DOMString variationSettings = "normal"; DOMString display = "auto"; }; enum FontFaceLoadStatus { "unloaded", "loading", "loaded", "error" }; // Bug 1072107 is for exposing this in workers. // [Exposed=(Window,Worker)] -[Constructor(DOMString family, - (DOMString or BinaryData) source, - optional FontFaceDescriptors descriptors = {}), - Pref="layout.css.font-loading-api.enabled"] +[Pref="layout.css.font-loading-api.enabled"] interface FontFace { + [Throws] + constructor(DOMString family, + (DOMString or BinaryData) source, + optional FontFaceDescriptors descriptors = {}); + [SetterThrows] attribute DOMString family; [SetterThrows] attribute DOMString style; [SetterThrows] attribute DOMString weight; [SetterThrows] attribute DOMString stretch; [SetterThrows] attribute DOMString unicodeRange; [SetterThrows] attribute DOMString variant; [SetterThrows] attribute DOMString featureSettings; [SetterThrows, Pref="layout.css.font-variations.enabled"] attribute DOMString variationSettings;
--- a/dom/webidl/FontFaceSet.webidl +++ b/dom/webidl/FontFaceSet.webidl @@ -22,20 +22,20 @@ dictionary FontFaceSetIteratorResult interface FontFaceSetIterator { [Throws] FontFaceSetIteratorResult next(); }; callback FontFaceSetForEachCallback = void (FontFace value, FontFace key, FontFaceSet set); enum FontFaceSetLoadStatus { "loading", "loaded" }; -// Bug 1072762 is for the FontFaceSet constructor. -// [Constructor(sequence<FontFace> initialFaces)] [Pref="layout.css.font-loading-api.enabled"] interface FontFaceSet : EventTarget { + // Bug 1072762 is for the FontFaceSet constructor. + // constructor(sequence<FontFace> initialFaces); // Emulate setlike behavior until we can use that directly. readonly attribute unsigned long size; [Throws] void add(FontFace font); boolean has(FontFace font); boolean delete(FontFace font); void clear(); [NewObject] FontFaceSetIterator entries();
--- a/dom/webidl/FormData.webidl +++ b/dom/webidl/FormData.webidl @@ -4,20 +4,22 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * http://xhr.spec.whatwg.org */ typedef (Blob or Directory or USVString) FormDataEntryValue; -[Constructor(optional HTMLFormElement form), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface FormData { [Throws] + constructor(optional HTMLFormElement form); + + [Throws] void append(USVString name, Blob value, optional USVString filename); [Throws] void append(USVString name, USVString value); void delete(USVString name); FormDataEntryValue? get(USVString name); sequence<FormDataEntryValue> getAll(USVString name); boolean has(USVString name); [Throws]
--- a/dom/webidl/GainNode.webidl +++ b/dom/webidl/GainNode.webidl @@ -9,19 +9,20 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary GainOptions : AudioNodeOptions { float gain = 1.0; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional GainOptions options = {})] +[Pref="dom.webaudio.enabled"] interface GainNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, optional GainOptions options = {}); readonly attribute AudioParam gain; }; // Mozilla extension GainNode implements AudioNodePassThrough;
--- a/dom/webidl/Headers.webidl +++ b/dom/webidl/Headers.webidl @@ -13,19 +13,21 @@ typedef (Headers or sequence<sequence<By enum HeadersGuardEnum { "none", "request", "request-no-cors", "response", "immutable" }; -[Constructor(optional HeadersInit init), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Headers { + [Throws] + constructor(optional HeadersInit init); + [Throws] void append(ByteString name, ByteString value); [Throws] void delete(ByteString name); [Throws] ByteString? get(ByteString name); [Throws] boolean has(ByteString name); [Throws] void set(ByteString name, ByteString value); iterable<ByteString, ByteString>; // Used to test different guard states from mochitest.
--- a/dom/webidl/IIRFilterNode.webidl +++ b/dom/webidl/IIRFilterNode.webidl @@ -9,16 +9,18 @@ * liability, trademark and document use rules apply. */ dictionary IIRFilterOptions : AudioNodeOptions { required sequence<double> feedforward; required sequence<double> feedback; }; -[Pref="dom.webaudio.enabled", -Constructor(BaseAudioContext context, IIRFilterOptions options)] +[Pref="dom.webaudio.enabled"] interface IIRFilterNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, IIRFilterOptions options); + void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); }; // Mozilla extension IIRFilterNode implements AudioNodePassThrough;
--- a/dom/webidl/ImageCapture.webidl +++ b/dom/webidl/ImageCapture.webidl @@ -5,18 +5,21 @@ * * The origin of this IDL file is * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/ImageCapture.html * * Copyright © 2012-2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. * W3C liability, trademark and document use rules apply. */ -[Pref="dom.imagecapture.enabled", Constructor(MediaStreamTrack track)] +[Pref="dom.imagecapture.enabled"] interface ImageCapture : EventTarget { + [Throws] + constructor(MediaStreamTrack track); + // readonly attribute PhotoSettingsOptions photoSettingsOptions; [BinaryName="GetVideoStreamTrack"] readonly attribute MediaStreamTrack videoStreamTrack; attribute EventHandler onphoto; attribute EventHandler onerror; // attribute EventHandler onphotosettingschange; // attribute EventHandler onframegrab;
--- a/dom/webidl/ImageData.webidl +++ b/dom/webidl/ImageData.webidl @@ -5,20 +5,24 @@ * * The origin of this IDL file is * http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#imagedata * * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA. * You are granted a license to use, reproduce and create derivative works of this document. */ -[Constructor(unsigned long sw, unsigned long sh), - Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Serializable] interface ImageData { + [Throws] + constructor(unsigned long sw, unsigned long sh); + [Throws] + constructor(Uint8ClampedArray data, unsigned long sw, + optional unsigned long sh); + [Constant] readonly attribute unsigned long width; [Constant] readonly attribute unsigned long height; [Constant, StoreInSlot] readonly attribute Uint8ClampedArray data; };
--- a/dom/webidl/IntersectionObserver.webidl +++ b/dom/webidl/IntersectionObserver.webidl @@ -20,20 +20,22 @@ interface IntersectionObserverEntry { [Constant] readonly attribute boolean isIntersecting; [Constant] readonly attribute double intersectionRatio; [Constant] readonly attribute Element target; }; -[Constructor(IntersectionCallback intersectionCallback, - optional IntersectionObserverInit options = {}), - Pref="dom.IntersectionObserver.enabled"] +[Pref="dom.IntersectionObserver.enabled"] interface IntersectionObserver { + [Throws] + constructor(IntersectionCallback intersectionCallback, + optional IntersectionObserverInit options = {}); + [Constant] readonly attribute Element? root; [Constant] readonly attribute DOMString rootMargin; [Constant,Cached] readonly attribute sequence<double> thresholds; void observe(Element target); void unobserve(Element target);
--- a/dom/webidl/KeyframeEffect.webidl +++ b/dom/webidl/KeyframeEffect.webidl @@ -18,22 +18,25 @@ enum IterationCompositeOperation { dictionary KeyframeEffectOptions : EffectTiming { IterationCompositeOperation iterationComposite = "replace"; CompositeOperation composite = "replace"; }; // KeyframeEffect should run in the caller's compartment to do custom // processing on the `keyframes` object. [Func="Document::IsWebAnimationsEnabled", - RunConstructorInCallerCompartment, - Constructor((Element or CSSPseudoElement)? target, - object? keyframes, - optional (unrestricted double or KeyframeEffectOptions) options = {}), - Constructor(KeyframeEffect source)] + RunConstructorInCallerCompartment] interface KeyframeEffect : AnimationEffect { + [Throws] + constructor((Element or CSSPseudoElement)? target, + object? keyframes, + optional (unrestricted double or KeyframeEffectOptions) options = {}); + [Throws] + constructor(KeyframeEffect source); + attribute (Element or CSSPseudoElement)? target; [Pref="dom.animations-api.compositing.enabled"] attribute IterationCompositeOperation iterationComposite; [Pref="dom.animations-api.compositing.enabled"] attribute CompositeOperation composite; [Throws] sequence<object> getKeyframes(); [Throws] void setKeyframes(object? keyframes); };
--- a/dom/webidl/MediaElementAudioSourceNode.webidl +++ b/dom/webidl/MediaElementAudioSourceNode.webidl @@ -9,17 +9,19 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary MediaElementAudioSourceOptions { required HTMLMediaElement mediaElement; }; -[Pref="dom.webaudio.enabled", - Constructor(AudioContext context, MediaElementAudioSourceOptions options)] +[Pref="dom.webaudio.enabled"] interface MediaElementAudioSourceNode : AudioNode { + [Throws] + constructor(AudioContext context, MediaElementAudioSourceOptions options); + readonly attribute HTMLMediaElement mediaElement; }; // Mozilla extensions MediaElementAudioSourceNode implements AudioNodePassThrough;
--- a/dom/webidl/MediaRecorder.webidl +++ b/dom/webidl/MediaRecorder.webidl @@ -7,20 +7,22 @@ * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/MediaRecorder.html * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ enum RecordingState { "inactive", "recording", "paused" }; -[Constructor(MediaStream stream, optional MediaRecorderOptions options = {}), - Constructor(AudioNode node, optional unsigned long output = 0, - optional MediaRecorderOptions options = {})] interface MediaRecorder : EventTarget { + [Throws] + constructor(MediaStream stream, optional MediaRecorderOptions options = {}); + [Throws] + constructor(AudioNode node, optional unsigned long output = 0, + optional MediaRecorderOptions options = {}); readonly attribute MediaStream stream; readonly attribute DOMString mimeType; readonly attribute RecordingState state; attribute EventHandler onstart;
--- a/dom/webidl/MediaSource.webidl +++ b/dom/webidl/MediaSource.webidl @@ -16,18 +16,21 @@ enum MediaSourceReadyState { "ended" }; enum MediaSourceEndOfStreamError { "network", "decode" }; -[Constructor, Pref="media.mediasource.enabled"] +[Pref="media.mediasource.enabled"] interface MediaSource : EventTarget { + [Throws] + constructor(); + readonly attribute SourceBufferList sourceBuffers; readonly attribute SourceBufferList activeSourceBuffers; readonly attribute MediaSourceReadyState readyState; [SetterThrows] attribute unrestricted double duration; attribute EventHandler onsourceopen; attribute EventHandler onsourceended; attribute EventHandler onsourceclosed;
--- a/dom/webidl/MediaStream.webidl +++ b/dom/webidl/MediaStream.webidl @@ -23,21 +23,25 @@ dictionary MediaStreamConstraints { DOMString? peerIdentity = null; }; dictionary DisplayMediaStreamConstraints { (boolean or MediaTrackConstraints) video = true; (boolean or MediaTrackConstraints) audio = false; }; -[Exposed=Window, - Constructor, - Constructor (MediaStream stream), - Constructor (sequence<MediaStreamTrack> tracks)] +[Exposed=Window] interface MediaStream : EventTarget { + [Throws] + constructor(); + [Throws] + constructor(MediaStream stream); + [Throws] + constructor(sequence<MediaStreamTrack> tracks); + readonly attribute DOMString id; sequence<MediaStreamTrack> getAudioTracks (); sequence<MediaStreamTrack> getVideoTracks (); sequence<MediaStreamTrack> getTracks (); MediaStreamTrack? getTrackById (DOMString trackId); void addTrack (MediaStreamTrack track); void removeTrack (MediaStreamTrack track); MediaStream clone ();
--- a/dom/webidl/MediaStreamAudioDestinationNode.webidl +++ b/dom/webidl/MediaStreamAudioDestinationNode.webidl @@ -5,14 +5,16 @@ * * The origin of this IDL file is * https://webaudio.github.io/web-audio-api/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Pref="dom.webaudio.enabled", - Constructor(AudioContext context, optional AudioNodeOptions options = {})] +[Pref="dom.webaudio.enabled"] interface MediaStreamAudioDestinationNode : AudioNode { + [Throws] + constructor(AudioContext context, optional AudioNodeOptions options = {}); + [BinaryName="DOMStream"] readonly attribute MediaStream stream; };
--- a/dom/webidl/MediaStreamAudioSourceNode.webidl +++ b/dom/webidl/MediaStreamAudioSourceNode.webidl @@ -9,18 +9,20 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary MediaStreamAudioSourceOptions { required MediaStream mediaStream; }; -[Pref="dom.webaudio.enabled", - Constructor(AudioContext context, MediaStreamAudioSourceOptions options)] +[Pref="dom.webaudio.enabled"] interface MediaStreamAudioSourceNode : AudioNode { + [Throws] + constructor(AudioContext context, MediaStreamAudioSourceOptions options); + [BinaryName="GetMediaStream"] readonly attribute MediaStream mediaStream; }; // Mozilla extensions MediaStreamAudioSourceNode implements AudioNodePassThrough;
--- a/dom/webidl/MediaStreamTrackAudioSourceNode.webidl +++ b/dom/webidl/MediaStreamTrackAudioSourceNode.webidl @@ -9,16 +9,16 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary MediaStreamTrackAudioSourceOptions { required MediaStreamTrack mediaStreamTrack; }; -[Pref="dom.webaudio.enabled", - Constructor(AudioContext context, MediaStreamTrackAudioSourceOptions options)] +[Pref="dom.webaudio.enabled"] interface MediaStreamTrackAudioSourceNode : AudioNode { - + [Throws] + constructor(AudioContext context, MediaStreamTrackAudioSourceOptions options); }; // Mozilla extensions MediaStreamTrackAudioSourceNode implements AudioNodePassThrough;
--- a/dom/webidl/MessageChannel.webidl +++ b/dom/webidl/MessageChannel.webidl @@ -2,13 +2,16 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * For more information on this interface, please see * http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging */ -[Constructor, Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface MessageChannel { + [Throws] + constructor(); + readonly attribute MessagePort port1; readonly attribute MessagePort port2; };
--- a/dom/webidl/MutationObserver.webidl +++ b/dom/webidl/MutationObserver.webidl @@ -32,19 +32,21 @@ interface MutationRecord { [Constant,Cached,ChromeOnly] readonly attribute sequence<Animation> addedAnimations; [Constant,Cached,ChromeOnly] readonly attribute sequence<Animation> changedAnimations; [Constant,Cached,ChromeOnly] readonly attribute sequence<Animation> removedAnimations; }; -[Constructor(MutationCallback mutationCallback)] interface MutationObserver { [Throws] + constructor(MutationCallback mutationCallback); + + [Throws] void observe(Node target, optional MutationObserverInit options = {}); void disconnect(); sequence<MutationRecord> takeRecords(); [ChromeOnly, Throws] sequence<MutationObservingInfo?> getObservingInfo(); [ChromeOnly] readonly attribute MutationCallback mutationCallback;
--- a/dom/webidl/Notification.webidl +++ b/dom/webidl/Notification.webidl @@ -6,20 +6,22 @@ * The origin of this IDL file is * https://notifications.spec.whatwg.org/ * * Copyright: * To the extent possible under law, the editors have waived all copyright and * related or neighboring rights to this work. */ -[Constructor(DOMString title, optional NotificationOptions options = {}), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Func="mozilla::dom::Notification::PrefEnabled"] interface Notification : EventTarget { + [Throws] + constructor(DOMString title, optional NotificationOptions options = {}); + [GetterThrows] static readonly attribute NotificationPermission permission; [Throws, Func="mozilla::dom::Notification::RequestPermissionEnabledForScope"] static Promise<NotificationPermission> requestPermission(optional NotificationPermissionCallback permissionCallback); [Throws, Func="mozilla::dom::Notification::IsGetEnabled"] static Promise<sequence<Notification>> get(optional GetNotificationOptions filter = {});
--- a/dom/webidl/OfflineAudioContext.webidl +++ b/dom/webidl/OfflineAudioContext.webidl @@ -11,20 +11,23 @@ */ dictionary OfflineAudioContextOptions { unsigned long numberOfChannels = 1; required unsigned long length; required float sampleRate; }; -[Constructor (OfflineAudioContextOptions contextOptions), -Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate), -Pref="dom.webaudio.enabled"] +[Pref="dom.webaudio.enabled"] interface OfflineAudioContext : BaseAudioContext { + [Throws] + constructor(OfflineAudioContextOptions contextOptions); + [Throws] + constructor(unsigned long numberOfChannels, unsigned long length, + float sampleRate); [Throws] Promise<AudioBuffer> startRendering(); // TODO: Promise<void> suspend (double suspendTime); readonly attribute unsigned long length; attribute EventHandler oncomplete;
--- a/dom/webidl/OffscreenCanvas.webidl +++ b/dom/webidl/OffscreenCanvas.webidl @@ -2,20 +2,21 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * For more information on this interface, please see * https://wiki.whatwg.org/wiki/OffscreenCanvas */ -[Constructor(unsigned long width, unsigned long height), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Pref="gfx.offscreencanvas.enabled"] interface OffscreenCanvas : EventTarget { + constructor(unsigned long width, unsigned long height); + [Pure, SetterThrows] attribute unsigned long width; [Pure, SetterThrows] attribute unsigned long height; [Throws] nsISupports? getContext(DOMString contextId, optional any contextOptions = null);
--- a/dom/webidl/OscillatorNode.webidl +++ b/dom/webidl/OscillatorNode.webidl @@ -20,19 +20,21 @@ enum OscillatorType { dictionary OscillatorOptions : AudioNodeOptions { OscillatorType type = "sine"; float frequency = 440; float detune = 0; PeriodicWave periodicWave; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional OscillatorOptions options = {})] +[Pref="dom.webaudio.enabled"] interface OscillatorNode : AudioScheduledSourceNode { + [Throws] + constructor(BaseAudioContext context, + optional OscillatorOptions options = {}); [SetterThrows] attribute OscillatorType type; readonly attribute AudioParam frequency; // in Hertz readonly attribute AudioParam detune; // in Cents void setPeriodicWave(PeriodicWave periodicWave);
--- a/dom/webidl/PannerNode.webidl +++ b/dom/webidl/PannerNode.webidl @@ -33,19 +33,20 @@ dictionary PannerOptions : AudioNodeOpti double refDistance = 1; double maxDistance = 10000; double rolloffFactor = 1; double coneInnerAngle = 360; double coneOuterAngle = 360; double coneOuterGain = 0; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional PannerOptions options = {})] +[Pref="dom.webaudio.enabled"] interface PannerNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, optional PannerOptions options = {}); // Default for stereo is equalpower attribute PanningModelType panningModel; // Uses a 3D cartesian coordinate system void setPosition(double x, double y, double z); void setOrientation(double x, double y, double z);
--- a/dom/webidl/PaymentRequest.webidl +++ b/dom/webidl/PaymentRequest.webidl @@ -97,21 +97,24 @@ dictionary PaymentOptions { boolean requestPayerName = false; boolean requestPayerEmail = false; boolean requestPayerPhone = false; boolean requestShipping = false; boolean requestBillingAddress = false; PaymentShippingType shippingType = "shipping"; }; -[Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, - optional PaymentOptions options = {}), - SecureContext, +[SecureContext, Func="mozilla::dom::PaymentRequest::PrefEnabled"] interface PaymentRequest : EventTarget { + [Throws] + constructor(sequence<PaymentMethodData> methodData, + PaymentDetailsInit details, + optional PaymentOptions options = {}); + [NewObject] Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise); [NewObject] Promise<void> abort(); [NewObject] Promise<boolean> canMakePayment(); readonly attribute DOMString id;
--- a/dom/webidl/PeerConnectionImpl.webidl +++ b/dom/webidl/PeerConnectionImpl.webidl @@ -11,18 +11,20 @@ * * See media/webrtc/signaling/include/PeerConnectionImpl.h * */ interface nsISupports; /* Must be created first. Observer events will be dispatched on the thread provided */ -[ChromeOnly, Constructor] +[ChromeOnly] interface PeerConnectionImpl { + constructor(); + /* Must be called first. Observer events dispatched on the thread provided */ [Throws] void initialize(PeerConnectionObserver observer, Window window, RTCConfiguration iceServers, nsISupports thread); /* JSEP calls */ [Throws]
--- a/dom/webidl/PeerConnectionObserver.webidl +++ b/dom/webidl/PeerConnectionObserver.webidl @@ -9,20 +9,22 @@ interface nsISupports; dictionary PCErrorData { required PCError name; required DOMString message; // Will need to add more stuff (optional) for RTCError }; [ChromeOnly, - JSImplementation="@mozilla.org/dom/peerconnectionobserver;1", - Constructor (RTCPeerConnection domPC)] + JSImplementation="@mozilla.org/dom/peerconnectionobserver;1"] interface PeerConnectionObserver { + [Throws] + constructor(RTCPeerConnection domPC); + /* JSEP callbacks */ void onCreateOfferSuccess(DOMString offer); void onCreateOfferError(PCErrorData error); void onCreateAnswerSuccess(DOMString answer); void onCreateAnswerError(PCErrorData error); void onSetLocalDescriptionSuccess(); void onSetRemoteDescriptionSuccess(); void onSetLocalDescriptionError(PCErrorData error);
--- a/dom/webidl/PerformanceObserver.webidl +++ b/dom/webidl/PerformanceObserver.webidl @@ -12,16 +12,18 @@ dictionary PerformanceObserverInit { DOMString type; boolean buffered; }; callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer); [Pref="dom.enable_performance_observer", - Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)] interface PerformanceObserver { + [Throws] + constructor(PerformanceObserverCallback callback); + [Throws] void observe(optional PerformanceObserverInit options = {}); void disconnect(); PerformanceEntryList takeRecords(); static readonly attribute object supportedEntryTypes; };
--- a/dom/webidl/PeriodicWave.webidl +++ b/dom/webidl/PeriodicWave.webidl @@ -14,12 +14,14 @@ dictionary PeriodicWaveConstraints { boolean disableNormalization = false; }; dictionary PeriodicWaveOptions : PeriodicWaveConstraints { sequence<float> real; sequence<float> imag; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional PeriodicWaveOptions options = {})] +[Pref="dom.webaudio.enabled"] interface PeriodicWave { + [Throws] + constructor(BaseAudioContext context, + optional PeriodicWaveOptions options = {}); };
--- a/dom/webidl/PresentationRequest.webidl +++ b/dom/webidl/PresentationRequest.webidl @@ -2,20 +2,23 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * https://w3c.github.io/presentation-api/#interface-presentationrequest */ -[Constructor(DOMString url), - Constructor(sequence<DOMString> urls), - Pref="dom.presentation.controller.enabled"] +[Pref="dom.presentation.controller.enabled"] interface PresentationRequest : EventTarget { + [Throws] + constructor(DOMString url); + [Throws] + constructor(sequence<DOMString> urls); + /* * A requesting page use start() to start a new connection, and it will be * returned with the promise. UA may show a prompt box with a list of * available devices and ask the user to grant permission, choose a device, or * cancel the operation. * * The promise is resolved when the presenting page is successfully loaded and * the communication channel is established, i.e., the connection state is
--- a/dom/webidl/PushManager.webidl +++ b/dom/webidl/PushManager.webidl @@ -10,18 +10,21 @@ dictionary PushSubscriptionOptionsInit { // boolean userVisibleOnly = false; (BufferSource or DOMString)? applicationServerKey = null; }; // The main thread JS implementation. Please see comments in // dom/push/PushManager.h for the split between PushManagerImpl and PushManager. [JSImplementation="@mozilla.org/push/PushManager;1", - ChromeOnly, Constructor(DOMString scope)] + ChromeOnly] interface PushManagerImpl { + [Throws] + constructor(DOMString scope); + Promise<PushSubscription> subscribe(optional PushSubscriptionOptionsInit options = {}); Promise<PushSubscription?> getSubscription(); Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options = {}); }; [Exposed=(Window,Worker), Pref="dom.push.enabled"] interface PushManager { [Throws, ChromeOnly]
--- a/dom/webidl/RTCIceCandidate.webidl +++ b/dom/webidl/RTCIceCandidate.webidl @@ -10,17 +10,19 @@ dictionary RTCIceCandidateInit { DOMString candidate = ""; DOMString? sdpMid = null; unsigned short? sdpMLineIndex = null; DOMString? usernameFragment = null; }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/rtcicecandidate;1", - Constructor(optional RTCIceCandidateInit candidateInitDict = {})] + JSImplementation="@mozilla.org/dom/rtcicecandidate;1"] interface RTCIceCandidate { + [Throws] + constructor(optional RTCIceCandidateInit candidateInitDict = {}); + attribute DOMString candidate; attribute DOMString? sdpMid; attribute unsigned short? sdpMLineIndex; attribute DOMString? usernameFragment; [Default] object toJSON(); };
--- a/dom/webidl/RTCPeerConnection.webidl +++ b/dom/webidl/RTCPeerConnection.webidl @@ -72,20 +72,22 @@ dictionary RTCAnswerOptions : RTCOfferAn dictionary RTCOfferOptions : RTCOfferAnswerOptions { boolean offerToReceiveVideo; boolean offerToReceiveAudio; boolean iceRestart = false; }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/peerconnection;1", - Constructor (optional RTCConfiguration configuration = {}, - optional object? constraints)] + JSImplementation="@mozilla.org/dom/peerconnection;1"] interface RTCPeerConnection : EventTarget { + [Throws] + constructor(optional RTCConfiguration configuration = {}, + optional object? constraints); + [Throws, StaticClassOverride="mozilla::dom::RTCCertificate"] static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm); [Pref="media.peerconnection.identity.enabled"] void setIdentityProvider (DOMString provider, optional RTCIdentityProviderOptions options = {}); [Pref="media.peerconnection.identity.enabled"] Promise<DOMString> getIdentityAssertion();
--- a/dom/webidl/RTCPeerConnectionStatic.webidl +++ b/dom/webidl/RTCPeerConnectionStatic.webidl @@ -20,19 +20,20 @@ enum RTCLifecycleEvent { }; callback PeerConnectionLifecycleCallback = void (RTCPeerConnection pc, unsigned long long windowId, RTCLifecycleEvent eventType); [ChromeOnly, Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/peerconnectionstatic;1", - Constructor()] + JSImplementation="@mozilla.org/dom/peerconnectionstatic;1"] interface RTCPeerConnectionStatic { + [Throws] + constructor(); /* One slot per window (the window in which the register call is made), automatically unregistered when window goes away. Fires when a PC is created, and whenever the ICE connection state or gathering state changes. */ void registerPeerConnectionLifecycleCallback( PeerConnectionLifecycleCallback cb); };
--- a/dom/webidl/RTCSessionDescription.webidl +++ b/dom/webidl/RTCSessionDescription.webidl @@ -15,17 +15,19 @@ enum RTCSdpType { }; dictionary RTCSessionDescriptionInit { required RTCSdpType type; DOMString sdp = ""; }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/rtcsessiondescription;1", - Constructor(optional RTCSessionDescriptionInit descriptionInitDict = {})] + JSImplementation="@mozilla.org/dom/rtcsessiondescription;1"] interface RTCSessionDescription { + [Throws] + constructor(optional RTCSessionDescriptionInit descriptionInitDict = {}); + // These should be readonly, but writing causes deprecation warnings for a bit attribute RTCSdpType type; attribute DOMString sdp; [Default] object toJSON(); };
--- a/dom/webidl/Range.webidl +++ b/dom/webidl/Range.webidl @@ -7,19 +7,21 @@ * http://dom.spec.whatwg.org/#range * http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor] interface Range : AbstractRange { [Throws] + constructor(); + + [Throws] readonly attribute Node commonAncestorContainer; [Throws, BinaryName="setStartJS"] void setStart(Node refNode, unsigned long offset); [Throws, BinaryName="setEndJS"] void setEnd(Node refNode, unsigned long offset); [Throws, BinaryName="setStartBeforeJS"] void setStartBefore(Node refNode);
--- a/dom/webidl/Reporting.webidl +++ b/dom/webidl/Reporting.webidl @@ -13,19 +13,22 @@ interface ReportBody { [Pref="dom.reporting.enabled"] interface Report { readonly attribute DOMString type; readonly attribute DOMString url; readonly attribute ReportBody? body; }; -[Constructor(ReportingObserverCallback callback, optional ReportingObserverOptions options = {}), - Pref="dom.reporting.enabled"] +[Pref="dom.reporting.enabled"] interface ReportingObserver { + [Throws] + constructor(ReportingObserverCallback callback, + optional ReportingObserverOptions options = {}); + void observe(); void disconnect(); ReportList takeRecords(); }; callback ReportingObserverCallback = void (sequence<Report> reports, ReportingObserver observer); dictionary ReportingObserverOptions { @@ -40,20 +43,22 @@ interface DeprecationReportBody : Report readonly attribute DOMString id; readonly attribute Date? anticipatedRemoval; readonly attribute DOMString message; readonly attribute DOMString? sourceFile; readonly attribute unsigned long? lineNumber; readonly attribute unsigned long? columnNumber; }; -[Constructor(), Deprecated="DeprecatedTestingInterface", +[Deprecated="DeprecatedTestingInterface", Pref="dom.reporting.testing.enabled", Exposed=(Window,DedicatedWorker)] interface TestingDeprecatedInterface { + constructor(); + [Deprecated="DeprecatedTestingMethod"] void deprecatedMethod(); [Deprecated="DeprecatedTestingAttribute"] readonly attribute boolean deprecatedAttribute; }; // Used internally to process the JSON
--- a/dom/webidl/Request.webidl +++ b/dom/webidl/Request.webidl @@ -5,19 +5,21 @@ * * The origin of this IDL file is * https://fetch.spec.whatwg.org/#request-class */ typedef (Request or USVString) RequestInfo; typedef unsigned long nsContentPolicyType; -[Constructor(RequestInfo input, optional RequestInit init = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Request { + [Throws] + constructor(RequestInfo input, optional RequestInit init = {}); + readonly attribute ByteString method; readonly attribute USVString url; [SameObject, BinaryName="headers_"] readonly attribute Headers headers; readonly attribute RequestDestination destination; readonly attribute USVString referrer; [BinaryName="referrerPolicy_"] readonly attribute ReferrerPolicy referrerPolicy;
--- a/dom/webidl/ResizeObserver.webidl +++ b/dom/webidl/ResizeObserver.webidl @@ -11,21 +11,23 @@ enum ResizeObserverBoxOptions { "border-box", "content-box" }; dictionary ResizeObserverOptions { ResizeObserverBoxOptions box = "content-box"; }; -[Constructor(ResizeObserverCallback callback), - Exposed=Window, +[Exposed=Window, Pref="layout.css.resizeobserver.enabled"] interface ResizeObserver { [Throws] + constructor(ResizeObserverCallback callback); + + [Throws] void observe(Element target, optional ResizeObserverOptions options = {}); [Throws] void unobserve(Element target); void disconnect(); }; callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
--- a/dom/webidl/Response.webidl +++ b/dom/webidl/Response.webidl @@ -2,21 +2,25 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * https://fetch.spec.whatwg.org/#response-class */ -// This should be Constructor(optional BodyInit... but BodyInit doesn't include -// ReadableStream yet because we don't want to expose Streams API to Request. -[Constructor(optional (Blob or BufferSource or FormData or URLSearchParams or ReadableStream or USVString)? body, optional ResponseInit init = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Response { + // This should be constructor(optional BodyInit... but BodyInit doesn't + // include ReadableStream yet because we don't want to expose Streams API to + // Request. + [Throws] + constructor(optional (Blob or BufferSource or FormData or URLSearchParams or ReadableStream or USVString)? body, + optional ResponseInit init = {}); + [NewObject] static Response error(); [Throws, NewObject] static Response redirect(USVString url, optional unsigned short status = 302); readonly attribute ResponseType type; readonly attribute USVString url; readonly attribute boolean redirected;
--- a/dom/webidl/SharedWorker.webidl +++ b/dom/webidl/SharedWorker.webidl @@ -1,12 +1,15 @@ /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {})] interface SharedWorker : EventTarget { + [Throws] + constructor(USVString scriptURL, + optional (DOMString or WorkerOptions) options = {}); + readonly attribute MessagePort port; }; SharedWorker implements AbstractWorker;
--- a/dom/webidl/SpeechGrammar.webidl +++ b/dom/webidl/SpeechGrammar.webidl @@ -5,18 +5,19 @@ * * The origin of this IDL file is * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor, - Pref="media.webspeech.recognition.enable", +[Pref="media.webspeech.recognition.enable", Func="SpeechRecognition::IsAuthorized"] interface SpeechGrammar { + constructor(); + [Throws] attribute DOMString src; [Throws] attribute float weight; };
--- a/dom/webidl/SpeechGrammarList.webidl +++ b/dom/webidl/SpeechGrammarList.webidl @@ -5,19 +5,21 @@ * * The origin of this IDL file is * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor, Pref="media.webspeech.recognition.enable", +[Pref="media.webspeech.recognition.enable", Func="SpeechRecognition::IsAuthorized"] interface SpeechGrammarList { + constructor(); + readonly attribute unsigned long length; [Throws] getter SpeechGrammar item(unsigned long index); [Throws] void addFromURI(DOMString src, optional float weight); [Throws] void addFromString(DOMString string, optional float weight); };
--- a/dom/webidl/SpeechRecognition.webidl +++ b/dom/webidl/SpeechRecognition.webidl @@ -5,20 +5,22 @@ * * The origin of this IDL file is * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor, - Pref="media.webspeech.recognition.enable", +[Pref="media.webspeech.recognition.enable", Func="SpeechRecognition::IsAuthorized"] interface SpeechRecognition : EventTarget { + [Throws] + constructor(); + // recognition parameters attribute SpeechGrammarList grammars; attribute DOMString lang; [Throws] attribute boolean continuous; attribute boolean interimResults; attribute unsigned long maxAlternatives; [Throws]
--- a/dom/webidl/SpeechRecognitionError.webidl +++ b/dom/webidl/SpeechRecognitionError.webidl @@ -11,20 +11,22 @@ enum SpeechRecognitionErrorCode { "network", "not-allowed", "service-not-allowed", "bad-grammar", "language-not-supported" }; [Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized", - Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict = {})] + Func="SpeechRecognition::IsAuthorized"] interface SpeechRecognitionError : Event { + constructor(DOMString type, + optional SpeechRecognitionErrorInit eventInitDict = {}); + readonly attribute SpeechRecognitionErrorCode error; readonly attribute DOMString? message; }; dictionary SpeechRecognitionErrorInit : EventInit { SpeechRecognitionErrorCode error = "no-speech"; DOMString message = "";
--- a/dom/webidl/SpeechSynthesisUtterance.webidl +++ b/dom/webidl/SpeechSynthesisUtterance.webidl @@ -5,20 +5,23 @@ * * The origin of this IDL file is * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Pref="media.webspeech.synth.enabled", - Constructor, - Constructor(DOMString text)] +[Pref="media.webspeech.synth.enabled"] interface SpeechSynthesisUtterance : EventTarget { + [Throws] + constructor(); + [Throws] + constructor(DOMString text); + attribute DOMString text; attribute DOMString lang; attribute SpeechSynthesisVoice? voice; attribute float volume; attribute float rate; attribute float pitch; attribute EventHandler onstart;
--- a/dom/webidl/StereoPannerNode.webidl +++ b/dom/webidl/StereoPannerNode.webidl @@ -9,17 +9,20 @@ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ dictionary StereoPannerOptions : AudioNodeOptions { float pan = 0; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional StereoPannerOptions options = {})] +[Pref="dom.webaudio.enabled"] interface StereoPannerNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional StereoPannerOptions options = {}); + readonly attribute AudioParam pan; }; // Mozilla extension StereoPannerNode implements AudioNodePassThrough;
--- a/dom/webidl/StructuredCloneTester.webidl +++ b/dom/webidl/StructuredCloneTester.webidl @@ -1,14 +1,15 @@ /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(boolean serializable, boolean deserializable), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Pref="dom.testing.structuredclonetester.enabled", Serializable] interface StructuredCloneTester { + constructor(boolean serializable, boolean deserializable); + readonly attribute boolean serializable; readonly attribute boolean deserializable; };
--- a/dom/webidl/TCPServerSocket.webidl +++ b/dom/webidl/TCPServerSocket.webidl @@ -8,21 +8,24 @@ * * An interface to a server socket that can accept incoming connections for gaia apps. */ dictionary ServerSocketOptions { TCPSocketBinaryType binaryType = "string"; }; -[Constructor(unsigned short port, optional ServerSocketOptions options = {}, optional unsigned short backlog = 0), - Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", +[Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", Exposed=Window] interface TCPServerSocket : EventTarget { - /** + [Throws] + constructor(unsigned short port, optional ServerSocketOptions options = {}, + optional unsigned short backlog = 0); + + /** * The port of this server socket object. */ readonly attribute unsigned short localPort; /** * The "connect" event is dispatched when a client connection is accepted. * The event object will be a TCPServerSocketEvent containing a TCPSocket * instance, which is used for communication between client and server.
--- a/dom/webidl/TCPSocket.webidl +++ b/dom/webidl/TCPSocket.webidl @@ -34,20 +34,23 @@ interface LegacyMozTCPSocket { */ [Throws] TCPSocket open(DOMString host, unsigned short port, optional SocketOptions options = {}); [Throws] TCPServerSocket listen(unsigned short port, optional ServerSocketOptions options = {}, optional unsigned short backlog = 0); }; -[Constructor(DOMString host, unsigned short port, optional SocketOptions options = {}), - Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", +[Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", Exposed=Window] interface TCPSocket : EventTarget { + [Throws] + constructor(DOMString host, unsigned short port, + optional SocketOptions options = {}); + /** * Upgrade an insecure connection to use TLS. Throws if the ready state is not OPEN. */ [Throws] void upgradeToSecure(); /** * The UTF16 host of this socket object. */
--- a/dom/webidl/TestFunctions.webidl +++ b/dom/webidl/TestFunctions.webidl @@ -7,19 +7,20 @@ // A dumping ground for random testing functions callback PromiseReturner = Promise<any>(); [Pref="dom.expose_test_interfaces"] interface WrapperCachedNonISupportsTestInterface { }; -[Pref="dom.expose_test_interfaces", - Constructor] +[Pref="dom.expose_test_interfaces"] interface TestFunctions { + constructor(); + [Throws] static void throwUncatchableException(); // Simply returns its argument. Can be used to test Promise // argument processing behavior. static Promise<any> passThroughPromise(Promise<any> arg); // Returns whatever Promise the given PromiseReturner returned.
--- a/dom/webidl/TestInterfaceJS.webidl +++ b/dom/webidl/TestInterfaceJS.webidl @@ -5,19 +5,22 @@ */ dictionary TestInterfaceJSUnionableDictionary { object objectMember; any anyMember; }; [JSImplementation="@mozilla.org/dom/test-interface-js;1", - Pref="dom.expose_test_interfaces", - Constructor(optional any anyArg, optional object objectArg, optional TestInterfaceJSDictionary dictionaryArg = {})] + Pref="dom.expose_test_interfaces"] interface TestInterfaceJS : EventTarget { + [Throws] + constructor(optional any anyArg, optional object objectArg, + optional TestInterfaceJSDictionary dictionaryArg = {}); + readonly attribute any anyArg; readonly attribute object objectArg; TestInterfaceJSDictionary getDictionaryArg(); attribute any anyAttr; attribute object objectAttr; TestInterfaceJSDictionary getDictionaryAttr(); void setDictionaryAttr(optional TestInterfaceJSDictionary dict = {}); any pingPongAny(any arg);
--- a/dom/webidl/TestInterfaceJSMaplikeSetlikeIterable.webidl +++ b/dom/webidl/TestInterfaceJSMaplikeSetlikeIterable.webidl @@ -1,68 +1,84 @@ /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceMaplike { + [Throws] + constructor(); + maplike<DOMString, long>; void setInternal(DOMString aKey, long aValue); void clearInternal(); boolean deleteInternal(DOMString aKey); boolean hasInternal(DOMString aKey); }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceMaplikeObject { + [Throws] + constructor(); + readonly maplike<DOMString, TestInterfaceMaplike>; void setInternal(DOMString aKey); void clearInternal(); boolean deleteInternal(DOMString aKey); boolean hasInternal(DOMString aKey); }; [Pref="dom.expose_test_interfaces", - JSImplementation="@mozilla.org/dom/test-interface-js-maplike;1", - Constructor()] + JSImplementation="@mozilla.org/dom/test-interface-js-maplike;1"] interface TestInterfaceJSMaplike { + [Throws] + constructor(); + readonly maplike<DOMString, long>; void setInternal(DOMString aKey, long aValue); void clearInternal(); boolean deleteInternal(DOMString aKey); }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceSetlike { + [Throws] + constructor(); + setlike<DOMString>; }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceSetlikeNode { + [Throws] + constructor(); + setlike<Node>; }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceIterableSingle { + [Throws] + constructor(); + iterable<long>; getter long(unsigned long index); readonly attribute unsigned long length; }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceIterableDouble { + [Throws] + constructor(); + iterable<DOMString, DOMString>; }; -[Constructor(), - Pref="dom.expose_test_interfaces"] +[Pref="dom.expose_test_interfaces"] interface TestInterfaceIterableDoubleUnion { + [Throws] + constructor(); + iterable<DOMString, (DOMString or long)>; };
--- a/dom/webidl/Text.webidl +++ b/dom/webidl/Text.webidl @@ -5,19 +5,21 @@ * * The origin of this IDL file is * http://www.w3.org/TR/2012/WD-dom-20120105/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor(optional DOMString data = "")] interface Text : CharacterData { [Throws] + constructor(optional DOMString data = ""); + + [Throws] Text splitText(unsigned long offset); [Throws] readonly attribute DOMString wholeText; }; partial interface Text { [BinaryName="assignedSlotByMode"] readonly attribute HTMLSlotElement? assignedSlot;
--- a/dom/webidl/TextDecoder.webidl +++ b/dom/webidl/TextDecoder.webidl @@ -5,19 +5,22 @@ * * The origin of this IDL file is * http://encoding.spec.whatwg.org/#interface-textdecoder * * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface TextDecoder { + [Throws] + constructor(optional DOMString label = "utf-8", + optional TextDecoderOptions options = {}); + [Constant] readonly attribute DOMString encoding; [Constant] readonly attribute boolean fatal; [Constant] readonly attribute boolean ignoreBOM; [Throws] USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
--- a/dom/webidl/TextEncoder.webidl +++ b/dom/webidl/TextEncoder.webidl @@ -10,18 +10,20 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ dictionary TextEncoderEncodeIntoResult { unsigned long long read; unsigned long long written; }; -[Constructor, Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface TextEncoder { + constructor(); + [Constant] readonly attribute DOMString encoding; /* * This is spec-wise USVString but marking it as * DOMString to avoid duplicate work. Since the * UTF-16 to UTF-8 converter performs processing * that's equivalent to first converting a * DOMString to a USVString, let's avoid having
--- a/dom/webidl/Touch.webidl +++ b/dom/webidl/Touch.webidl @@ -20,19 +20,20 @@ dictionary TouchInit { long pageX = 0; long pageY = 0; float radiusX = 0; float radiusY = 0; float rotationAngle = 0; float force = 0; }; -[Constructor(TouchInit touchInitDict), - Func="mozilla::dom::Touch::PrefEnabled"] +[Func="mozilla::dom::Touch::PrefEnabled"] interface Touch { + constructor(TouchInit touchInitDict); + readonly attribute long identifier; readonly attribute EventTarget? target; [NeedsCallerType] readonly attribute long screenX; [NeedsCallerType] readonly attribute long screenY; readonly attribute long clientX; readonly attribute long clientY;
--- a/dom/webidl/UDPSocket.webidl +++ b/dom/webidl/UDPSocket.webidl @@ -12,20 +12,22 @@ dictionary UDPOptions { DOMString localAddress; unsigned short localPort; DOMString remoteAddress; unsigned short remotePort; boolean addressReuse = true; boolean loopback = false; }; -[Constructor (optional UDPOptions options = {}), - Pref="dom.udpsocket.enabled", +[Pref="dom.udpsocket.enabled", ChromeOnly] interface UDPSocket : EventTarget { + [Throws] + constructor(optional UDPOptions options = {}); + readonly attribute DOMString? localAddress; readonly attribute unsigned short? localPort; readonly attribute DOMString? remoteAddress; readonly attribute unsigned short? remotePort; readonly attribute boolean addressReuse; readonly attribute boolean loopback; readonly attribute SocketReadyState readyState; readonly attribute Promise<void> opened;
--- a/dom/webidl/URL.webidl +++ b/dom/webidl/URL.webidl @@ -6,20 +6,22 @@ * The origins of this IDL file are * http://url.spec.whatwg.org/#api * http://dev.w3.org/2006/webapi/FileAPI/#creating-revoking * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ -[Constructor(USVString url, optional USVString base), - Exposed=(Window,Worker,WorkerDebugger), +[Exposed=(Window,Worker,WorkerDebugger), LegacyWindowAlias=webkitURL] interface URL { + [Throws] + constructor(USVString url, optional USVString base); + // Bug 824857: no support for stringifier attributes yet. // stringifier attribute USVString href; // Bug 824857 should remove this. stringifier; [SetterThrows] attribute USVString href;
--- a/dom/webidl/URLSearchParams.webidl +++ b/dom/webidl/URLSearchParams.webidl @@ -8,20 +8,23 @@ * * To the extent possible under law, the editors have waived all copyright * and related or neighboring rights to this work. In addition, as of 17 * February 2013, the editors have made this specification available under * the Open Web Foundation Agreement Version 1.0, which is available at * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ -[Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""), - Exposed=(Window,Worker,WorkerDebugger), +[Exposed=(Window,Worker,WorkerDebugger), Serializable] interface URLSearchParams { + [Throws] + constructor(optional (sequence<sequence<USVString>> or + record<USVString, USVString> or USVString) init = ""); + void append(USVString name, USVString value); void delete(USVString name); USVString? get(USVString name); sequence<USVString> getAll(USVString name); boolean has(USVString name); void set(USVString name, USVString value); [Throws]
--- a/dom/webidl/VRDisplay.webidl +++ b/dom/webidl/VRDisplay.webidl @@ -129,20 +129,21 @@ interface VRPose /* orientation is a 4-entry array representing the components of a quaternion. */ [Constant, Throws] readonly attribute Float32Array? orientation; /* angularVelocity and angularAcceleration are the components of 3-dimensional vectors. */ [Constant, Throws] readonly attribute Float32Array? angularVelocity; [Constant, Throws] readonly attribute Float32Array? angularAcceleration; }; -[Constructor, - Pref="dom.vr.enabled", +[Pref="dom.vr.enabled", HeaderFile="mozilla/dom/VRDisplay.h"] interface VRFrameData { + constructor(); + readonly attribute DOMHighResTimeStamp timestamp; [Throws, Pure] readonly attribute Float32Array leftProjectionMatrix; [Throws, Pure] readonly attribute Float32Array leftViewMatrix; [Throws, Pure] readonly attribute Float32Array rightProjectionMatrix; [Throws, Pure] readonly attribute Float32Array rightViewMatrix;
--- a/dom/webidl/VTTCue.webidl +++ b/dom/webidl/VTTCue.webidl @@ -31,18 +31,20 @@ enum AlignSetting { }; enum DirectionSetting { "", "rl", "lr" }; -[Constructor(double startTime, double endTime, DOMString text)] interface VTTCue : TextTrackCue { + [Throws] + constructor(double startTime, double endTime, DOMString text); + [Pref="media.webvtt.regions.enabled"] attribute VTTRegion? region; attribute DirectionSetting vertical; attribute boolean snapToLines; attribute (double or AutoKeyword) line; [SetterThrows] attribute LineAlignSetting lineAlign; [SetterThrows]
--- a/dom/webidl/VTTRegion.webidl +++ b/dom/webidl/VTTRegion.webidl @@ -7,18 +7,21 @@ * https://w3c.github.io/webvtt/#the-vttregion-interface */ enum ScrollSetting { "", "up" }; -[Constructor, Pref="media.webvtt.regions.enabled"] +[Pref="media.webvtt.regions.enabled"] interface VTTRegion { + [Throws] + constructor(); + attribute DOMString id; [SetterThrows] attribute double width; [SetterThrows] attribute long lines; [SetterThrows] attribute double regionAnchorX; [SetterThrows]
--- a/dom/webidl/WaveShaperNode.webidl +++ b/dom/webidl/WaveShaperNode.webidl @@ -16,19 +16,21 @@ enum OverSampleType { "4x" }; dictionary WaveShaperOptions : AudioNodeOptions { sequence<float> curve; OverSampleType oversample = "none"; }; -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional WaveShaperOptions options = {})] +[Pref="dom.webaudio.enabled"] interface WaveShaperNode : AudioNode { + [Throws] + constructor(BaseAudioContext context, + optional WaveShaperOptions options = {}); [Cached, Pure, SetterThrows] attribute Float32Array? curve; attribute OverSampleType oversample; }; // Mozilla extension
--- a/dom/webidl/WebSocket.webidl +++ b/dom/webidl/WebSocket.webidl @@ -7,21 +7,24 @@ * http://www.whatwg.org/html/#network * * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA. * You are granted a license to use, reproduce and create derivative works of this document. */ enum BinaryType { "blob", "arraybuffer" }; -[Exposed=(Window,Worker), - Constructor(DOMString url), - Constructor(DOMString url, DOMString protocols), - Constructor(DOMString url, sequence<DOMString> protocols)] +[Exposed=(Window,Worker)] interface WebSocket : EventTarget { + [Throws] + constructor(DOMString url); + [Throws] + constructor(DOMString url, DOMString protocols); + [Throws] + constructor(DOMString url, sequence<DOMString> protocols); readonly attribute DOMString url; // ready state const unsigned short CONNECTING = 0; const unsigned short OPEN = 1; const unsigned short CLOSING = 2; const unsigned short CLOSED = 3;
--- a/dom/webidl/WebrtcDeprecated.webidl +++ b/dom/webidl/WebrtcDeprecated.webidl @@ -6,24 +6,30 @@ * This file includes all the deprecated mozRTC prefixed interfaces. * * The declaration of each should match the declaration of the real, unprefixed * interface. These aliases will be removed at some point (Bug 1155923). */ [Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/rtcicecandidate;1", - Constructor(optional RTCIceCandidateInit candidateInitDict = {})] -interface mozRTCIceCandidate : RTCIceCandidate {}; + JSImplementation="@mozilla.org/dom/rtcicecandidate;1"] +interface mozRTCIceCandidate : RTCIceCandidate { + [Throws] + constructor(optional RTCIceCandidateInit candidateInitDict = {}); +}; [Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/peerconnection;1", - Constructor (optional RTCConfiguration configuration = {}, - optional object? constraints)] -interface mozRTCPeerConnection : RTCPeerConnection {}; + JSImplementation="@mozilla.org/dom/peerconnection;1"] +interface mozRTCPeerConnection : RTCPeerConnection { + [Throws] + constructor(optional RTCConfiguration configuration = {}, + optional object? constraints); +}; [Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/rtcsessiondescription;1", - Constructor(optional RTCSessionDescriptionInit descriptionInitDict = {})] -interface mozRTCSessionDescription : RTCSessionDescription {}; + JSImplementation="@mozilla.org/dom/rtcsessiondescription;1"] +interface mozRTCSessionDescription : RTCSessionDescription { + [Throws] + constructor(optional RTCSessionDescriptionInit descriptionInitDict = {}); +};
--- a/dom/webidl/Worker.webidl +++ b/dom/webidl/Worker.webidl @@ -7,19 +7,21 @@ * https://html.spec.whatwg.org/multipage/workers.html * * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera * Software ASA. * You are granted a license to use, reproduce and create derivative works of * this document. */ -[Constructor(USVString scriptURL, optional WorkerOptions options = {}), - Exposed=(Window,DedicatedWorker,SharedWorker)] +[Exposed=(Window,DedicatedWorker,SharedWorker)] interface Worker : EventTarget { + [Throws] + constructor(USVString scriptURL, optional WorkerOptions options = {}); + void terminate(); [Throws] void postMessage(any message, sequence<object> transfer); [Throws] void postMessage(any message, optional PostMessageOptions aOptions = {}); attribute EventHandler onmessage; @@ -29,13 +31,14 @@ interface Worker : EventTarget { Worker implements AbstractWorker; dictionary WorkerOptions { // WorkerType type = "classic"; TODO: Bug 1247687 // RequestCredentials credentials = "omit"; // credentials is only used if type is "module" TODO: Bug 1247687 DOMString name = ""; }; -[Constructor(USVString scriptURL), - Func="mozilla::dom::ChromeWorker::WorkerAvailable", +[Func="mozilla::dom::ChromeWorker::WorkerAvailable", Exposed=(Window,DedicatedWorker,SharedWorker)] interface ChromeWorker : Worker { + [Throws] + constructor(USVString scriptURL); };
--- a/dom/webidl/XMLHttpRequest.webidl +++ b/dom/webidl/XMLHttpRequest.webidl @@ -37,24 +37,27 @@ dictionary MozXMLHttpRequestParameters boolean mozAnon = false; /** * If true, the same origin policy will not be enforced on the request. */ boolean mozSystem = false; }; -[Constructor(optional MozXMLHttpRequestParameters params = {}), - // There are apparently callers, specifically CoffeeScript, who do - // things like this: - // c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP") - // To handle that, we need a constructor that takes a string. - Constructor(DOMString ignored), - Exposed=(Window,DedicatedWorker,SharedWorker)] +[Exposed=(Window,DedicatedWorker,SharedWorker)] interface XMLHttpRequest : XMLHttpRequestEventTarget { + [Throws] + constructor(optional MozXMLHttpRequestParameters params = {}); + // There are apparently callers, specifically CoffeeScript, who do + // things like this: + // c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP") + // To handle that, we need a constructor that takes a string. + [Throws] + constructor(DOMString ignored); + // event handler attribute EventHandler onreadystatechange; // states const unsigned short UNSENT = 0; const unsigned short OPENED = 1; const unsigned short HEADERS_RECEIVED = 2; const unsigned short LOADING = 3;
--- a/dom/webidl/XMLSerializer.webidl +++ b/dom/webidl/XMLSerializer.webidl @@ -3,18 +3,19 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * http://domparsing.spec.whatwg.org/#the-xmlserializer-interface */ interface OutputStream; -[Constructor] interface XMLSerializer { + constructor(); + /** * The subtree rooted by the specified element is serialized to * a string. * * @param root The root of the subtree to be serialized. This could * be any node, including a Document. * @returns The serialized subtree in the form of a Unicode string */
--- a/dom/webidl/XPathEvaluator.webidl +++ b/dom/webidl/XPathEvaluator.webidl @@ -1,16 +1,17 @@ /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor] interface XPathEvaluator { + constructor(); + [NewObject, Throws] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null); [Pure] Node createNSResolver(Node nodeResolver); [Throws] XPathResult evaluate(DOMString expression, Node contextNode,
--- a/dom/webidl/XSLTProcessor.webidl +++ b/dom/webidl/XSLTProcessor.webidl @@ -1,17 +1,18 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ interface nsIVariant; -[Constructor] interface XSLTProcessor { + constructor(); + /** * Import the stylesheet into this XSLTProcessor for transformations. * * @param style The root-node of a XSLT stylesheet. This can be either * a document node or an element node. If a document node * then the document can contain either a XSLT stylesheet * or a LRE stylesheet. * If the argument is an element node it must be the
--- a/dom/xslt/xpath/XPathEvaluator.cpp +++ b/dom/xslt/xpath/XPathEvaluator.cpp @@ -103,18 +103,17 @@ XPathExpression* XPathEvaluator::CreateE bool XPathEvaluator::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) { return dom::XPathEvaluator_Binding::Wrap(aCx, this, aGivenProto, aReflector); } /* static */ -XPathEvaluator* XPathEvaluator::Constructor(const GlobalObject& aGlobal, - ErrorResult& rv) { +XPathEvaluator* XPathEvaluator::Constructor(const GlobalObject& aGlobal) { return new XPathEvaluator(nullptr); } already_AddRefed<XPathResult> XPathEvaluator::Evaluate( JSContext* aCx, const nsAString& aExpression, nsINode& aContextNode, XPathNSResolver* aResolver, uint16_t aType, JS::Handle<JSObject*> aResult, ErrorResult& rv) { nsAutoPtr<XPathExpression> expression(
--- a/dom/xslt/xpath/XPathEvaluator.h +++ b/dom/xslt/xpath/XPathEvaluator.h @@ -36,18 +36,17 @@ class XPathEvaluator final : public NonR // WebIDL API bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); Document* GetParentObject() { nsCOMPtr<Document> doc = do_QueryReferent(mDocument); return doc; } - static XPathEvaluator* Constructor(const GlobalObject& aGlobal, - ErrorResult& rv); + static XPathEvaluator* Constructor(const GlobalObject& aGlobal); XPathExpression* CreateExpression(const nsAString& aExpression, XPathNSResolver* aResolver, ErrorResult& rv); XPathExpression* CreateExpression(const nsAString& aExpression, nsINode* aResolver, ErrorResult& aRv); XPathExpression* CreateExpression(const nsAString& aExpression, txIParseContext* aContext, Document* aDocument, ErrorResult& aRv);
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp +++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp @@ -1094,17 +1094,17 @@ JSObject* txMozillaXSLTProcessor::WrapOb } DocGroup* txMozillaXSLTProcessor::GetDocGroup() const { return mStylesheetDocument ? mStylesheetDocument->GetDocGroup() : nullptr; } /* static */ already_AddRefed<txMozillaXSLTProcessor> txMozillaXSLTProcessor::Constructor( - const GlobalObject& aGlobal, mozilla::ErrorResult& aRv) { + const GlobalObject& aGlobal) { RefPtr<txMozillaXSLTProcessor> processor = new txMozillaXSLTProcessor(aGlobal.GetAsSupports()); return processor.forget(); } void txMozillaXSLTProcessor::SetParameter(JSContext* aCx, const nsAString& aNamespaceURI, const nsAString& aLocalName,
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.h +++ b/dom/xslt/xslt/txMozillaXSLTProcessor.h @@ -79,17 +79,17 @@ class txMozillaXSLTProcessor final : pub JS::Handle<JSObject*> aGivenProto) override; // WebIDL nsISupports* GetParentObject() const { return mOwner; } mozilla::dom::DocGroup* GetDocGroup() const; static already_AddRefed<txMozillaXSLTProcessor> Constructor( - const mozilla::dom::GlobalObject& aGlobal, mozilla::ErrorResult& aRv); + const mozilla::dom::GlobalObject& aGlobal); void ImportStylesheet(nsINode& stylesheet, mozilla::ErrorResult& aRv); already_AddRefed<mozilla::dom::DocumentFragment> TransformToFragment( nsINode& source, mozilla::dom::Document& docVal, mozilla::ErrorResult& aRv); already_AddRefed<mozilla::dom::Document> TransformToDocument( nsINode& source, mozilla::ErrorResult& aRv);
--- a/gfx/layers/apz/util/CheckerboardReportService.cpp +++ b/gfx/layers/apz/util/CheckerboardReportService.cpp @@ -161,18 +161,17 @@ bool CheckerboardReportService::IsEnable } // Allow privileged code or about:checkerboard (unprivileged) to access this. return nsContentUtils::IsSystemCaller(aCtx) || nsContentUtils::IsSpecificAboutPage(aGlobal, "about:checkerboard"); } /*static*/ already_AddRefed<CheckerboardReportService> -CheckerboardReportService::Constructor(const dom::GlobalObject& aGlobal, - ErrorResult& aRv) { +CheckerboardReportService::Constructor(const dom::GlobalObject& aGlobal) { RefPtr<CheckerboardReportService> ces = new CheckerboardReportService(aGlobal.GetAsSupports()); return ces.forget(); } CheckerboardReportService::CheckerboardReportService(nsISupports* aParent) : mParent(aParent) {}
--- a/gfx/layers/apz/util/CheckerboardReportService.h +++ b/gfx/layers/apz/util/CheckerboardReportService.h @@ -100,17 +100,17 @@ class CheckerboardReportService : public */ static bool IsEnabled(JSContext* aCtx, JSObject* aGlobal); /* * Other standard WebIDL binding glue. */ static already_AddRefed<CheckerboardReportService> Constructor( - const dom::GlobalObject& aGlobal, ErrorResult& aRv); + const dom::GlobalObject& aGlobal); explicit CheckerboardReportService(nsISupports* aSupports); JSObject* WrapObject(JSContext* aCtx, JS::Handle<JSObject*> aGivenProto) override; nsISupports* GetParentObject();
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -227,17 +227,17 @@ RTCStatsQuery::RTCStatsQuery(bool aInter grabAllLevels(false), now(0.0) {} RTCStatsQuery::~RTCStatsQuery() {} NS_IMPL_ISUPPORTS0(PeerConnectionImpl) already_AddRefed<PeerConnectionImpl> PeerConnectionImpl::Constructor( - const dom::GlobalObject& aGlobal, ErrorResult& rv) { + const dom::GlobalObject& aGlobal) { RefPtr<PeerConnectionImpl> pc = new PeerConnectionImpl(&aGlobal); CSFLogDebug(LOGTAG, "Created PeerConnection: %p", pc.get()); return pc.forget(); } PeerConnectionImpl* PeerConnectionImpl::CreatePeerConnection() {
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h @@ -170,17 +170,17 @@ class PeerConnectionImpl final const mozilla::dom::GlobalObject* aGlobal = nullptr); NS_DECL_THREADSAFE_ISUPPORTS bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); static already_AddRefed<PeerConnectionImpl> Constructor( - const mozilla::dom::GlobalObject& aGlobal, ErrorResult& rv); + const mozilla::dom::GlobalObject& aGlobal); static PeerConnectionImpl* CreatePeerConnection(); nsresult CreateRemoteSourceStreamInfo(RefPtr<RemoteSourceStreamInfo>* aInfo, const std::string& aId); // DataConnection observers void NotifyDataChannel(already_AddRefed<mozilla::DataChannel> aChannel) // PeerConnectionImpl only inherits from mozilla::DataChannelConnection