diff options
Diffstat (limited to '')
-rw-r--r-- | dom/canvas/CanvasRenderingContext2D.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 1a79a9f734..54711aa981 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -2216,14 +2216,16 @@ void CanvasRenderingContext2D::Transform(double aM11, double aM12, double aM21, already_AddRefed<DOMMatrix> CanvasRenderingContext2D::GetTransform( ErrorResult& aError) { - if (!EnsureTarget(aError)) { + // If we are silently failing, then we still need to return a transform while + // we are in the process of recovering. + Matrix transform; + if (EnsureTarget(aError)) { + transform = mTarget->GetTransform(); + } else if (aError.Failed()) { return nullptr; } - MOZ_ASSERT(IsTargetValid()); - - RefPtr<DOMMatrix> matrix = - new DOMMatrix(GetParentObject(), mTarget->GetTransform()); + RefPtr<DOMMatrix> matrix = new DOMMatrix(GetParentObject(), transform); return matrix.forget(); } |