From 3e329eb8bb6da6575d49f9e92c195281521add30 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Thu, 29 Mar 2018 16:19:31 -0700 Subject: [PATCH] Bug 1186265 - Remove DOMPoint constructor taking a DOMPointInit. r=bz The Web IDL for DOMPoint no longer has this constructor. As far as I can tell, it is still unused, so let's follow the spec. MozReview-Commit-ID: 6Lz1BN5YAV5 --HG-- extra : rebase_source : 04b70b673e63d7cea1e528009526285a4af8f472 --- dom/base/DOMPoint.cpp | 3 +-- dom/base/DOMPoint.h | 3 +-- dom/base/DOMQuad.cpp | 8 ++++---- dom/webidl/DOMPoint.webidl | 5 +++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dom/base/DOMPoint.cpp b/dom/base/DOMPoint.cpp index 0ea5d05aef01..50d63a8c916d 100644 --- a/dom/base/DOMPoint.cpp +++ b/dom/base/DOMPoint.cpp @@ -18,8 +18,7 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPointReadOnly, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPointReadOnly, Release) already_AddRefed -DOMPoint::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams, - ErrorResult& aRV) +DOMPoint::FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams) { RefPtr obj = new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY, diff --git a/dom/base/DOMPoint.h b/dom/base/DOMPoint.h index d9a429be55a0..35059f9988c9 100644 --- a/dom/base/DOMPoint.h +++ b/dom/base/DOMPoint.h @@ -58,8 +58,7 @@ public: {} static already_AddRefed - Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams, - ErrorResult& aRV); + FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams); static already_AddRefed Constructor(const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW, ErrorResult& aRV); diff --git a/dom/base/DOMQuad.cpp b/dom/base/DOMQuad.cpp index fb5479dd5936..9f28eb9fa4b5 100644 --- a/dom/base/DOMQuad.cpp +++ b/dom/base/DOMQuad.cpp @@ -53,10 +53,10 @@ DOMQuad::Constructor(const GlobalObject& aGlobal, ErrorResult& aRV) { RefPtr obj = new DOMQuad(aGlobal.GetAsSupports()); - obj->mPoints[0] = DOMPoint::Constructor(aGlobal, aP1, aRV); - obj->mPoints[1] = DOMPoint::Constructor(aGlobal, aP2, aRV); - obj->mPoints[2] = DOMPoint::Constructor(aGlobal, aP3, aRV); - obj->mPoints[3] = DOMPoint::Constructor(aGlobal, aP4, aRV); + 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(); } diff --git a/dom/webidl/DOMPoint.webidl b/dom/webidl/DOMPoint.webidl index d092d900f51e..76d8e5f8d98d 100644 --- a/dom/webidl/DOMPoint.webidl +++ b/dom/webidl/DOMPoint.webidl @@ -19,10 +19,11 @@ interface DOMPointReadOnly { }; [Pref="layout.css.DOMPoint.enabled", - Constructor(optional DOMPointInit point), Constructor(unrestricted double x, unrestricted double y, optional unrestricted double z = 0, optional unrestricted double w = 1)] interface DOMPoint : DOMPointReadOnly { + [NewObject] static DOMPoint fromPoint(optional DOMPointInit other); + inherit attribute unrestricted double x; inherit attribute unrestricted double y; inherit attribute unrestricted double z; @@ -34,4 +35,4 @@ dictionary DOMPointInit { unrestricted double y = 0; unrestricted double z = 0; unrestricted double w = 1; -}; \ No newline at end of file +};