WebKit Bugzilla
Attachment 373046 Details for
Bug 199283
: Prewarm font cache with more fonts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199283-20190627125237.patch (text/plain), 2.62 KB, created by
Per Arne Vollan
on 2019-06-27 12:52:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2019-06-27 12:52:38 PDT
Size:
2.62 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 246897) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-06-27 Per Arne Vollan <pvollan@apple.com> >+ >+ Prewarm font cache with more fonts >+ https://bugs.webkit.org/show_bug.cgi?id=199283 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names. >+ This is a confirmed improvement in page load time. >+ >+ No new tests, covered by existing tests. >+ >+ * page/ProcessWarming.cpp: >+ (WebCore::fontFamilies): >+ (WebCore::ProcessWarming::prewarmGlobally): >+ > 2019-06-27 Beth Dakin <bdakin@apple.com> > > Upstream use of MACCATALYST >Index: Source/WebCore/page/ProcessWarming.cpp >=================================================================== >--- Source/WebCore/page/ProcessWarming.cpp (revision 246809) >+++ Source/WebCore/page/ProcessWarming.cpp (working copy) >@@ -58,7 +58,31 @@ void ProcessWarming::initializeNames() > XMLNames::init(); > WebKitFontFamilyNames::init(); > } >- >+ >+static Vector<String>& fontFamilies() >+{ >+ static NeverDestroyed<Vector<String>> families = std::initializer_list<String> { >+ "-apple-system"_s, >+ "-webkit-standard"_s, >+ "sans-serif"_s, >+ "system-ui"_s, >+ "Arial"_s, >+ "Avenir"_s, >+ "Helvetica"_s, >+ "Helvetica Neue"_s, >+ "Hiragino Sans GB"_s, >+ "Lucida Grande"_s, >+ "PingFang"_s, >+ "SF Pro Text"_s, >+ "SF Pro Icons"_s, >+ "STHeiti"_s, >+ "Segoe UI"_s, >+ "Times"_s, >+ "Times New Roman"_s >+ }; >+ return families; >+} >+ > void ProcessWarming::prewarmGlobally() > { > initializeNames(); >@@ -72,14 +96,11 @@ void ProcessWarming::prewarmGlobally() > // Prewarms JS VM. > commonVM(); > >-#if USE_PLATFORM_SYSTEM_FALLBACK_LIST >- // Cache system UI font fallbacks. Almost every web process needs these. >- // Initializing one size is sufficient to warm CoreText caches. >- FontCascadeDescription systemFontDescription; >- systemFontDescription.setOneFamily("system-ui"); >- systemFontDescription.setComputedSize(11); >- systemFontDescription.effectiveFamilyCount(); >-#endif >+ // Prewarm font cache >+ FontCache::PrewarmInformation prewarmInfo; >+ prewarmInfo.seenFamilies = fontFamilies(); >+ prewarmInfo.fontNamesRequiringSystemFallback = fontFamilies(); >+ FontCache::singleton().prewarm(prewarmInfo); > > #if ENABLE(TELEPHONE_NUMBER_DETECTION) > TelephoneNumberDetector::isSupported();
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 199283
:
373046
|
373118
|
374141
|
374228
|
374237
|
374238
|
374427