Issue #2241 - Part 4.1: Get DOMPoint, DOMQuad, DOMRect, DOMMatrix a bit closer to spec.

Backported from Mozilla bug 1186265's part 1.
This commit is contained in:
Job Bautista 2023-05-12 11:35:18 +08:00 committed by roytam1
commit 60c88dd11b
14 changed files with 252 additions and 198 deletions

View file

@ -27,6 +27,15 @@ DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<DOMRectReadOnly>
DOMRectReadOnly::Constructor(const GlobalObject& aGlobal, double aX, double aY,
double aWidth, double aHeight, ErrorResult& aRv)
{
RefPtr<DOMRectReadOnly> obj =
new DOMRectReadOnly(aGlobal.GetAsSupports(), aX, aY, aWidth, aHeight);
return obj.forget();
}
// -----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS_INHERITED(DOMRect, DOMRectReadOnly, nsIDOMClientRect)
@ -53,17 +62,9 @@ DOMRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return DOMRectBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<DOMRect>
DOMRect::Constructor(const GlobalObject& aGlobal, ErrorResult& aRV)
{
RefPtr<DOMRect> obj =
new DOMRect(aGlobal.GetAsSupports(), 0.0, 0.0, 0.0, 0.0);
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, ErrorResult& aRv)
{
RefPtr<DOMRect> obj =
new DOMRect(aGlobal.GetAsSupports(), aX, aY, aWidth, aHeight);