Bug 1455940 - Remove constructors from SVGNumber r=mystor
authorRobert Longson <longsonr@gmail.com>
Wed, 25 Apr 2018 07:00:36 +0100
changeset 1494895 f9b99c0aa7fc4f061fe52332bb9bbcbb769ad2d9
parent 1494894 be541e099174094c130b196a3a1510c121730f4e
child 1494896 5af215d265b649a69975cc94886dd281c91f5908
child 1494993 a83a4ef50f6ca754ec451320dfefbffa707bad1a
push id267305
push userjcoppeard@mozilla.com
push dateWed, 25 Apr 2018 09:41:40 +0000
treeherdertry@1f99b434ea45 [default view] [failures only]
reviewersmystor
bugs1455940
milestone61.0a1
Bug 1455940 - Remove constructors from SVGNumber r=mystor
dom/svg/DOMSVGNumber.cpp
dom/svg/DOMSVGNumber.h
dom/webidl/SVGNumber.webidl
testing/web-platform/meta/svg/interfaces.html.ini
--- a/dom/svg/DOMSVGNumber.cpp
+++ b/dom/svg/DOMSVGNumber.cpp
@@ -106,46 +106,16 @@ DOMSVGNumber::DOMSVGNumber(nsISupports* 
   , mParent(aParent)
   , mListIndex(0)
   , mAttrEnum(0)
   , mIsAnimValItem(false)
   , mValue(0.0f)
 {
 }
 
-/* static */ already_AddRefed<DOMSVGNumber>
-DOMSVGNumber::Constructor(const dom::GlobalObject& aGlobal, ErrorResult& aRv)
-{
-  nsCOMPtr<nsPIDOMWindowInner> window =
-    do_QueryInterface(aGlobal.GetAsSupports());
-  if (!window) {
-    aRv.Throw(NS_ERROR_UNEXPECTED);
-    return nullptr;
-  }
-
-  RefPtr<DOMSVGNumber> number = new DOMSVGNumber(window);
-  return number.forget();
-}
-
-/* static */ already_AddRefed<DOMSVGNumber>
-DOMSVGNumber::Constructor(const dom::GlobalObject& aGlobal, float aValue,
-                          ErrorResult& aRv)
-{
-  nsCOMPtr<nsPIDOMWindowInner> window =
-    do_QueryInterface(aGlobal.GetAsSupports());
-  if (!window) {
-    aRv.Throw(NS_ERROR_UNEXPECTED);
-    return nullptr;
-  }
-
-  RefPtr<DOMSVGNumber> number = new DOMSVGNumber(window);
-  number->SetValue(aValue, aRv);
-  return number.forget();
-}
-
 float
 DOMSVGNumber::Value()
 {
   if (mIsAnimValItem && HasOwner()) {
     Element()->FlushAnimations(); // May make HasOwner() == false
   }
   return HasOwner() ? InternalItem() : mValue;
 }
--- a/dom/svg/DOMSVGNumber.h
+++ b/dom/svg/DOMSVGNumber.h
@@ -121,22 +121,16 @@ public:
 
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
-  static already_AddRefed<DOMSVGNumber>
-  Constructor(const dom::GlobalObject& aGlobal, ErrorResult& aRv);
-
-  static already_AddRefed<DOMSVGNumber>
-  Constructor(const dom::GlobalObject& aGlobal, float aValue, ErrorResult& aRv);
-
   float Value();
 
   void SetValue(float aValue, ErrorResult& aRv);
 
 private:
 
   nsSVGElement* Element() {
     return mList->Element();
--- a/dom/webidl/SVGNumber.webidl
+++ b/dom/webidl/SVGNumber.webidl
@@ -5,14 +5,12 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/SVG2/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor,
- Constructor(float value)]
 interface SVGNumber {
   [SetterThrows]
   attribute float value;
 };
--- a/testing/web-platform/meta/svg/interfaces.html.ini
+++ b/testing/web-platform/meta/svg/interfaces.html.ini
@@ -1,18 +1,15 @@
 [interfaces.html]
   [SVGGeometryElement interface: operation isPointInFill(DOMPoint)]
     expected: FAIL
 
   [SVGGeometryElement interface: operation isPointInStroke(DOMPoint)]
     expected: FAIL
 
-  [SVGNumber interface: existence and properties of interface object]
-    expected: FAIL
-
   [SVGSVGElement interface: operation getIntersectionList(DOMRectReadOnly,SVGElement)]
     expected: FAIL
 
   [SVGSVGElement interface: operation getEnclosureList(DOMRectReadOnly,SVGElement)]
     expected: FAIL
 
   [SVGSVGElement interface: operation checkIntersection(SVGElement,DOMRectReadOnly)]
     expected: FAIL