Bug 814149. Fix GetCanvas. r=bz

This commit is contained in:
Nicholas Cameron 2012-11-22 10:55:36 +13:00
parent bdc8045c11
commit 0992344f55
3 changed files with 5 additions and 4 deletions

View File

@ -143,7 +143,8 @@ public:
nsHTMLCanvasElement* GetCanvas() const
{
return mCanvasElement;
// corresponds to changes to the old bindings made in bug 745025
return mCanvasElement->GetOriginalCanvas();
}
void Save();

View File

@ -173,7 +173,7 @@ protected:
void CallPrintCallback();
nsString mCurrentContextId;
nsCOMPtr<nsIDOMHTMLCanvasElement> mOriginalCanvas;
nsRefPtr<nsHTMLCanvasElement> mOriginalCanvas;
nsCOMPtr<nsIPrintCallback> mPrintCallback;
nsCOMPtr<nsICanvasRenderingContextInternal> mCurrentContext;
nsCOMPtr<nsHTMLCanvasPrintState> mPrintState;
@ -193,7 +193,7 @@ public:
void ResetPrintCallback();
nsIDOMHTMLCanvasElement* GetOriginalCanvas();
nsHTMLCanvasElement* GetOriginalCanvas();
};
inline nsISupports*

View File

@ -307,7 +307,7 @@ nsHTMLCanvasElement::IsPrintCallbackDone()
return mPrintState->mIsDone;
}
nsIDOMHTMLCanvasElement*
nsHTMLCanvasElement*
nsHTMLCanvasElement::GetOriginalCanvas()
{
return mOriginalCanvas ? mOriginalCanvas.get() : this;