Issue #2241 - Part 3: Extend DOMMatrixReadOnly to allow instantiation with a Matrix4x4.

Backported from Mozilla bug 1355675.
This commit is contained in:
Job Bautista 2023-05-11 22:03:17 +08:00 committed by roytam1
commit d2c3ea08eb

View file

@ -42,6 +42,12 @@ public:
}
}
DOMMatrixReadOnly(nsISupports* aParent, const gfx::Matrix4x4& aMatrix)
: mParent(aParent)
{
mMatrix3D = new gfx::Matrix4x4(aMatrix);
}
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
@ -154,6 +160,10 @@ public:
: DOMMatrixReadOnly(aParent, other)
{}
DOMMatrix(nsISupports* aParent, const gfx::Matrix4x4& aMatrix)
: DOMMatrixReadOnly(aParent, aMatrix)
{}
static already_AddRefed<DOMMatrix>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
static already_AddRefed<DOMMatrix>