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

@ -16,9 +16,32 @@ 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<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)
{
RefPtr<DOMPointReadOnly> obj =
new DOMPointReadOnly(aGlobal.GetAsSupports(), aX, aY, aZ, aW);
return obj.forget();
}
JSObject*
DOMPointReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMPointReadOnlyBinding::Wrap(aCx, this, aGivenProto);
}
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,