Bug 1186265 - Remove DOMPoint constructor taking a DOMPointInit. r=bz
☠☠ backed out by 50aeb30fd283 ☠ ☠
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 29 Mar 2018 16:19:31 -0700
changeset 467449 f3a0b2686f45f6d3300901a78e5a770b79f93005
parent 467448 99c2396a4c8767d152e437299664d0e15c3d8e35
child 467450 2ba85ec7c9daf168c55c6240617720583f31cde4
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1186265
milestone61.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
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
dom/base/DOMPoint.cpp
dom/base/DOMPoint.h
dom/base/DOMQuad.cpp
dom/webidl/DOMPoint.webidl
--- a/dom/base/DOMPoint.cpp
+++ b/dom/base/DOMPoint.cpp
@@ -13,18 +13,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMPointReadOnly, mParent)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPointReadOnly, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPointReadOnly, Release)
 
 already_AddRefed<DOMPoint>
-DOMPoint::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
-                      ErrorResult& aRV)
+DOMPoint::FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams)
 {
   RefPtr<DOMPoint> obj =
     new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY,
                  aParams.mZ, aParams.mW);
   return obj.forget();
 }
 
 already_AddRefed<DOMPoint>
--- a/dom/base/DOMPoint.h
+++ b/dom/base/DOMPoint.h
@@ -53,18 +53,17 @@ class DOMPoint final : public DOMPointRe
 {
 public:
   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>
-  Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
-              ErrorResult& aRV);
+  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);
 
   nsISupports* GetParentObject() const { return mParent; }
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   void SetX(double aX) { mX = aX; }
--- a/dom/base/DOMQuad.cpp
+++ b/dom/base/DOMQuad.cpp
@@ -48,20 +48,20 @@ already_AddRefed<DOMQuad>
 DOMQuad::Constructor(const GlobalObject& aGlobal,
                      const DOMPointInit& aP1,
                      const DOMPointInit& aP2,
                      const DOMPointInit& aP3,
                      const DOMPointInit& aP4,
                      ErrorResult& aRV)
 {
   RefPtr<DOMQuad> 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();
 }
 
 already_AddRefed<DOMQuad>
 DOMQuad::Constructor(const GlobalObject& aGlobal, const DOMRectReadOnly& aRect,
                      ErrorResult& aRV)
 {
   CSSPoint points[4];
--- a/dom/webidl/DOMPoint.webidl
+++ b/dom/webidl/DOMPoint.webidl
@@ -14,24 +14,25 @@
 interface DOMPointReadOnly {
     readonly attribute unrestricted double x;
     readonly attribute unrestricted double y;
     readonly attribute unrestricted double z;
     readonly attribute unrestricted double w; 
 };
 
 [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;
     inherit attribute unrestricted double w;
 };
 
 dictionary DOMPointInit {
     unrestricted double x = 0;
     unrestricted double y = 0;
     unrestricted double z = 0;
     unrestricted double w = 1;
-};
\ No newline at end of file
+};