Backed out changeset 52eb1fa54b88 (bug 1676966) for causing mochitest failures in AsyncCompositionManager.cpp

This commit is contained in:
Mihai Alexandru Michis 2020-12-30 00:16:44 +02:00
Родитель 3679707b84
Коммит d50d8d795e
29 изменённых файлов: 61 добавлений и 327 удалений

Просмотреть файл

@ -61,7 +61,6 @@ support-files =
# remove this after bug 1628486 is landed
prefs =
network.cookie.cookieBehavior=5
gfx.font_rendering.fallback.async=false
#NB: the following are disabled
# browser_464620_a.html

Просмотреть файл

@ -53,8 +53,6 @@ support-files =
start_historyframe.html
url1_historyframe.html
url2_historyframe.html
prefs =
gfx.font_rendering.fallback.async=false
[test_anchor_scroll_after_document_open.html]
[test_bfcache_plus_hash.html]

Просмотреть файл

@ -2408,13 +2408,12 @@ mozilla::ipc::IPCResult ContentChild::RecvUpdateDictionaryList(
mozilla::ipc::IPCResult ContentChild::RecvUpdateFontList(
nsTArray<SystemFontListEntry>&& aFontList) {
mFontList = std::move(aFontList);
gfxPlatform::GetPlatform()->UpdateFontList(true);
gfxPlatform::GetPlatform()->UpdateFontList();
return IPC_OK();
}
mozilla::ipc::IPCResult ContentChild::RecvRebuildFontList(
const bool& aFullRebuild) {
gfxPlatform::GetPlatform()->UpdateFontList(aFullRebuild);
mozilla::ipc::IPCResult ContentChild::RecvRebuildFontList() {
gfxPlatform::GetPlatform()->UpdateFontList();
return IPC_OK();
}

Просмотреть файл

@ -366,7 +366,7 @@ class ContentChild final : public PContentChild,
mozilla::ipc::IPCResult RecvUpdateFontList(
nsTArray<SystemFontListEntry>&& aFontList);
mozilla::ipc::IPCResult RecvRebuildFontList(const bool& aFullRebuild);
mozilla::ipc::IPCResult RecvRebuildFontList();
mozilla::ipc::IPCResult RecvUpdateAppLocales(
nsTArray<nsCString>&& aAppLocales);

Просмотреть файл

@ -4851,14 +4851,7 @@ void ContentParent::NotifyUpdatedDictionaries() {
}
}
void ContentParent::NotifyUpdatedFonts(bool aFullRebuild) {
if (gfxPlatformFontList::PlatformFontList()->SharedFontList()) {
for (auto* cp : AllProcesses(eLive)) {
Unused << cp->SendRebuildFontList(aFullRebuild);
}
return;
}
void ContentParent::NotifyUpdatedFonts() {
nsTArray<SystemFontListEntry> fontList;
gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
@ -4867,6 +4860,12 @@ void ContentParent::NotifyUpdatedFonts(bool aFullRebuild) {
}
}
void ContentParent::NotifyRebuildFontList() {
for (auto* cp : AllProcesses(eLive)) {
Unused << cp->SendRebuildFontList();
}
}
already_AddRefed<mozilla::docshell::POfflineCacheUpdateParent>
ContentParent::AllocPOfflineCacheUpdateParent(
nsIURI* aManifestURI, nsIURI* aDocumentURI,
@ -5441,7 +5440,7 @@ mozilla::ipc::IPCResult ContentParent::RecvGetOutputColorProfileData(
mozilla::ipc::IPCResult ContentParent::RecvGetFontListShmBlock(
const uint32_t& aGeneration, const uint32_t& aIndex,
base::SharedMemoryHandle* aOut) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
auto fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
fontList->ShareFontListShmBlockToProcess(aGeneration, aIndex, Pid(), aOut);
return IPC_OK();
@ -5450,7 +5449,7 @@ mozilla::ipc::IPCResult ContentParent::RecvGetFontListShmBlock(
mozilla::ipc::IPCResult ContentParent::RecvInitializeFamily(
const uint32_t& aGeneration, const uint32_t& aFamilyIndex,
const bool& aLoadCmaps) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
auto fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
fontList->InitializeFamily(aGeneration, aFamilyIndex, aLoadCmaps);
return IPC_OK();
@ -5459,7 +5458,7 @@ mozilla::ipc::IPCResult ContentParent::RecvInitializeFamily(
mozilla::ipc::IPCResult ContentParent::RecvSetCharacterMap(
const uint32_t& aGeneration, const mozilla::fontlist::Pointer& aFacePtr,
const gfxSparseBitSet& aMap) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
auto fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
fontList->SetCharacterMap(aGeneration, aFacePtr, aMap);
return IPC_OK();
@ -5467,7 +5466,7 @@ mozilla::ipc::IPCResult ContentParent::RecvSetCharacterMap(
mozilla::ipc::IPCResult ContentParent::RecvInitOtherFamilyNames(
const uint32_t& aGeneration, const bool& aDefer, bool* aLoaded) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
auto fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
*aLoaded = fontList->InitOtherFamilyNames(aGeneration, aDefer);
return IPC_OK();
@ -5475,20 +5474,12 @@ mozilla::ipc::IPCResult ContentParent::RecvInitOtherFamilyNames(
mozilla::ipc::IPCResult ContentParent::RecvSetupFamilyCharMap(
const uint32_t& aGeneration, const mozilla::fontlist::Pointer& aFamilyPtr) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
auto fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
fontList->SetupFamilyCharMap(aGeneration, aFamilyPtr);
return IPC_OK();
}
mozilla::ipc::IPCResult ContentParent::RecvStartCmapLoading(
const uint32_t& aGeneration, const uint32_t& aStartIndex) {
auto* fontList = gfxPlatformFontList::PlatformFontList();
MOZ_RELEASE_ASSERT(fontList, "gfxPlatformFontList not initialized?");
fontList->StartCmapLoading(aGeneration, aStartIndex);
return IPC_OK();
}
mozilla::ipc::IPCResult ContentParent::RecvGetHyphDict(
nsIURI* aURI, base::SharedMemoryHandle* aOutHandle, uint32_t* aOutSize) {
if (!aURI) {

Просмотреть файл

@ -312,11 +312,8 @@ class ContentParent final
static void NotifyUpdatedDictionaries();
// Tell content processes the font list has changed. If aFullRebuild is true,
// the shared list has been rebuilt and must be freshly mapped by child
// processes; if false, existing mappings are still valid but the data has
// been updated and so full reflows are in order.
static void NotifyUpdatedFonts(bool aFullRebuild);
static void NotifyUpdatedFonts();
static void NotifyRebuildFontList();
#if defined(XP_WIN)
/**
@ -1205,9 +1202,6 @@ class ContentParent final
const uint32_t& aGeneration,
const mozilla::fontlist::Pointer& aFamilyPtr);
mozilla::ipc::IPCResult RecvStartCmapLoading(const uint32_t& aGeneration,
const uint32_t& aStartIndex);
mozilla::ipc::IPCResult RecvGetHyphDict(nsIURI* aURIParams,
base::SharedMemoryHandle* aOutHandle,
uint32_t* aOutSize);

Просмотреть файл

@ -605,12 +605,10 @@ child:
async UpdateFontList(SystemFontListEntry[] fontList);
/**
* The shared font list has been updated by the parent, so child processes
* should globally reflow everything to pick up new character coverage etc.
* If aFullRebuild is true, child processes must discard and recreate
* their mappings to the shmem blocks, as those are no longer valid.
* The shared font list has been reinitialized by the parent;
* child processes must discard and recreate their mappings to it.
*/
async RebuildFontList(bool aFulLRebuild);
async RebuildFontList();
/**
* The shared font list has been modified, potentially adding matches
@ -1434,23 +1432,6 @@ parent:
*/
sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
/**
* Ask the parent to load all font character maps, as we need to do an
* exhaustive font-fallback search. This is done asynchronously; when it
* finishes, the parent will trigger global reflow so that font selection
* is re-done in all content, making use of the newly-loaded cmaps.
* Normally this will only happen once per browser session (unless the
* font list is rebuilt due to installation/removal of system fonts).
*
* @param aGeneration
* Font-list generation, so requests relating to an obsolete list can be
* ignored (see comments for GetFontListShmBlock).
* @param aStartIndex
* The family index to start from; the sender has determined that cmaps
* up to this point are already loaded.
*/
async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
/**
* Ask the parent for a specific hyphenation resource (identified by URI)
* as a shared memory block.

Просмотреть файл

@ -290,13 +290,6 @@ struct Family {
// It is possible that character maps have not yet been loaded.
bool IsInitialized() const { return !mFaces.IsNull(); }
// IsFullyInitialized indicates that not only faces but also character maps
// have been set up, so the family can be searched without the possibility
// that IPC messaging will be triggered.
bool IsFullyInitialized() const {
return IsInitialized() && !mCharacterMap.IsNull();
}
void FindAllFacesForStyle(FontList* aList, const gfxFontStyle& aStyle,
nsTArray<Face*>& aFaceList,
bool aIgnoreSizeTolerance = false) const;

Просмотреть файл

@ -2298,7 +2298,7 @@ void gfxFcPlatformFontList::CheckFontUpdates(nsITimer* aTimer, void* aThis) {
pfl->UpdateFontList();
pfl->ForceGlobalReflow();
mozilla::dom::ContentParent::NotifyUpdatedFonts(true);
mozilla::dom::ContentParent::NotifyUpdatedFonts();
}
}

Просмотреть файл

@ -337,8 +337,6 @@ class gfxFontCache final : private gfxFontCacheExpirationTracker {
AgeAllGenerations();
}
uint32_t Count() const { return mFonts.Count(); }
void FlushShapedWordCaches();
void NotifyGlyphsChanged();

Просмотреть файл

@ -1286,7 +1286,7 @@ void gfxMacPlatformFontList::RegisteredFontsChangedNotificationCallback(
// modify a preference that will trigger reflow everywhere
fl->ForceGlobalReflow();
dom::ContentParent::NotifyUpdatedFonts(true);
mozilla::dom::ContentParent::NotifyUpdatedFonts();
}
gfxFontEntry* gfxMacPlatformFontList::PlatformGlobalFontFallback(const uint32_t aCh,

Просмотреть файл

@ -1791,8 +1791,8 @@ nsresult gfxPlatform::GetFontList(nsAtom* aLangGroup,
return NS_OK;
}
nsresult gfxPlatform::UpdateFontList(bool aFullRebuild) {
gfxPlatformFontList::PlatformFontList()->UpdateFontList(aFullRebuild);
nsresult gfxPlatform::UpdateFontList() {
gfxPlatformFontList::PlatformFontList()->UpdateFontList();
return NS_OK;
}

Просмотреть файл

@ -356,11 +356,9 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
nsTArray<mozilla::dom::SystemFontListEntry>* aFontList) {}
/**
* Rebuilds the system font lists (if aFullRebuild is true), or just notifies
* content that the list has changed but existing memory mappings are still
* valid (aFullRebuild is false).
* Rebuilds the any cached system font lists
*/
nsresult UpdateFontList(bool aFullRebuild = true);
virtual nsresult UpdateFontList();
/**
* Create the platform font-list object (gfxPlatformFontList concrete

Просмотреть файл

@ -302,9 +302,8 @@ gfxPlatformFontList::~gfxPlatformFontList() {
void gfxPlatformFontList::FontWhitelistPrefChanged(const char* aPref,
void* aClosure) {
MOZ_ASSERT(XRE_IsParentProcess());
auto* pfl = gfxPlatformFontList::PlatformFontList();
pfl->UpdateFontList(true);
dom::ContentParent::NotifyUpdatedFonts(true);
gfxPlatformFontList::PlatformFontList()->UpdateFontList();
mozilla::dom::ContentParent::NotifyUpdatedFonts();
}
// number of CSS generic font families
@ -443,8 +442,8 @@ nsresult gfxPlatformFontList::InitFontList() {
// rebuilding fontlist so clear out font/word caches
gfxFontCache* fontCache = gfxFontCache::GetCache();
if (fontCache) {
fontCache->AgeAllGenerations();
fontCache->FlushShapedWordCaches();
fontCache->Flush();
}
gfxPlatform::PurgeSkiaFontCache();
@ -459,9 +458,6 @@ nsresult gfxPlatformFontList::InitFontList() {
mAliasTable.Clear();
mLocalNameTable.Clear();
CancelLoadCmapsTask();
mStartedLoadingCmapsFrom = 0xffffffffu;
CancelInitOtherFamilyNamesTask();
MutexAutoLock lock(mFontFamiliesMutex);
mFontFamilies.Clear();
@ -513,7 +509,7 @@ nsresult gfxPlatformFontList::InitFontList() {
if (oldSharedList) {
if (XRE_IsParentProcess()) {
// notify all children of the change
dom::ContentParent::NotifyUpdatedFonts(true);
mozilla::dom::ContentParent::NotifyRebuildFontList();
}
}
}
@ -544,18 +540,6 @@ nsresult gfxPlatformFontList::InitFontList() {
return NS_OK;
}
void gfxPlatformFontList::InitializeCodepointsWithNoFonts() {
mCodepointsWithNoFonts.reset();
mCodepointsWithNoFonts.SetRange(0, 0x1f); // C0 controls
mCodepointsWithNoFonts.SetRange(0x7f, 0x9f); // C1 controls
mCodepointsWithNoFonts.SetRange(0xE000, 0xF8FF); // PUA
mCodepointsWithNoFonts.SetRange(0xF0000, 0x10FFFD); // Supplementary PUA
mCodepointsWithNoFonts.SetRange(0xfdd0, 0xfdef); // noncharacters
for (unsigned i = 0; i <= 0x100000; i += 0x10000) {
mCodepointsWithNoFonts.SetRange(i + 0xfffe, i + 0xffff); // noncharacters
}
}
void gfxPlatformFontList::SetVisibilityLevel() {
FontVisibility newLevel;
if (StaticPrefs::privacy_resistFingerprinting()) {
@ -570,7 +554,15 @@ void gfxPlatformFontList::SetVisibilityLevel() {
mVisibilityLevel = newLevel;
// (Re-)initialize ranges of characters for which system-wide font search
// should be skipped
InitializeCodepointsWithNoFonts();
mCodepointsWithNoFonts.reset();
mCodepointsWithNoFonts.SetRange(0, 0x1f); // C0 controls
mCodepointsWithNoFonts.SetRange(0x7f, 0x9f); // C1 controls
mCodepointsWithNoFonts.SetRange(0xE000, 0xF8FF); // PUA
mCodepointsWithNoFonts.SetRange(0xF0000, 0x10FFFD); // Supplementary PUA
mCodepointsWithNoFonts.SetRange(0xfdd0, 0xfdef); // noncharacters
for (unsigned i = 0; i <= 0x100000; i += 0x10000) {
mCodepointsWithNoFonts.SetRange(i + 0xfffe, i + 0xffff); // noncharacters
}
// Forget any font family we previously chose for U+FFFD.
mReplacementCharFallbackFamily = FontFamily();
}
@ -578,7 +570,6 @@ void gfxPlatformFontList::SetVisibilityLevel() {
void gfxPlatformFontList::FontListChanged() {
MOZ_ASSERT(!XRE_IsParentProcess());
InitializeCodepointsWithNoFonts();
if (SharedFontList()) {
// If we're using a shared local face-name list, this may have changed
// such that existing font entries held by user font sets are no longer
@ -808,16 +799,10 @@ void gfxPlatformFontList::LoadBadUnderlineList() {
mBadUnderlineFamilyNames.Sort();
}
void gfxPlatformFontList::UpdateFontList(bool aFullRebuild) {
void gfxPlatformFontList::UpdateFontList() {
MOZ_ASSERT(NS_IsMainThread());
if (aFullRebuild) {
InitFontList();
RebuildLocalFonts();
} else {
InitializeCodepointsWithNoFonts();
mStartedLoadingCmapsFrom = 0xffffffffu;
gfxPlatform::ForceGlobalReflow();
}
InitFontList();
RebuildLocalFonts();
}
bool gfxPlatformFontList::IsVisibleToCSS(const gfxFontFamily& aFamily) const {
@ -1012,8 +997,6 @@ gfxFont* gfxPlatformFontList::CommonFontFallback(
if (!family || !IsVisibleToCSS(*family)) {
continue;
}
// XXX(jfkthame) Should we fire the async cmap-loader here, or let it
// always do a potential sync initialization of the family?
family->SearchAllFontsForChar(SharedFontList(), &data);
if (data.mBestMatch) {
aMatchedFamily = FontFamily(family);
@ -1092,17 +1075,10 @@ gfxFont* gfxPlatformFontList::GlobalFontFallback(
if (!IsVisibleToCSS(family)) {
continue;
}
if (!family.IsFullyInitialized() &&
StaticPrefs::gfx_font_rendering_fallback_async()) {
// Start loading all the missing charmaps; but this is async,
// so for now we just continue, ignoring this family.
StartCmapLoadingFromFamily(i);
} else {
family.SearchAllFontsForChar(SharedFontList(), &data);
if (data.mMatchDistance == 0.0) {
// no better style match is possible, so stop searching
break;
}
family.SearchAllFontsForChar(SharedFontList(), &data);
if (data.mMatchDistance == 0.0) {
// no better style match is possible, so stop searching
break;
}
}
if (data.mBestMatch) {
@ -1144,150 +1120,6 @@ gfxFont* gfxPlatformFontList::GlobalFontFallback(
return nullptr;
}
class StartCmapLoadingRunnable : public mozilla::Runnable {
public:
explicit StartCmapLoadingRunnable(uint32_t aStartIndex)
: Runnable("gfxPlatformFontList::StartCmapLoadingRunnable"),
mStartIndex(aStartIndex) {}
NS_IMETHOD Run() override {
auto* pfl = gfxPlatformFontList::PlatformFontList();
auto* list = pfl->SharedFontList();
if (!list) {
return NS_OK;
}
if (mStartIndex >= list->NumFamilies()) {
return NS_OK;
}
if (XRE_IsParentProcess()) {
pfl->StartCmapLoading(list->GetGeneration(), mStartIndex);
} else {
dom::ContentChild::GetSingleton()->SendStartCmapLoading(
list->GetGeneration(), mStartIndex);
}
return NS_OK;
}
private:
uint32_t mStartIndex;
};
void gfxPlatformFontList::StartCmapLoadingFromFamily(uint32_t aStartIndex) {
if (aStartIndex > mStartedLoadingCmapsFrom) {
// We already initiated cmap-loading from somewhere earlier in the list;
// no need to do it again here.
return;
}
mStartedLoadingCmapsFrom = aStartIndex;
// If we're already on the main thread, don't bother dispatching a runnable
// here to kick off the loading process, just do it directly.
if (NS_IsMainThread()) {
auto* list = SharedFontList();
if (XRE_IsParentProcess()) {
StartCmapLoading(list->GetGeneration(), aStartIndex);
} else {
dom::ContentChild::GetSingleton()->SendStartCmapLoading(
list->GetGeneration(), aStartIndex);
}
} else {
NS_DispatchToMainThread(new StartCmapLoadingRunnable(aStartIndex));
}
}
class LoadCmapsRunnable : public CancelableRunnable {
public:
explicit LoadCmapsRunnable(uint32_t aGeneration, uint32_t aFamilyIndex)
: CancelableRunnable("gfxPlatformFontList::LoadCmapsRunnable"),
mGeneration(aGeneration),
mStartIndex(aFamilyIndex),
mIndex(aFamilyIndex) {}
// Reset the current family index, if the value passed is earlier than our
// original starting position. We don't "reset" if it would move the current
// position forward, or back into the already-scanned range.
// We could optimize further by remembering the current position reached,
// and then skipping ahead from the original start, but it doesn't seem worth
// extra complexity for a task that usually only happens once, and already-
// processed families will be skipped pretty quickly in Run() anyhow.
void MaybeResetIndex(uint32_t aFamilyIndex) {
if (aFamilyIndex < mStartIndex) {
mStartIndex = aFamilyIndex;
mIndex = aFamilyIndex;
}
}
nsresult Cancel() override {
mIsCanceled = true;
return NS_OK;
}
NS_IMETHOD Run() override {
if (mIsCanceled) {
return NS_OK;
}
auto* pfl = gfxPlatformFontList::PlatformFontList();
auto* list = pfl->SharedFontList();
MOZ_ASSERT(list);
if (!list) {
return NS_OK;
}
if (mGeneration != list->GetGeneration()) {
return NS_OK;
}
uint32_t numFamilies = list->NumFamilies();
if (mIndex >= numFamilies) {
return NS_OK;
}
auto* families = list->Families();
// Skip any families that are already initialized.
while (mIndex < numFamilies && families[mIndex].IsFullyInitialized()) {
++mIndex;
}
// Fully process one family, and advance index.
if (mIndex < numFamilies) {
Unused << pfl->InitializeFamily(&families[mIndex], true);
++mIndex;
}
// If there are more families to initialize, post ourselves back to the
// idle queue to handle the next one; otherwise we're finished and we need
// to notify content processes to update their rendering.
if (mIndex < numFamilies) {
RefPtr<CancelableRunnable> task = this;
NS_DispatchToMainThreadQueue(task.forget(), EventQueuePriority::Idle);
} else {
pfl->CancelLoadCmapsTask();
pfl->InitializeCodepointsWithNoFonts();
dom::ContentParent::NotifyUpdatedFonts(false);
}
return NS_OK;
}
private:
uint32_t mGeneration;
uint32_t mStartIndex;
uint32_t mIndex;
bool mIsCanceled = false;
};
void gfxPlatformFontList::StartCmapLoading(uint32_t aGeneration,
uint32_t aStartIndex) {
MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
if (aGeneration != SharedFontList()->GetGeneration()) {
return;
}
if (mLoadCmapsRunnable) {
// We already have a runnable; just make sure it covers the full range of
// families needed.
static_cast<LoadCmapsRunnable*>(mLoadCmapsRunnable.get())
->MaybeResetIndex(aStartIndex);
return;
}
mLoadCmapsRunnable = new LoadCmapsRunnable(aGeneration, aStartIndex);
RefPtr<CancelableRunnable> task = mLoadCmapsRunnable;
NS_DispatchToMainThreadQueue(task.forget(), EventQueuePriority::Idle);
}
gfxFontFamily* gfxPlatformFontList::CheckFamily(gfxFontFamily* aFamily) {
if (aFamily && !aFamily->HasStyles()) {
aFamily->FindStyleVariations();

Просмотреть файл

@ -203,9 +203,7 @@ class gfxPlatformFontList : public gfxFontInfoLoader {
virtual void GetFontList(nsAtom* aLangGroup, const nsACString& aGenericFamily,
nsTArray<nsString>& aListOfFonts);
// Pass false to notify content that the shared font list has been modified
// but not completely invalidated.
void UpdateFontList(bool aFullRebuild = true);
void UpdateFontList();
virtual void ClearLangGroupPrefFonts();
@ -283,20 +281,6 @@ class gfxPlatformFontList : public gfxFontInfoLoader {
void SetupFamilyCharMap(uint32_t aGeneration,
const mozilla::fontlist::Pointer& aFamilyPtr);
// Start the async cmap loading process, if not already under way, from the
// given family index. (For use in any process that needs font lookups.)
void StartCmapLoadingFromFamily(uint32_t aStartIndex);
// [Parent] Handle request from content process to start cmap loading.
void StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
void CancelLoadCmapsTask() {
if (mLoadCmapsRunnable) {
mLoadCmapsRunnable->Cancel();
mLoadCmapsRunnable = nullptr;
}
}
// Populate aFamily with face records, and if aLoadCmaps is true, also load
// their character maps (rather than leaving this to be done lazily).
// Note that even when aFamily->IsInitialized() is true, it can make sense
@ -496,9 +480,6 @@ class gfxPlatformFontList : public gfxFontInfoLoader {
// Initialize the current visibility level from user prefs.
void SetVisibilityLevel();
// (Re-)initialize the set of codepoints that we know cannot be rendered.
void InitializeCodepointsWithNoFonts();
// If using the shared font list, returns a generation count that is
// incremented if/when the platform list is reinitialized (e.g. because
// fonts are installed/removed while the browser is running), such that
@ -882,9 +863,6 @@ class gfxPlatformFontList : public gfxFontInfoLoader {
RefPtr<gfxFontEntry> mDefaultFontEntry;
RefPtr<mozilla::CancelableRunnable> mLoadCmapsRunnable;
uint32_t mStartedLoadingCmapsFrom = 0xffffffffu;
FontVisibility mVisibilityLevel = FontVisibility::Unknown;
bool mFontFamilyWhitelistActive;

Просмотреть файл

@ -201,6 +201,11 @@ nsresult gfxPlatformGtk::GetFontList(nsAtom* aLangGroup,
return NS_OK;
}
nsresult gfxPlatformGtk::UpdateFontList() {
gfxPlatformFontList::PlatformFontList()->UpdateFontList();
return NS_OK;
}
// xxx - this is ubuntu centric, need to go through other distros and flesh
// out a more general list
static const char kFontDejaVuSans[] = "DejaVu Sans";

Просмотреть файл

@ -40,6 +40,8 @@ class gfxPlatformGtk final : public gfxPlatform {
nsresult GetFontList(nsAtom* aLangGroup, const nsACString& aGenericFamily,
nsTArray<nsString>& aListOfFonts) override;
nsresult UpdateFontList() override;
void GetCommonFallbackFonts(uint32_t aCh, Script aRunScript,
eFontPresentation aPresentation,
nsTArray<const char*>& aFontList) override;

Просмотреть файл

@ -2926,17 +2926,8 @@ gfxFont* gfxFontGroup::FindFallbackFaceForChar(
gfxFont* gfxFontGroup::FindFallbackFaceForChar(
fontlist::Family* aFamily, uint32_t aCh, uint32_t aNextCh,
eFontPresentation aPresentation) {
auto* pfl = gfxPlatformFontList::PlatformFontList();
auto* list = pfl->SharedFontList();
// If async fallback is enabled, and the family isn't fully initialized yet,
// just start the async cmap loading and return.
if (!aFamily->IsFullyInitialized() &&
StaticPrefs::gfx_font_rendering_fallback_async()) {
pfl->StartCmapLoadingFromFamily(aFamily - list->Families());
return nullptr;
}
fontlist::FontList* list =
gfxPlatformFontList::PlatformFontList()->SharedFontList();
GlobalFontMatch data(aCh, aNextCh, mStyle, aPresentation);
aFamily->SearchAllFontsForChar(list, &data);
gfxFontEntry* fe = data.mBestMatch;

Просмотреть файл

@ -3,8 +3,6 @@ support-files =
bug287446_subframe.html
bug477700_subframe.html
bug564115_window.html
prefs =
gfx.font_rendering.fallback.async=false
[test_bug231389.html]
[test_bug287446.html]

Просмотреть файл

@ -1,7 +1,3 @@
# Font-matching reftests may fail intermittently/transiently due to asynch fallback,
# so we disable the async mechanism for this directory.
defaults pref(gfx.font_rendering.fallback.async,false)
== CSS21-t1502-no-inherited-font-family.xhtml CSS21-t1502-no-inherited-font-family-ref.xhtml
# tests for bug 1394311 (case-insensitive lang tag processing)

Просмотреть файл

@ -5,8 +5,8 @@
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == currency-1.html currency-1-ref.html # Bug 1392106
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == currency-2.html currency-2-ref.html # Bug 1392106
== datetime-1.html datetime-1-ref.html
pref(gfx.font_rendering.fallback.async,false) == emoji-1.html emoji-1-ref.html
pref(gfx.font_rendering.fallback.async,false) == emoji-2.html emoji-2-ref.html
== emoji-1.html emoji-1-ref.html
== emoji-2.html emoji-2-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == hyphens-1.html hyphens-1-ref.html # Bug 1392106
== hyphens-2.html hyphens-2-ref.html
# The following three tests may fail if rendering with Core Text (see bug 389074)

Просмотреть файл

@ -2,9 +2,9 @@
# and layout/reftests/w3c-css/submitted/multicol3/
# Pagination tests
# asserts(3) == abspos-breaking-000.xhtml abspos-breaking-000.ref.xhtml # bug 1067755, 1135556
asserts(3-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-001.xhtml abspos-breaking-000.ref.xhtml # Bug 1655630, Bug 1392106
asserts(3) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-001.xhtml abspos-breaking-000.ref.xhtml # Bug 1655630, Bug 1392106
asserts(3) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-002.xhtml abspos-breaking-000.ref.xhtml # Bug 1655630, Bug 1392106
asserts(2-3) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-003.html abspos-breaking-003-ref.html # Bug 1655630, Bug 1392106
asserts(2) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-003.html abspos-breaking-003-ref.html # Bug 1655630, Bug 1392106
asserts(4) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-004.html abspos-breaking-004-ref.html # Bug 1655630, Bug 1392106
asserts(4) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-005.html abspos-breaking-005-ref.html # Bug 1655630, Bug 1392106
asserts(4) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == abspos-breaking-006.html abspos-breaking-006-ref.html # Bug 1655630, Bug 1392106

Просмотреть файл

@ -1,7 +1,3 @@
# Font-dependent reftests may fail intermittently/transiently due to asynch fallback,
# so we disable the async mechanism for this directory.
defaults pref(gfx.font_rendering.fallback.async,false)
fails-if(Android) == fallback-01.xhtml fallback-01-ref.xhtml
== font-selection-by-lang-01.html font-selection-by-lang-01-ref.html
== font-selection-fallback-1.html font-selection-fallback-1-ref.html
@ -375,6 +371,3 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == segment-break-transforma
# sub and sup elements should be influenced by their container's line-height - bug 1524897
== sub-sup-and-line-height.html sub-sup-and-line-height-ref.html
# Reset default prefs.
defaults

Просмотреть файл

@ -4334,11 +4334,6 @@
mirror: always
rust: true
- name: gfx.font_rendering.fallback.async
type: RelaxedAtomicBool
value: true
mirror: always
# Whether to enable LayerScope tool and default listening port.
- name: gfx.layerscope.enabled
type: RelaxedAtomicBool

Просмотреть файл

@ -1,2 +0,0 @@
[bidi-flag-emoji.html]
prefs: [gfx.font_rendering.fallback.async:false]

Просмотреть файл

@ -1 +0,0 @@
prefs: [gfx.font_rendering.fallback.async:false]

Просмотреть файл

@ -1 +0,0 @@
prefs: [gfx.font_rendering.fallback.async:false]

Просмотреть файл

@ -1,2 +0,0 @@
[disclosure-styles.html]
prefs: [gfx.font_rendering.fallback.async:false]

Просмотреть файл

@ -1,4 +1,3 @@
[symbols-function.html]
prefs: [gfx.font_rendering.fallback.async:false]
expected:
if (processor == "x86") and not debug: ["PASS", "TIMEOUT"]