mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Issue #2241 - Part 7.2: Implement .fromRect and .fromQuad.
Backported from Mozilla bug 1558101.
This commit is contained in:
parent
0e2f687f4d
commit
4ec35fdcf2
6 changed files with 68 additions and 4 deletions
|
|
@ -27,6 +27,14 @@ DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRectReadOnly>
|
||||
DOMRectReadOnly::FromRect(const GlobalObject& aGlobal, const DOMRectInit& aInit)
|
||||
{
|
||||
RefPtr<DOMRectReadOnly> obj = new DOMRectReadOnly(
|
||||
aGlobal.GetAsSupports(), aInit.mX, aInit.mY, aInit.mWidth, aInit.mHeight);
|
||||
return obj.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRectReadOnly>
|
||||
DOMRectReadOnly::Constructor(const GlobalObject& aGlobal, double aX, double aY,
|
||||
double aWidth, double aHeight, ErrorResult& aRv)
|
||||
|
|
@ -98,6 +106,14 @@ DOMRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
return DOMRectBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRect>
|
||||
DOMRect::FromRect(const GlobalObject& aGlobal, const DOMRectInit& aInit)
|
||||
{
|
||||
RefPtr<DOMRect> obj = new DOMRect(aGlobal.GetAsSupports(), aInit.mX, aInit.mY,
|
||||
aInit.mWidth, aInit.mHeight);
|
||||
return obj.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRect>
|
||||
DOMRect::Constructor(const GlobalObject& aGlobal, double aX, double aY,
|
||||
double aWidth, double aHeight, ErrorResult& aRv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue