WebKit Bugzilla
Attachment 361122 Details for
Bug 194251
: Some fonts never load, causing fallback text to be rendered instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
bug-194251-20190204162232.patch (text/plain), 23.97 KB, created by
Myles C. Maxfield
on 2019-02-04 16:22:33 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-02-04 16:22:33 PST
Size:
23.97 KB
patch
obsolete
>Subversion Revision: 240880 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7b8dc4ce5086afbfd26acaaceff92a35d3e0fb66..ada76eda29c1836584b781e245025052c8e709bd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,48 @@ >+2019-02-04 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ Add lots of fonts logging >+ https://bugs.webkit.org/show_bug.cgi?id=194251 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * css/CSSFontFace.cpp: >+ (WebCore::CSSFontFace::appendSources): >+ (WebCore::CSSFontFace::fontLoadEventOccurred): >+ (WebCore::CSSFontFace::timeoutFired): >+ (WebCore::CSSFontFace::fontLoaded): >+ (WebCore::CSSFontFace::pump): >+ (WebCore::CSSFontFace::font): >+ * css/CSSFontFaceSet.cpp: >+ (WebCore::CSSFontFaceSet::fontFace): >+ * css/CSSFontFaceSource.cpp: >+ (WebCore::CSSFontFaceSource::CSSFontFaceSource): >+ (WebCore::CSSFontFaceSource::fontLoaded): >+ (WebCore::CSSFontFaceSource::load): >+ * css/CSSFontFaceSrcValue.cpp: >+ (WebCore::CSSFontFaceSrcValue::cachedFont): >+ * css/CSSFontSelector.cpp: >+ (WebCore::CSSFontSelector::CSSFontSelector): >+ (WebCore::CSSFontSelector::buildStarted): >+ (WebCore::CSSFontSelector::buildCompleted): >+ (WebCore::CSSFontSelector::addFontFaceRule): >+ (WebCore::CSSFontSelector::dispatchInvalidationCallbacks): >+ (WebCore::CSSFontSelector::fontLoaded): >+ (WebCore::CSSFontSelector::fontModified): >+ (WebCore::CSSFontSelector::fontCacheInvalidated): >+ (WebCore::CSSFontSelector::fontRangesForFamily): >+ (WebCore::CSSFontSelector::clearDocument): >+ (WebCore::CSSFontSelector::beginLoadingFontSoon): >+ (WebCore::CSSFontSelector::beginLoadTimerFired): >+ * css/CSSSegmentedFontFace.cpp: >+ (WebCore::CSSSegmentedFontFace::fontRanges): >+ * platform/graphics/FontCache.cpp: >+ (WebCore::FontCache::getCachedFontPlatformData): >+ (WebCore::FontCache::fontForFamily): >+ * platform/graphics/cocoa/FontCacheCoreText.cpp: >+ (WebCore::FontCache::createFontPlatformData): >+ > 2019-02-01 Chris Dumez <cdumez@apple.com> > > REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html >diff --git a/Source/WebCore/css/CSSFontFace.cpp b/Source/WebCore/css/CSSFontFace.cpp >index 0eca51b3db6ef3af1177b34d5f97fbd26054ee39..86fa0cb3f8ddcd461a311a356707b0931a5fd2c3 100644 >--- a/Source/WebCore/css/CSSFontFace.cpp >+++ b/Source/WebCore/css/CSSFontFace.cpp >@@ -41,6 +41,7 @@ > #include "FontDescription.h" > #include "FontFace.h" > #include "FontVariantBuilder.h" >+#include "Logging.h" > #include "Settings.h" > #include "StyleBuilderConverter.h" > #include "StyleProperties.h" >@@ -73,14 +74,18 @@ void CSSFontFace::appendSources(CSSFontFace& fontFace, CSSValueList& srcList, Do > fontFaceElement = item.svgFontFaceElement(); > #endif > if (!item.isLocal()) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::appendSources() " << &fontFace << " remote source"); > const Settings* settings = document ? &document->settings() : nullptr; > bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled()); > if (allowDownloading && item.isSupportedFormat() && document) { > if (CachedFont* cachedFont = item.cachedFont(document, foundSVGFont, isInitiatingElementInUserAgentShadowTree)) > source = std::make_unique<CSSFontFaceSource>(fontFace, item.resource(), cachedFont); > } >- } else >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::appendSources() source: " << source.get()); >+ } else { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::appendSources() local source"); > source = std::make_unique<CSSFontFaceSource>(fontFace, item.resource(), nullptr, fontFaceElement); >+ } > > if (source) > fontFace.adoptSource(WTFMove(source)); >@@ -473,15 +478,19 @@ bool CSSFontFace::rangesMatchCodePoint(UChar32 character) const > > void CSSFontFace::fontLoadEventOccurred() > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::fontLoadEventOccurred()" << this); > Ref<CSSFontFace> protectedThis(*this); > > // If the font is already in the cache, CSSFontFaceSource may report it's loaded before it is added here as a source. > // Let's not pump the state machine until we've got all our sources. font() and load() are smart enough to act correctly > // when a source is failed or succeeded before we have asked it to load. >- if (m_sourcesPopulated) >+ if (m_sourcesPopulated) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::fontLoadEventOccurred() pumping..." << this); > pump(ExternalResourceDownloadPolicy::Forbid); >+ } > > ASSERT(m_fontSelector); >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::fontLoadEventOccurred() Delegating fontLoaded() to m_fontSelector" << this); > m_fontSelector->fontLoaded(); > > iterateClients(m_clients, [&](Client& client) { >@@ -508,6 +517,7 @@ void CSSFontFace::timeoutFired() > break; > } > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::timeoutFired()" << this); > fontLoadEventOccurred(); > } > >@@ -684,6 +694,7 @@ void CSSFontFace::setStatus(Status newStatus) > > void CSSFontFace::fontLoaded(CSSFontFaceSource&) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::fontLoaded()"); > fontLoadEventOccurred(); > } > >@@ -706,6 +717,7 @@ size_t CSSFontFace::pump(ExternalResourceDownloadPolicy policy) > if (status() == Status::Failure) > return 0; > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::pump()"); > size_t i; > for (i = 0; i < m_sources.size(); ++i) { > auto& source = m_sources[i]; >@@ -783,6 +795,7 @@ RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool synt > if (computeFailureState()) > return nullptr; > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFace::font()"); > // Our status is derived from the first non-failed source. However, this source may > // return null from font(), which means we need to continue looping through the remainder > // of the sources to try to find a font to use. These subsequent tries should not affect >diff --git a/Source/WebCore/css/CSSFontFaceSet.cpp b/Source/WebCore/css/CSSFontFaceSet.cpp >index 5a714580f5440cd3d3c37aaada5d207763951d28..487435dff75d9f010a1fd4643025ac2dee7f93dc 100644 >--- a/Source/WebCore/css/CSSFontFaceSet.cpp >+++ b/Source/WebCore/css/CSSFontFaceSet.cpp >@@ -36,6 +36,7 @@ > #include "CSSValueList.h" > #include "CSSValuePool.h" > #include "FontCache.h" >+#include "Logging.h" > #include "StyleBuilderConverter.h" > #include "StyleProperties.h" > >@@ -404,16 +405,21 @@ ExceptionOr<bool> CSSFontFaceSet::check(const String& font, const String& text) > > CSSSegmentedFontFace* CSSFontFaceSet::fontFace(FontSelectionRequest request, const AtomicString& family) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSet::fontFace(" << family << ")"); > auto iterator = m_facesLookupTable.find(family); >- if (iterator == m_facesLookupTable.end()) >+ if (iterator == m_facesLookupTable.end()) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSet::fontFace() not present in m_facesLookupTable"); > return nullptr; >+ } > auto& familyFontFaces = iterator->value; > > auto& segmentedFontFaceCache = m_cache.add(family, FontSelectionHashMap()).iterator->value; > > auto& face = segmentedFontFaceCache.add(request, nullptr).iterator->value; >- if (face) >+ if (face) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSet::fontFace() found in segmentedFontFaceCache"); > return face.get(); >+ } > > face = CSSSegmentedFontFace::create(); > >@@ -466,8 +472,10 @@ CSSSegmentedFontFace* CSSFontFaceSet::fontFace(FontSelectionRequest request, con > return true; > return false; > }); >- for (auto& candidate : candidateFontFaces) >+ for (auto& candidate : candidateFontFaces) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSet::fontFace() contains " << downcast<CSSPrimitiveValue>(candidate.get().families()->item(0))->fontFamily().familyName); > face->appendFontFace(candidate.get()); >+ } > } > > return face.get(); >diff --git a/Source/WebCore/css/CSSFontFaceSource.cpp b/Source/WebCore/css/CSSFontFaceSource.cpp >index 09527f1b126c7cb5f2dddcbda421a285e05adf31..3a7e1f685d2b8870a6bb07bb1798ad72dc254b8f 100644 >--- a/Source/WebCore/css/CSSFontFaceSource.cpp >+++ b/Source/WebCore/css/CSSFontFaceSource.cpp >@@ -85,10 +85,13 @@ CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNam > #if !ENABLE(SVG_FONTS) > UNUSED_PARAM(fontFace); > #endif >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSource::CSSFontFaceSource() " << this); > > // This may synchronously call fontLoaded(). >- if (m_font) >+ if (m_font) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSource::CSSFontFaceSource() " << this << " has CachedFont " << font); > m_font->addClient(*this); >+ } > > if (status() == Status::Pending && m_font && m_font->isLoaded()) { > setStatus(Status::Loading); >@@ -120,10 +123,12 @@ void CSSFontFaceSource::opportunisticallyStartFontDataURLLoading(CSSFontSelector > > void CSSFontFaceSource::fontLoaded(CachedFont& loadedFont) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSource::fontLoaded() " << this); > ASSERT_UNUSED(loadedFont, &loadedFont == m_font.get()); > > if (shouldIgnoreFontLoadCompletions()) > return; >+ LOG_WITH_STREAM(Fonts, stream << "Not ignoring"); > > Ref<CSSFontFace> protectedFace(m_face); > >@@ -141,15 +146,18 @@ void CSSFontFaceSource::fontLoaded(CachedFont& loadedFont) > else > setStatus(Status::Success); > >+ LOG_WITH_STREAM(Fonts, stream << "Delegating " << this << " to m_face"); > m_face.fontLoaded(*this); > } > > void CSSFontFaceSource::load(CSSFontSelector* fontSelector) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSource::load() " << this); > setStatus(Status::Loading); > > if (m_font) { > ASSERT(fontSelector); >+ LOG_WITH_STREAM(Fonts, stream << "fontSelector->beginLoadingFontSoon(*m_font)" << this); > fontSelector->beginLoadingFontSoon(*m_font); > } else { > bool success = false; >diff --git a/Source/WebCore/css/CSSFontFaceSrcValue.cpp b/Source/WebCore/css/CSSFontFaceSrcValue.cpp >index 0fbcdc9ce40783eeaad64d6faa08568d9c7ea6df..3efbe0b38830aaf28f84172d240dc6c7f54a6984 100644 >--- a/Source/WebCore/css/CSSFontFaceSrcValue.cpp >+++ b/Source/WebCore/css/CSSFontFaceSrcValue.cpp >@@ -103,6 +103,7 @@ CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isSVG, bool > CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options); > request.setInitiator(cachedResourceRequestInitiators().css); > m_cachedFont = document->cachedResourceLoader().requestFont(WTFMove(request), isSVG).value_or(nullptr); >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontFaceSrcValue::cachedFont() " << document->completeURL(m_resource) << " " << m_cachedFont.get()); > return m_cachedFont.get(); > } > >diff --git a/Source/WebCore/css/CSSFontSelector.cpp b/Source/WebCore/css/CSSFontSelector.cpp >index d55127bec949a99571c4eec9557f8e62926ccd07..50ac9c7c89772339e9b6b160767833e5b8f30c64 100644 >--- a/Source/WebCore/css/CSSFontSelector.cpp >+++ b/Source/WebCore/css/CSSFontSelector.cpp >@@ -68,6 +68,9 @@ CSSFontSelector::CSSFontSelector(Document& document) > , m_uniqueId(++fontSelectorId) > , m_version(0) > { >+ auto* channel = getLogChannel("Fonts"); >+ channel->state = WTFLogChannelOn; >+ > ASSERT(m_document); > FontCache::singleton().addClient(*this); > m_cssFontFaceSet->addClient(*this); >@@ -112,10 +115,15 @@ void CSSFontSelector::buildStarted() > ASSERT(m_cssConnectionsPossiblyToRemove.isEmpty()); > ASSERT(m_cssConnectionsEncounteredDuringBuild.isEmpty()); > ASSERT(m_stagingArea.isEmpty()); >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::buildStarted()"); > for (size_t i = 0; i < m_cssFontFaceSet->faceCount(); ++i) { > CSSFontFace& face = m_cssFontFaceSet.get()[i]; >- if (face.cssConnection()) >+ if (face.cssConnection()) { >+ LOG_WITH_STREAM(Fonts, stream << "m_cssConnectionsPossiblyToRemove.add(" << &face << ")"); > m_cssConnectionsPossiblyToRemove.add(&face); >+ } else { >+ LOG_WITH_STREAM(Fonts, stream << &face << " has no cssConnection"); >+ } > } > } > >@@ -126,16 +134,24 @@ void CSSFontSelector::buildCompleted() > > m_buildIsUnderway = false; > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::buildCompleted()"); >+ > // Some font faces weren't re-added during the build process. > for (auto& face : m_cssConnectionsPossiblyToRemove) { > auto* connection = face->cssConnection(); > ASSERT(connection); >- if (!m_cssConnectionsEncounteredDuringBuild.contains(connection)) >+ if (!m_cssConnectionsEncounteredDuringBuild.contains(connection)) { >+ LOG_WITH_STREAM(Fonts, stream << "Removing " << face << " because it didn't get added back during the build."); > m_cssFontFaceSet->remove(*face); >+ } else { >+ LOG_WITH_STREAM(Fonts, stream << face << " was re-added during the build, so not touching it."); >+ } > } > >- for (auto& item : m_stagingArea) >+ for (auto& item : m_stagingArea) { >+ LOG_WITH_STREAM(Fonts, stream << "Adding " << &item.styleRuleFontFace << " to the FontSelector"); > addFontFaceRule(item.styleRuleFontFace, item.isInitiatingElementInUserAgentShadowTree); >+ } > m_cssConnectionsEncounteredDuringBuild.clear(); > m_stagingArea.clear(); > m_cssConnectionsPossiblyToRemove.clear(); >@@ -144,11 +160,13 @@ void CSSFontSelector::buildCompleted() > void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isInitiatingElementInUserAgentShadowTree) > { > if (m_buildIsUnderway) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::addFontFaceRule(): Queueing " << &fontFaceRule << " for later addition"); > m_cssConnectionsEncounteredDuringBuild.add(&fontFaceRule); > m_stagingArea.append({fontFaceRule, isInitiatingElementInUserAgentShadowTree}); > return; > } > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::addFontFaceRule(): Adding " << &fontFaceRule << "..."); > const StyleProperties& style = fontFaceRule.properties(); > RefPtr<CSSValue> fontFamily = style.getPropertyCSSValue(CSSPropertyFontFamily); > RefPtr<CSSValue> fontStyle = style.getPropertyCSSValue(CSSPropertyFontStyle); >@@ -222,11 +240,13 @@ void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isIn > // the CSSFontFaceSource objects will inspect their CachedFonts, the new CSSFontFace is smart enough > // to enter the correct state() during the next pump(). This approach of making a new CSSFontFace is > // simpler than computing and applying a diff of the StyleProperties. >+ LOG_WITH_STREAM(Fonts, stream << "Wrapper exists. Adopting."); > m_cssFontFaceSet->remove(*existingFace); > if (auto* existingWrapper = existingFace->existingWrapper()) > existingWrapper->adopt(fontFace.get()); > } > >+ LOG_WITH_STREAM(Fonts, stream << "Add success. FontFace: " << fontFace.ptr() << " first family: " << downcast<CSSPrimitiveValue>(fontFace->families()->item(0))->fontFamily().familyName); > m_cssFontFaceSet->add(fontFace.get()); > ++m_version; > } >@@ -244,6 +264,7 @@ void CSSFontSelector::unregisterForInvalidationCallbacks(FontSelectorClient& cli > void CSSFontSelector::dispatchInvalidationCallbacks() > { > ++m_version; >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::dispatchInvalidationCallbacks()"); > > for (auto& client : copyToVector(m_clients)) > client->fontsNeedUpdate(*this); >@@ -260,17 +281,20 @@ void CSSFontSelector::opportunisticallyStartFontDataURLLoading(const FontCascade > > void CSSFontSelector::fontLoaded() > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::fontLoaded()"); > dispatchInvalidationCallbacks(); > } > > void CSSFontSelector::fontModified() > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::fontModified()"); > if (!m_creatingFont && !m_buildIsUnderway) > dispatchInvalidationCallbacks(); > } > > void CSSFontSelector::fontCacheInvalidated() > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::fontCacheInvalidated()"); > dispatchInvalidationCallbacks(); > } > >@@ -302,6 +326,7 @@ static const AtomicString& resolveGenericFamily(Document* document, const FontDe > > FontRanges CSSFontSelector::fontRangesForFamily(const FontDescription& fontDescription, const AtomicString& familyName) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::fontRangesForFamily(" << familyName << ")"); > // If this ASSERT() fires, it usually means you forgot a document.updateStyleIfNeeded() somewhere. > ASSERT(!m_buildIsUnderway || m_computingRootStyleFontCount); > >@@ -335,6 +360,7 @@ void CSSFontSelector::clearDocument() > return; > } > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::clearDocument()"); > m_beginLoadingTimer.stop(); > > CachedResourceLoader& cachedResourceLoader = m_document->cachedResourceLoader(); >@@ -355,6 +381,7 @@ void CSSFontSelector::beginLoadingFontSoon(CachedFont& font) > if (!m_document) > return; > >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::beginLoadingFontSoon(" << &font << ")"); > m_fontsToBeginLoading.append(&font); > // Increment the request count now, in order to prevent didFinishLoad from being dispatched > // after this font has been requested but before it began loading. Balanced by >@@ -366,6 +393,7 @@ void CSSFontSelector::beginLoadingFontSoon(CachedFont& font) > > void CSSFontSelector::beginLoadTimerFired() > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSFontSelector::beginLoadTimerFired()"); > Vector<CachedResourceHandle<CachedFont>> fontsToBeginLoading; > fontsToBeginLoading.swap(m_fontsToBeginLoading); > >@@ -374,6 +402,7 @@ void CSSFontSelector::beginLoadTimerFired() > > CachedResourceLoader& cachedResourceLoader = m_document->cachedResourceLoader(); > for (auto& fontHandle : fontsToBeginLoading) { >+ LOG_WITH_STREAM(Fonts, stream << "Starting load for " << fontHandle.get()); > fontHandle->beginLoadIfNeeded(cachedResourceLoader); > // Balances incrementRequestCount() in beginLoadingFontSoon(). > cachedResourceLoader.decrementRequestCount(*fontHandle); >diff --git a/Source/WebCore/css/CSSSegmentedFontFace.cpp b/Source/WebCore/css/CSSSegmentedFontFace.cpp >index ae1ce5b6afd8faefd16f9b141d0392506e6e9364..93cb8173ab0d25a9e8522735fab7013e86bdf7a1 100644 >--- a/Source/WebCore/css/CSSSegmentedFontFace.cpp >+++ b/Source/WebCore/css/CSSSegmentedFontFace.cpp >@@ -31,6 +31,7 @@ > #include "FontCache.h" > #include "FontDescription.h" > #include "FontSelector.h" >+#include "Logging.h" > > namespace WebCore { > >@@ -108,12 +109,14 @@ static void appendFont(FontRanges& ranges, Ref<FontAccessor>&& fontAccessor, con > > FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription) > { >+ LOG_WITH_STREAM(Fonts, stream << "CSSSegmentedFontFace::fontRanges()"); > auto desiredRequest = fontDescription.fontSelectionRequest(); > > auto addResult = m_cache.add(FontDescriptionKey(fontDescription), FontRanges()); > auto& result = addResult.iterator->value; > > if (addResult.isNewEntry) { >+ LOG_WITH_STREAM(Fonts, stream << "CSSSegmentedFontFace::fontRanges() new entry"); > for (auto& face : m_fontFaces) { > if (face->computeFailureState()) > continue; >@@ -128,7 +131,8 @@ FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescripti > continue; > appendFont(result, WTFMove(fontAccessor), face->ranges()); > } >- } >+ } else >+ LOG_WITH_STREAM(Fonts, stream << "CSSSegmentedFontFace::fontRanges() found in cache"); > return result; > } > >diff --git a/Source/WebCore/platform/graphics/FontCache.cpp b/Source/WebCore/platform/graphics/FontCache.cpp >index bf3036fe0ce76135aaa7a772f7291dcb20270743..3bd68c3babba31514233821a4120ff7207413e18 100644 >--- a/Source/WebCore/platform/graphics/FontCache.cpp >+++ b/Source/WebCore/platform/graphics/FontCache.cpp >@@ -209,6 +209,7 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo > #if PLATFORM(IOS_FAMILY) > auto locker = holdLock(fontLock); > #endif >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::getCachedFontPlatformData(" << passedFamilyName << ")"); > > #if OS(WINDOWS) && ENABLE(OPENTYPE_VERTICAL) > // Leading "@" in the font name enables Windows vertical flow flag for the font. >@@ -231,6 +232,7 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo > auto addResult = fontPlatformDataCache().add(key, nullptr); > FontPlatformDataCache::iterator it = addResult.iterator; > if (addResult.isNewEntry) { >+ LOG_WITH_STREAM(Fonts, stream << "New entry"); > it->value = createFontPlatformData(fontDescription, familyName, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities); > > if (!it->value && !checkingAlternateName) { >@@ -247,8 +249,10 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo > it->value = std::make_unique<FontPlatformData>(*fontPlatformDataForAlternateName); > } > } >- } >+ } else >+ LOG_WITH_STREAM(Fonts, stream << "Found in cache!"); > >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::getCachedFontPlatformData() returning " << it->value.get()); > return it->value.get(); > } > >@@ -322,12 +326,14 @@ const unsigned cTargetUnderMemoryPressureInactiveFontData = 30; > > RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool checkingAlternateName) > { >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::fontForFamily(" << family << ")"); > if (!m_purgeTimer.isActive()) > m_purgeTimer.startOneShot(0_s); > > if (auto* platformData = getCachedFontPlatformData(fontDescription, family, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, checkingAlternateName)) > return fontForPlatformData(*platformData); > >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::fontForFamily() returning nullptr"); > return nullptr; > } > >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >index 528528425b674f8afba311ced16e75f06284fc71..b4b545e486a5ba4451cbfa58dca0b6c9b79a7b6a 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >@@ -27,6 +27,7 @@ > #include "FontCache.h" > > #include "Font.h" >+#include "Logging.h" > #include "SystemFontDatabaseCoreText.h" > #include <pal/spi/cocoa/CoreTextSPI.h> > >@@ -1258,6 +1259,7 @@ static void autoActivateFont(const String& name, CGFloat size) > > std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities) > { >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::createFontPlatformData(" << family << ")"); > float size = fontDescription.computedPixelSize(); > > auto font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, size); >@@ -1275,6 +1277,8 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe > } > #endif > >+ LOG_WITH_STREAM(Fonts, stream << "FontCache::createFontPlatformData() found " << (font ? String(adoptCF(CTFontCopyPostScriptName(font.get())).get()) : "null"_str)); >+ > if (!font) > return nullptr; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194251
:
361122
|
361150
|
366460
|
366461
|
366536
|
366537