diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index c2897312165..e9efda6bf5a 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -3083,22 +3083,6 @@ CanvasRenderingContext2D::GetHitRegionRect(Element* aElement, nsRect& aRect) */ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor { - CanvasBidiProcessor() - : nsBidiPresUtils::BidiProcessor() - { - if (Preferences::GetBool(GFX_MISSING_FONTS_NOTIFY_PREF)) { - mMissingFonts = new gfxMissingFontRecorder(); - } - } - - ~CanvasBidiProcessor() - { - // notify front-end code if we encountered missing glyphs in any script - if (mMissingFonts) { - mMissingFonts->Flush(); - } - } - typedef CanvasRenderingContext2D::ContextState ContextState; virtual void SetText(const char16_t* text, int32_t length, nsBidiDirection direction) @@ -3115,8 +3099,7 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess length, mThebes, mAppUnitsPerDevPixel, - flags, - mMissingFonts); + flags); } virtual nscoord GetWidth() @@ -3354,10 +3337,6 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess // current font gfxFontGroup* mFontgrp; - // to record any unsupported characters found in the text, - // and notify front-end if it is interested - nsAutoPtr mMissingFonts; - // dev pixel conversion factor int32_t mAppUnitsPerDevPixel; diff --git a/gfx/src/nsFontMetrics.cpp b/gfx/src/nsFontMetrics.cpp index f8d2fcbfb93..95f2c4c5a30 100644 --- a/gfx/src/nsFontMetrics.cpp +++ b/gfx/src/nsFontMetrics.cpp @@ -33,8 +33,7 @@ public: reinterpret_cast(aString), aLength, aRC->ThebesContext(), aMetrics->AppUnitsPerDevPixel(), - ComputeFlags(aMetrics), - nullptr); + ComputeFlags(aMetrics)); } AutoTextRun(nsFontMetrics* aMetrics, nsRenderingContext* aRC, @@ -44,8 +43,7 @@ public: aString, aLength, aRC->ThebesContext(), aMetrics->AppUnitsPerDevPixel(), - ComputeFlags(aMetrics), - nullptr); + ComputeFlags(aMetrics)); } gfxTextRun *get() { return mTextRun; } diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 0c98ed6839b..21ce71f129e 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -28,7 +28,6 @@ using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::unicode; -using mozilla::services::GetObserverService; static const char16_t kEllipsisChar[] = { 0x2026, 0x0 }; static const char16_t kASCIIPeriodsChar[] = { '.', '.', '.', 0x0 }; @@ -2039,12 +2038,12 @@ gfxFontGroup::MakeHyphenTextRun(gfxContext *aCtx, uint32_t aAppUnitsPerDevUnit) gfxFont *font = GetFirstValidFont(uint32_t(hyphen)); if (font->HasCharacter(hyphen)) { return MakeTextRun(&hyphen, 1, aCtx, aAppUnitsPerDevUnit, - gfxFontGroup::TEXT_IS_PERSISTENT, nullptr); + gfxFontGroup::TEXT_IS_PERSISTENT); } static const uint8_t dash = '-'; return MakeTextRun(&dash, 1, aCtx, aAppUnitsPerDevUnit, - gfxFontGroup::TEXT_IS_PERSISTENT, nullptr); + gfxFontGroup::TEXT_IS_PERSISTENT); } gfxFloat @@ -2065,8 +2064,7 @@ gfxFontGroup::GetHyphenWidth(gfxTextRun::PropertyProvider *aProvider) gfxTextRun * gfxFontGroup::MakeTextRun(const uint8_t *aString, uint32_t aLength, - const Parameters *aParams, uint32_t aFlags, - gfxMissingFontRecorder *aMFR) + const Parameters *aParams, uint32_t aFlags) { if (aLength == 0) { return MakeEmptyTextRun(aParams, aFlags); @@ -2090,7 +2088,7 @@ gfxFontGroup::MakeTextRun(const uint8_t *aString, uint32_t aLength, return nullptr; } - InitTextRun(aParams->mContext, textRun, aString, aLength, aMFR); + InitTextRun(aParams->mContext, textRun, aString, aLength); textRun->FetchGlyphExtents(aParams->mContext); @@ -2099,8 +2097,7 @@ gfxFontGroup::MakeTextRun(const uint8_t *aString, uint32_t aLength, gfxTextRun * gfxFontGroup::MakeTextRun(const char16_t *aString, uint32_t aLength, - const Parameters *aParams, uint32_t aFlags, - gfxMissingFontRecorder *aMFR) + const Parameters *aParams, uint32_t aFlags) { if (aLength == 0) { return MakeEmptyTextRun(aParams, aFlags); @@ -2118,7 +2115,7 @@ gfxFontGroup::MakeTextRun(const char16_t *aString, uint32_t aLength, return nullptr; } - InitTextRun(aParams->mContext, textRun, aString, aLength, aMFR); + InitTextRun(aParams->mContext, textRun, aString, aLength); textRun->FetchGlyphExtents(aParams->mContext); @@ -2130,8 +2127,7 @@ void gfxFontGroup::InitTextRun(gfxContext *aContext, gfxTextRun *aTextRun, const T *aString, - uint32_t aLength, - gfxMissingFontRecorder *aMFR) + uint32_t aLength) { NS_ASSERTION(aLength > 0, "don't call InitTextRun for a zero-length run"); @@ -2211,7 +2207,7 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, // the text is still purely 8-bit; bypass the script-run itemizer // and treat it as a single Latin run InitScriptRun(aContext, aTextRun, aString, - 0, aLength, MOZ_SCRIPT_LATIN, aMFR); + 0, aLength, MOZ_SCRIPT_LATIN); } else { const char16_t *textPtr; if (transformedString) { @@ -2259,7 +2255,7 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, #endif InitScriptRun(aContext, aTextRun, textPtr + runStart, - runStart, runLimit - runStart, runScript, aMFR); + runStart, runLimit - runStart, runScript); } } @@ -2295,14 +2291,6 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, aTextRun->SortGlyphRuns(); } -static inline bool -IsPUA(uint32_t aUSV) -{ - // We could look up the General Category of the codepoint here, - // but it's simpler to check PUA codepoint ranges. - return (aUSV >= 0xE000 && aUSV <= 0xF8FF) || (aUSV >= 0xF0000); -} - template void gfxFontGroup::InitScriptRun(gfxContext *aContext, @@ -2312,8 +2300,7 @@ gfxFontGroup::InitScriptRun(gfxContext *aContext, uint32_t aOffset, // position of the script run // within the textrun uint32_t aLength, // length of the script run - int32_t aRunScript, - gfxMissingFontRecorder *aMFR) + int32_t aRunScript) { NS_ASSERTION(aLength > 0, "don't call InitScriptRun for a 0-length run"); NS_ASSERTION(aTextRun->GetShapingState() != gfxTextRun::eShapingState_Aborted, @@ -2334,7 +2321,6 @@ gfxFontGroup::InitScriptRun(gfxContext *aContext, ComputeRanges(fontRanges, aString, aLength, aRunScript, aTextRun->GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK); uint32_t numRanges = fontRanges.Length(); - bool missingChars = false; for (uint32_t r = 0; r < numRanges; r++) { const gfxTextRange& range = fontRanges[r]; @@ -2481,15 +2467,11 @@ gfxFontGroup::InitScriptRun(gfxContext *aContext, index + 1 < aLength && NS_IS_LOW_SURROGATE(aString[index + 1])) { - uint32_t usv = - SURROGATE_TO_UCS4(ch, aString[index + 1]); aTextRun->SetMissingGlyph(aOffset + index, - usv, + SURROGATE_TO_UCS4(ch, + aString[index + 1]), mainFont); index++; - if (!mSkipDrawing && !IsPUA(usv)) { - missingChars = true; - } continue; } @@ -2524,18 +2506,11 @@ gfxFontGroup::InitScriptRun(gfxContext *aContext, // record char code so we can draw a box with the Unicode value aTextRun->SetMissingGlyph(aOffset + index, ch, mainFont); - if (!mSkipDrawing && !IsPUA(ch)) { - missingChars = true; - } } } runStart += matchedLength; } - - if (aMFR && missingChars) { - aMFR->RecordScript(aRunScript); - } } gfxTextRun * @@ -2561,8 +2536,7 @@ gfxFontGroup::GetEllipsisTextRun(int32_t aAppUnitsPerDevPixel, refCtx, nullptr, nullptr, nullptr, 0, aAppUnitsPerDevPixel }; gfxTextRun* textRun = - MakeTextRun(ellipsis.get(), ellipsis.Length(), ¶ms, - TEXT_IS_PERSISTENT, nullptr); + MakeTextRun(ellipsis.get(), ellipsis.Length(), ¶ms, TEXT_IS_PERSISTENT); if (!textRun) { return nullptr; } @@ -3134,41 +3108,3 @@ gfxFontGroup::Shutdown() } nsILanguageAtomService* gfxFontGroup::gLangService = nullptr; - -void -gfxMissingFontRecorder::Flush() -{ - static bool mNotifiedFontsInitialized = false; - static uint32_t mNotifiedFonts[gfxMissingFontRecorder::kNumScriptBitsWords]; - if (!mNotifiedFontsInitialized) { - memset(&mNotifiedFonts, 0, sizeof(mNotifiedFonts)); - mNotifiedFontsInitialized = true; - } - - nsAutoString fontNeeded; - for (uint32_t i = 0; i < kNumScriptBitsWords; ++i) { - mMissingFonts[i] &= ~mNotifiedFonts[i]; - if (!mMissingFonts[i]) { - continue; - } - for (uint32_t j = 0; j < 32; ++j) { - if (!(mMissingFonts[i] & (1 << j))) { - continue; - } - mNotifiedFonts[i] |= (1 << j); - if (!fontNeeded.IsEmpty()) { - fontNeeded.Append(PRUnichar(',')); - } - uint32_t tag = GetScriptTagForCode(i * 32 + j); - fontNeeded.Append(char16_t(tag >> 24)); - fontNeeded.Append(char16_t((tag >> 16) & 0xff)); - fontNeeded.Append(char16_t((tag >> 8) & 0xff)); - fontNeeded.Append(char16_t(tag & 0xff)); - } - mMissingFonts[i] = 0; - } - if (!fontNeeded.IsEmpty()) { - nsCOMPtr service = GetObserverService(); - service->NotifyObservers(nullptr, "font-needed", fontNeeded.get()); - } -} diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index 6ed9c7a4cd3..c94d966689e 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -16,7 +16,6 @@ #include "mozilla/MemoryReporting.h" #include "DrawMode.h" #include "harfbuzz/hb.h" -#include "nsUnicodeScriptCodes.h" #ifdef DEBUG #include @@ -28,7 +27,6 @@ class gfxUserFontSet; class gfxTextContextPaint; class nsIAtom; class nsILanguageAtomService; -class gfxMissingFontRecorder; /** * Callback for Draw() to use when drawing text with mode @@ -766,8 +764,7 @@ public: * This calls FetchGlyphExtents on the textrun. */ virtual gfxTextRun *MakeTextRun(const char16_t *aString, uint32_t aLength, - const Parameters *aParams, uint32_t aFlags, - gfxMissingFontRecorder *aMFR); + const Parameters *aParams, uint32_t aFlags); /** * Make a textrun for a given string. * If aText is not persistent (aFlags & TEXT_IS_PERSISTENT), the @@ -775,8 +772,7 @@ public: * This calls FetchGlyphExtents on the textrun. */ virtual gfxTextRun *MakeTextRun(const uint8_t *aString, uint32_t aLength, - const Parameters *aParams, uint32_t aFlags, - gfxMissingFontRecorder *aMFR); + const Parameters *aParams, uint32_t aFlags); /** * Textrun creation helper for clients that don't want to pass @@ -786,13 +782,12 @@ public: gfxTextRun *MakeTextRun(const T *aString, uint32_t aLength, gfxContext *aRefContext, int32_t aAppUnitsPerDevUnit, - uint32_t aFlags, - gfxMissingFontRecorder *aMFR) + uint32_t aFlags) { gfxTextRunFactory::Parameters params = { aRefContext, nullptr, nullptr, nullptr, 0, aAppUnitsPerDevUnit }; - return MakeTextRun(aString, aLength, ¶ms, aFlags, aMFR); + return MakeTextRun(aString, aLength, ¶ms, aFlags); } /** @@ -1088,8 +1083,7 @@ protected: void InitTextRun(gfxContext *aContext, gfxTextRun *aTextRun, const T *aString, - uint32_t aLength, - gfxMissingFontRecorder *aMFR); + uint32_t aLength); // InitTextRun helper to handle a single script run, by finding font ranges // and calling each font's InitTextRun() as appropriate @@ -1099,8 +1093,7 @@ protected: const T *aString, uint32_t aScriptRunStart, uint32_t aScriptRunEnd, - int32_t aRunScript, - gfxMissingFontRecorder *aMFR); + int32_t aRunScript); // Helper for font-matching: // When matching the italic case, allow use of the regular face @@ -1126,54 +1119,4 @@ protected: static nsILanguageAtomService* gLangService; }; - -// A "missing font recorder" is to be used during text-run creation to keep -// a record of any scripts encountered for which font coverage was lacking; -// when Flush() is called, it sends a notification that front-end code can use -// to download fonts on demand (or whatever else it wants to do). - -#define GFX_MISSING_FONTS_NOTIFY_PREF "gfx.missing_fonts.notify" - -class gfxMissingFontRecorder { -public: - gfxMissingFontRecorder() - { - memset(&mMissingFonts, 0, sizeof(mMissingFonts)); - } - - ~gfxMissingFontRecorder() - { -#ifdef DEBUG - for (uint32_t i = 0; i < kNumScriptBitsWords; i++) { - NS_ASSERTION(mMissingFonts[i] == 0, - "failed to flush the missing-font recorder"); - } -#endif - } - - // record this script code in our mMissingFonts bitset - void RecordScript(int32_t aScriptCode) - { - mMissingFonts[uint32_t(aScriptCode) >> 5] |= - (1 << (uint32_t(aScriptCode) & 0x1f)); - } - - // send a notification of any missing-scripts that have been - // recorded, and clear the mMissingFonts set for re-use - void Flush(); - - // forget any missing-scripts that have been recorded up to now; - // called before discarding a recorder we no longer care about - void Clear() - { - memset(&mMissingFonts, 0, sizeof(mMissingFonts)); - } - -private: - // Number of 32-bit words needed for the missing-script flags - static const uint32_t kNumScriptBitsWords = - ((MOZ_NUM_SCRIPT_CODES + 31) / 32); - uint32_t mMissingFonts[kNumScriptBitsWords]; -}; - #endif diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index df1d56d170f..c83c558cfe9 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -64,7 +64,6 @@ #include "nsContentUtils.h" #include "nsPIWindowRoot.h" #include "mozilla/Preferences.h" -#include "gfxTextRun.h" // Needed for Start/Stop of Image Animation #include "imgIContainer.h" @@ -250,10 +249,6 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType) mTextPerf = new gfxTextPerfMetrics(); } - if (Preferences::GetBool(GFX_MISSING_FONTS_NOTIFY_PREF)) { - mMissingFonts = new gfxMissingFontRecorder(); - } - PR_INIT_CLIST(&mDOMMediaQueryLists); } @@ -350,9 +345,6 @@ nsPresContext::LastRelease() if (IsRoot()) { static_cast(this)->CancelDidPaintTimer(); } - if (mMissingFonts) { - mMissingFonts->Clear(); - } } NS_IMPL_CYCLE_COLLECTION_CLASS(nsPresContext) @@ -888,20 +880,6 @@ nsPresContext::PreferenceChanged(const char* aPrefName) } return; } - if (prefName.EqualsLiteral(GFX_MISSING_FONTS_NOTIFY_PREF)) { - if (Preferences::GetBool(GFX_MISSING_FONTS_NOTIFY_PREF)) { - if (!mMissingFonts) { - mMissingFonts = new gfxMissingFontRecorder(); - // trigger reflow to detect missing fonts on the current page - mPrefChangePendingNeedsReflow = true; - } - } else { - if (mMissingFonts) { - mMissingFonts->Clear(); - } - mMissingFonts = nullptr; - } - } if (StringBeginsWith(prefName, NS_LITERAL_CSTRING("font."))) { // Changes to font family preferences don't change anything in the // computed style data, so the style system won't generate a reflow @@ -2259,14 +2237,6 @@ nsPresContext::RebuildCounterStyles() } } -void -nsPresContext::NotifyMissingFonts() -{ - if (mMissingFonts) { - mMissingFonts->Flush(); - } -} - void nsPresContext::EnsureSafeToHandOutCSSRules() { diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 5b01fabdfcf..59c6c02eadc 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -65,7 +65,6 @@ class nsAnimationManager; class nsRefreshDriver; class nsIWidget; class nsDeviceContext; -class gfxMissingFontRecorder; namespace mozilla { class EventStateManager; @@ -890,9 +889,6 @@ public: // user font set is changed and fonts become unavailable). void UserFontSetUpdated(); - gfxMissingFontRecorder *MissingFontRecorder() { return mMissingFonts; } - void NotifyMissingFonts(); - mozilla::dom::FontFaceSet* Fonts(); void FlushCounterStyles(); @@ -1270,8 +1266,6 @@ protected: // text performance metrics nsAutoPtr mTextPerf; - nsAutoPtr mMissingFonts; - nsRect mVisibleArea; nsSize mPageSize; float mPageScale; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 68ebfb50eba..ac8193b2893 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -9072,8 +9072,6 @@ PresShell::DidDoReflow(bool aInterruptible, bool aWasInterrupted) mTouchCaret->UpdatePositionIfNeeded(); } - mPresContext->NotifyMissingFonts(); - if (!aWasInterrupted) { ClearReflowOnZoomPending(); } diff --git a/layout/generic/MathMLTextRunFactory.cpp b/layout/generic/MathMLTextRunFactory.cpp index 0be1effde5a..9ab9f566538 100644 --- a/layout/generic/MathMLTextRunFactory.cpp +++ b/layout/generic/MathMLTextRunFactory.cpp @@ -13,7 +13,6 @@ #include "nsTextFrameUtils.h" #include "nsFontMetrics.h" #include "nsDeviceContext.h" -#include "nsUnicodeScriptCodes.h" using namespace mozilla; @@ -530,8 +529,7 @@ MathVariant(uint32_t aCh, uint8_t aMathVar) void MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, - gfxContext* aRefContext, - gfxMissingFontRecorder* aMFR) + gfxContext* aRefContext) { gfxFontGroup* fontGroup = aTextRun->GetFontGroup(); @@ -679,9 +677,6 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, } else { // We fallback to the original character. ch2 = ch; - if (aMFR) { - aMFR->RecordScript(MOZ_SCRIPT_MATHEMATICAL_NOTATION); - } } } } @@ -769,7 +764,7 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, } else { cachedChild = newFontGroup->MakeTextRun( convertedString.BeginReading(), convertedString.Length(), - &innerParams, flags, aMFR); + &innerParams, flags); child = cachedChild.get(); } if (!child) @@ -781,7 +776,7 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, child->SetPotentialLineBreaks(0, canBreakBeforeArray.Length(), canBreakBeforeArray.Elements(), aRefContext); if (transformedChild) { - transformedChild->FinishSettingProperties(aRefContext, aMFR); + transformedChild->FinishSettingProperties(aRefContext); } if (mergeNeeded) { diff --git a/layout/generic/MathMLTextRunFactory.h b/layout/generic/MathMLTextRunFactory.h index 5783672e07f..4de229694b1 100644 --- a/layout/generic/MathMLTextRunFactory.h +++ b/layout/generic/MathMLTextRunFactory.h @@ -22,8 +22,7 @@ public: mSSTYScriptLevel(aSSTYScriptLevel) {} virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, - gfxContext* aRefContext, - gfxMissingFontRecorder* aMFR) MOZ_OVERRIDE; + gfxContext* aRefContext) MOZ_OVERRIDE; enum { // Style effects which may override single character behaviour MATH_FONT_STYLING_NORMAL = 0x1, // fontstyle="normal" has been set. diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 855baaa559b..aac55f27672 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -561,11 +561,10 @@ template gfxTextRun * MakeTextRun(const T *aText, uint32_t aLength, gfxFontGroup *aFontGroup, const gfxFontGroup::Parameters* aParams, - uint32_t aFlags, gfxMissingFontRecorder *aMFR) + uint32_t aFlags) { nsAutoPtr textRun(aFontGroup->MakeTextRun(aText, aLength, - aParams, aFlags, - aMFR)); + aParams, aFlags)); if (!textRun) { return nullptr; } @@ -843,7 +842,6 @@ public: mCurrentFramesAllSameTextRun(nullptr), mContext(aContext), mLineContainer(aLineContainer), - mMissingFonts(aPresContext->MissingFontRecorder()), mBidiEnabled(aPresContext->BidiEnabled()), mSkipIncompleteTextRuns(false), mWhichTextRun(aWhichTextRun), @@ -973,7 +971,7 @@ public: aCapitalize, mContext); } - void Finish(gfxMissingFontRecorder* aMFR) { + void Finish() { NS_ASSERTION(!(mTextRun->GetFlags() & (gfxTextRunFactory::TEXT_UNUSED_FLAGS | nsTextFrameUtils::TEXT_UNUSED_FLAG)), @@ -981,7 +979,7 @@ public: if (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_TRANSFORMED) { nsTransformedTextRun* transformedTextRun = static_cast(mTextRun); - transformedTextRun->FinishSettingProperties(mContext, aMFR); + transformedTextRun->FinishSettingProperties(mContext); } // The way nsTransformedTextRun is implemented, its glyph runs aren't // available until after nsTransformedTextRun::FinishSettingProperties() @@ -1009,7 +1007,6 @@ private: // The common ancestor of the current frame and the previous leaf frame // on the line, or null if there was no previous leaf frame. nsIFrame* mCommonAncestorWithLastFrame; - gfxMissingFontRecorder* mMissingFonts; // mMaxTextLength is an upper bound on the size of the text in all mapped frames // The value UINT32_MAX represents overflow; text will be discarded uint32_t mMaxTextLength; @@ -1509,7 +1506,7 @@ void BuildTextRunsScanner::FlushLineBreaks(gfxTextRun* aTrailingTextRun) // TODO cause frames associated with the textrun to be reflowed, if they // aren't being reflowed already! } - mBreakSinks[i]->Finish(mMissingFonts); + mBreakSinks[i]->Finish(); } mBreakSinks.Clear(); @@ -2141,30 +2138,26 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) const char16_t* text = static_cast(textPtr); if (transformingFactory) { textRun = transformingFactory->MakeTextRun(text, transformedLength, ¶ms, - fontGroup, textFlags, styles.Elements(), - mMissingFonts); + fontGroup, textFlags, styles.Elements()); if (textRun) { // ownership of the factory has passed to the textrun transformingFactory.forget(); } } else { - textRun = MakeTextRun(text, transformedLength, fontGroup, ¶ms, - textFlags, mMissingFonts); + textRun = MakeTextRun(text, transformedLength, fontGroup, ¶ms, textFlags); } } else { const uint8_t* text = static_cast(textPtr); textFlags |= gfxFontGroup::TEXT_IS_8BIT; if (transformingFactory) { textRun = transformingFactory->MakeTextRun(text, transformedLength, ¶ms, - fontGroup, textFlags, styles.Elements(), - mMissingFonts); + fontGroup, textFlags, styles.Elements()); if (textRun) { // ownership of the factory has passed to the textrun transformingFactory.forget(); } } else { - textRun = MakeTextRun(text, transformedLength, fontGroup, ¶ms, - textFlags, mMissingFonts); + textRun = MakeTextRun(text, transformedLength, fontGroup, ¶ms, textFlags); } } if (!textRun) { diff --git a/layout/generic/nsTextRunTransformations.cpp b/layout/generic/nsTextRunTransformations.cpp index 9ae0ce1dd96..f43d100da7e 100644 --- a/layout/generic/nsTextRunTransformations.cpp +++ b/layout/generic/nsTextRunTransformations.cpp @@ -593,7 +593,7 @@ nsCaseTransformTextRunFactory::TransformString( void nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, - gfxContext* aRefContext, gfxMissingFontRecorder *aMFR) + gfxContext* aRefContext) { nsAutoString convertedString; nsAutoTArray charsToMergeArray; @@ -628,7 +628,7 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, } else { cachedChild = fontGroup->MakeTextRun( convertedString.BeginReading(), convertedString.Length(), - &innerParams, flags, aMFR); + &innerParams, flags); child = cachedChild.get(); } if (!child) @@ -640,7 +640,7 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, child->SetPotentialLineBreaks(0, canBreakBeforeArray.Length(), canBreakBeforeArray.Elements(), aRefContext); if (transformedChild) { - transformedChild->FinishSettingProperties(aRefContext, aMFR); + transformedChild->FinishSettingProperties(aRefContext); } if (mergeNeeded) { diff --git a/layout/generic/nsTextRunTransformations.h b/layout/generic/nsTextRunTransformations.h index 12f7f1f06aa..3a434238210 100644 --- a/layout/generic/nsTextRunTransformations.h +++ b/layout/generic/nsTextRunTransformations.h @@ -27,9 +27,7 @@ public: gfxFontGroup* aFontGroup, uint32_t aFlags, nsStyleContext** aStyles, bool aOwnsFactory = true); - virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, - gfxContext* aRefContext, - gfxMissingFontRecorder* aMFR) = 0; + virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, gfxContext* aRefContext) = 0; }; /** @@ -50,9 +48,7 @@ public: : mInnerTransformingTextRunFactory(aInnerTransformingTextRunFactory), mAllUppercase(aAllUppercase) {} - virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, - gfxContext* aRefContext, - gfxMissingFontRecorder* aMFR) MOZ_OVERRIDE; + virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, gfxContext* aRefContext) MOZ_OVERRIDE; // Perform a transformation on the given string, writing the result into // aConvertedString. If aAllUppercase is true, the transform is (global) @@ -109,12 +105,11 @@ public: * are done and before we request any data from the textrun. Also always * called after a Create. */ - void FinishSettingProperties(gfxContext* aRefContext, - gfxMissingFontRecorder* aMFR) + void FinishSettingProperties(gfxContext* aRefContext) { if (mNeedsRebuild) { mNeedsRebuild = false; - mFactory->RebuildTextRun(this, aRefContext, aMFR); + mFactory->RebuildTextRun(this, aRefContext); } } diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index f239ec9201a..4d444c6ea62 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -37,7 +37,6 @@ #include #include "gfxMathTable.h" -#include "nsUnicodeScriptCodes.h" using namespace mozilla; using namespace mozilla::gfx; @@ -390,7 +389,7 @@ nsPropertiesTable::MakeTextRun(gfxContext* aThebesContext, "nsPropertiesTable can only access glyphs by code point"); return aFontGroup-> MakeTextRun(aGlyph.code, aGlyph.Length(), aThebesContext, - aAppUnitsPerDevPixel, 0, nullptr); + aAppUnitsPerDevPixel, 0); } // An instance of nsOpenTypeTable is associated with one gfxFontEntry that @@ -471,7 +470,7 @@ nsOpenTypeTable::UpdateCache(gfxContext* aThebesContext, if (mCharCache != aChar) { nsAutoPtr textRun; textRun = aFontGroup-> - MakeTextRun(&aChar, 1, aThebesContext, aAppUnitsPerDevPixel, 0, nullptr); + MakeTextRun(&aChar, 1, aThebesContext, aAppUnitsPerDevPixel, 0); const gfxTextRun::CompressedGlyph& data = textRun->GetCharacterGlyphs()[0]; if (data.IsSimpleGlyph()) { mGlyphID = data.GetSimpleGlyph(); @@ -1550,8 +1549,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext, nsAutoPtr textRun; textRun = fm->GetThebesFontGroup()-> MakeTextRun(static_cast(mData.get()), len, aThebesContext, - aPresContext->AppUnitsPerDevPixel(), 0, - aPresContext->MissingFontRecorder()); + aPresContext->AppUnitsPerDevPixel(), 0); aDesiredStretchSize = MeasureTextRun(aThebesContext, textRun); mGlyphs[0] = textRun; @@ -1691,14 +1689,6 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext, return NS_OK; } - // We did not find a size variant or a glyph assembly to stretch this - // operator. Verify whether a font with an OpenType MATH table is available - // and record missing math script otherwise. - gfxMissingFontRecorder* MFR = aPresContext->MissingFontRecorder(); - if (MFR && !fm->GetThebesFontGroup()->GetFirstMathFont()) { - MFR->RecordScript(MOZ_SCRIPT_MATHEMATICAL_NOTATION); - } - // stretchy character if (stretchy) { if (isVertical) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index eb8856b6787..767f1b9bf72 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -572,10 +572,6 @@ pref("gfx.bundled_fonts.enabled", true); pref("gfx.bundled_fonts.force-enabled", false); #endif -// Do we fire a notification about missing fonts, so the front-end can decide -// whether to try and do something about it (e.g. download additional fonts)? -pref("gfx.missing_fonts.notify", false); - pref("gfx.filter.nearest.force-enabled", false); // prefs controlling the font (name/cmap) loader that runs shortly after startup