mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-18 05:07:31 +09:00
Issue #2241 - Part 6: Implement DOMMatrix.fromMatrix.
Also fixes .multiply() to use DOMMatrixInit. Backported from Mozilla bug 1560462.
This commit is contained in:
parent
51f812bb80
commit
10bdcb7e5f
7 changed files with 226 additions and 24 deletions
|
|
@ -25,6 +25,7 @@ class DOMMatrix;
|
|||
class DOMPoint;
|
||||
class StringOrUnrestrictedDoubleSequence;
|
||||
struct DOMPointInit;
|
||||
struct DOMMatrixInit;
|
||||
|
||||
class DOMMatrixReadOnly : public nsWrapperCache
|
||||
{
|
||||
|
|
@ -56,6 +57,9 @@ public:
|
|||
nsISupports* GetParentObject() const { return mParent; }
|
||||
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
static already_AddRefed<DOMMatrixReadOnly>
|
||||
FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
|
||||
static already_AddRefed<DOMMatrixReadOnly>
|
||||
Constructor(const GlobalObject& aGlobal, const Optional<StringOrUnrestrictedDoubleSequence>& aArg, ErrorResult& aRv);
|
||||
|
||||
|
|
@ -180,7 +184,8 @@ public:
|
|||
double aAngle) const;
|
||||
already_AddRefed<DOMMatrix> SkewX(double aSx) const;
|
||||
already_AddRefed<DOMMatrix> SkewY(double aSy) const;
|
||||
already_AddRefed<DOMMatrix> Multiply(const DOMMatrix& aOther) const;
|
||||
already_AddRefed<DOMMatrix> Multiply(const DOMMatrixInit& aOther,
|
||||
ErrorResult& aRv) const;
|
||||
already_AddRefed<DOMMatrix> FlipX() const;
|
||||
already_AddRefed<DOMMatrix> FlipY() const;
|
||||
already_AddRefed<DOMMatrix> Inverse() const;
|
||||
|
|
@ -204,6 +209,13 @@ protected:
|
|||
|
||||
virtual ~DOMMatrixReadOnly() {}
|
||||
|
||||
/**
|
||||
* Sets data from a fully validated and fixed-up matrix init,
|
||||
* where all of its members are properly defined.
|
||||
* The init dictionary's dimension must match the matrix one.
|
||||
*/
|
||||
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
|
||||
|
||||
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
|
||||
void Ensure3DMatrix();
|
||||
|
||||
|
|
@ -236,6 +248,11 @@ public:
|
|||
: DOMMatrixReadOnly(aParent, aMatrix)
|
||||
{}
|
||||
|
||||
static already_AddRefed<DOMMatrix>
|
||||
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
static already_AddRefed<DOMMatrix>
|
||||
FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
|
||||
static already_AddRefed<DOMMatrix>
|
||||
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||
static already_AddRefed<DOMMatrix>
|
||||
|
|
@ -254,8 +271,8 @@ public:
|
|||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
DOMMatrix* MultiplySelf(const DOMMatrix& aOther);
|
||||
DOMMatrix* PreMultiplySelf(const DOMMatrix& aOther);
|
||||
DOMMatrix* MultiplySelf(const DOMMatrixInit& aOther, ErrorResult& aRv);
|
||||
DOMMatrix* PreMultiplySelf(const DOMMatrixInit& aOther, ErrorResult& aRv);
|
||||
DOMMatrix* TranslateSelf(double aTx,
|
||||
double aTy,
|
||||
double aTz = 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue