diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 685b1a8039c8..a51128a50aaf 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -3493,9 +3493,10 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor } else { flags &= ~gfx::ShapedTextFlags::TEXT_IS_RTL; } - mTextRun = - mFontgrp->MakeTextRun(aText, aLength, mDrawTarget, mAppUnitsPerDevPixel, - flags, nsTextFrameUtils::Flags(), mMissingFonts); + mTextRun = mFontgrp->MakeTextRun( + aText, aLength, mDrawTarget, mAppUnitsPerDevPixel, flags, + nsTextFrameUtils::Flags::DontSkipDrawingForPendingUserFonts, + mMissingFonts); } virtual nscoord GetWidth() override { diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 29840fed85eb..5e85b67baa29 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -183,7 +183,9 @@ gfxTextRun::gfxTextRun(const gfxTextRunFactory::Parameters* aParams, AccountStorageForTextRun(this, 1); #endif - mSkipDrawing = mFontGroup->ShouldSkipDrawing(); + mSkipDrawing = + mFontGroup->ShouldSkipDrawing() && + !(aFlags2 & nsTextFrameUtils::Flags::DontSkipDrawingForPendingUserFonts); } gfxTextRun::~gfxTextRun() { diff --git a/layout/generic/nsTextFrameUtils.h b/layout/generic/nsTextFrameUtils.h index 23ae55db4f23..0173b1282bfd 100644 --- a/layout/generic/nsTextFrameUtils.h +++ b/layout/generic/nsTextFrameUtils.h @@ -35,7 +35,11 @@ class nsTextFrameUtils { HasTab = 0x01, // the original text has at least one soft hyphen character HasShy = 0x02, - UnusedFlags = 0x0C, + UnusedFlags = 0x04, + + // Flag used in textrun construction to *prevent* hiding of fallback text + // for pending user-fonts (used for Canvas2d text). + DontSkipDrawingForPendingUserFonts = 0x08, // The following flags are set by nsTextFrame