mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
2dea274c15
6 changed files with 61 additions and 12 deletions
|
|
@ -129,17 +129,12 @@ DOMMatrixReadOnly::SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit) {
|
|||
}
|
||||
|
||||
void
|
||||
DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
|
||||
DOMMatrixReadOnly::SetDataFromMatrixInit(const DOMMatrixInit& aMatrixInit)
|
||||
{
|
||||
const bool is2D = aMatrixInit.mIs2D.Value();
|
||||
MOZ_ASSERT(is2D == Is2D());
|
||||
if (is2D) {
|
||||
mMatrix2D->_11 = aMatrixInit.mM11.Value();
|
||||
mMatrix2D->_12 = aMatrixInit.mM12.Value();
|
||||
mMatrix2D->_21 = aMatrixInit.mM21.Value();
|
||||
mMatrix2D->_22 = aMatrixInit.mM22.Value();
|
||||
mMatrix2D->_31 = aMatrixInit.mM41.Value();
|
||||
mMatrix2D->_32 = aMatrixInit.mM42.Value();
|
||||
SetDataFromMatrix2DInit(aMatrixInit);
|
||||
} else {
|
||||
mMatrix3D->_11 = aMatrixInit.mM11.Value();
|
||||
mMatrix3D->_12 = aMatrixInit.mM12.Value();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ public:
|
|||
mMatrix3D = new gfx::Matrix4x4(aMatrix);
|
||||
}
|
||||
|
||||
DOMMatrixReadOnly(nsISupports* aParent, const gfx::Matrix& aMatrix)
|
||||
: mParent(aParent) {
|
||||
mMatrix2D = new gfx::Matrix(aMatrix);
|
||||
}
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
|
||||
|
||||
|
|
@ -234,7 +239,7 @@ protected:
|
|||
* The init dictionary's dimension must match the matrix one.
|
||||
*/
|
||||
void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit);
|
||||
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
|
||||
void SetDataFromMatrixInit(const DOMMatrixInit& aMatrixInit);
|
||||
|
||||
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
|
||||
void Ensure3DMatrix();
|
||||
|
|
@ -268,6 +273,10 @@ public:
|
|||
: DOMMatrixReadOnly(aParent, aMatrix)
|
||||
{}
|
||||
|
||||
DOMMatrix(nsISupports* aParent, const gfx::Matrix& aMatrix)
|
||||
: DOMMatrixReadOnly(aParent, aMatrix)
|
||||
{}
|
||||
|
||||
static already_AddRefed<DOMMatrix>
|
||||
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
static already_AddRefed<DOMMatrix>
|
||||
|
|
|
|||
|
|
@ -4888,6 +4888,16 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
raise WebIDLError("StaticClassOverride can be applied to static"
|
||||
" methods on JS-implemented classes only.",
|
||||
[self.location])
|
||||
if self.getExtendedAttribute("LenientFloat"):
|
||||
assert len(self.signatures()) >= 1
|
||||
found = False
|
||||
for sig in self.signatures():
|
||||
if any(arg.type.includesRestrictedFloat() for arg in sig[1]):
|
||||
found = True
|
||||
if not found:
|
||||
raise WebIDLError("[LenientFloat] used on an operation with no "
|
||||
"restricted float type arguments",
|
||||
[self.location])
|
||||
|
||||
def overloadsForArgCount(self, argc):
|
||||
return [overload for overload in self._overloads if
|
||||
|
|
@ -4966,10 +4976,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
if not sig[0].isVoid():
|
||||
raise WebIDLError("[LenientFloat] used on a non-void method",
|
||||
[attr.location, self.location])
|
||||
if not any(arg.type.includesRestrictedFloat() for arg in sig[1]):
|
||||
raise WebIDLError("[LenientFloat] used on an operation with no "
|
||||
"restricted float type arguments",
|
||||
[attr.location, self.location])
|
||||
elif identifier == "Exposed":
|
||||
convertExposedAttrToGlobalNameSet(attr, self._exposureGlobalNames)
|
||||
elif (identifier == "CrossOriginCallable" or
|
||||
|
|
|
|||
|
|
@ -2229,6 +2229,18 @@ CanvasRenderingContext2D::Transform(double aM11, double aM12, double aM21,
|
|||
SetTransformInternal(newMatrix);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMMatrix>
|
||||
CanvasRenderingContext2D::GetTransform(ErrorResult& aError) {
|
||||
EnsureTarget();
|
||||
if (!IsTargetValid()) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<DOMMatrix> matrix =
|
||||
new DOMMatrix(GetParentObject(), mTarget->GetTransform());
|
||||
return matrix.forget();
|
||||
}
|
||||
|
||||
void
|
||||
CanvasRenderingContext2D::SetTransform(double aM11, double aM12,
|
||||
double aM21, double aM22,
|
||||
|
|
@ -2244,6 +2256,22 @@ CanvasRenderingContext2D::SetTransform(double aM11, double aM12,
|
|||
SetTransformInternal(Matrix(aM11, aM12, aM21, aM22, aDx, aDy));
|
||||
}
|
||||
|
||||
void
|
||||
CanvasRenderingContext2D::SetTransform(const DOMMatrix2DInit& aInit,
|
||||
ErrorResult& aError) {
|
||||
TransformWillUpdate();
|
||||
if (!IsTargetValid()) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<DOMMatrixReadOnly> matrix =
|
||||
DOMMatrixReadOnly::FromMatrix(GetParentObject(), aInit, aError);
|
||||
if (!aError.Failed()) {
|
||||
SetTransformInternal(Matrix(*(matrix->GetInternal2D())));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CanvasRenderingContext2D::SetTransformInternal(const Matrix& aTransform)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ class CanvasRenderingContext2DUserData;
|
|||
class CanvasDrawObserver;
|
||||
class CanvasShutdownObserver;
|
||||
|
||||
class DOMMatrix;
|
||||
class DOMMatrixReadOnly;
|
||||
struct DOMMatrix2DInit;
|
||||
|
||||
/**
|
||||
** CanvasRenderingContext2D
|
||||
**/
|
||||
|
|
@ -88,8 +92,10 @@ public:
|
|||
void Translate(double aX, double aY, mozilla::ErrorResult& aError);
|
||||
void Transform(double aM11, double aM12, double aM21, double aM22, double aDx,
|
||||
double aDy, mozilla::ErrorResult& aError);
|
||||
already_AddRefed<DOMMatrix> GetTransform(mozilla::ErrorResult& aError);
|
||||
void SetTransform(double aM11, double aM12, double aM21, double aM22, double aDx,
|
||||
double aDy, mozilla::ErrorResult& aError);
|
||||
void SetTransform(const DOMMatrix2DInit& aInit, mozilla::ErrorResult& aError);
|
||||
void ResetTransform(mozilla::ErrorResult& aError);
|
||||
|
||||
double GlobalAlpha()
|
||||
|
|
|
|||
|
|
@ -54,8 +54,13 @@ interface CanvasRenderingContext2D {
|
|||
void translate(double x, double y);
|
||||
[Throws, LenientFloat]
|
||||
void transform(double a, double b, double c, double d, double e, double f);
|
||||
|
||||
[NewObject, Throws]
|
||||
DOMMatrix getTransform();
|
||||
[Throws, LenientFloat]
|
||||
void setTransform(double a, double b, double c, double d, double e, double f);
|
||||
[Throws, LenientFloat]
|
||||
void setTransform(optional DOMMatrix2DInit transform);
|
||||
[Throws]
|
||||
void resetTransform();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue