diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 3ae461e5a67b..a6778e68b8e8 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -4462,14 +4462,14 @@ TextMetrics* CanvasRenderingContext2D::DrawOrMeasureText( const nsAString& aRawText, float aX, float aY, const Optional& aMaxWidth, TextDrawOperation aOp, ErrorResult& aError) { - gfxFontGroup* currentFontStyle = GetCurrentFontStyle(); + RefPtr currentFontStyle = GetCurrentFontStyle(); if (NS_WARN_IF(!currentFontStyle)) { aError = NS_ERROR_FAILURE; return nullptr; } RefPtr presShell = GetPresShell(); - Document* document = presShell ? presShell->GetDocument() : nullptr; + RefPtr document = presShell ? presShell->GetDocument() : nullptr; // replace all the whitespace characters with U+0020 SPACE nsAutoString textToDraw(aRawText);