Changeset 293267 in webkit
- Timestamp:
- Apr 22, 2022 4:59:50 PM (2 years ago)
- Location:
- branches/safari-613.2.7.1-branch
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613.2.7.1-branch/LayoutTests/ChangeLog
r293236 r293267 1 2022-04-22 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r292072. rdar://problem/80544133 4 5 [Cocoa] Automatically relayout the page when new fonts are installed 6 https://bugs.webkit.org/show_bug.cgi?id=238483 7 <rdar://problem/80544133> 8 9 Reviewed by Chris Dumez. 10 11 Source/WebCore: 12 13 This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a 14 kCTFontManagerRegisteredFontsChangedNotification. 15 16 FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and 17 therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global 18 callback and calls that instead. This callback is set at initialization time. 19 20 Test: fast/text/install-font-style-recalc.html 21 22 * page/Page.cpp: 23 (WebCore::m_attachmentElementClient): 24 * platform/graphics/FontCache.cpp: 25 (WebCore::Function<void): 26 (WebCore::FontCache::registerFontCacheInvalidationCallback): 27 (WebCore::FontCache::invalidateAllFontCaches): 28 * platform/graphics/FontCache.h: 29 30 LayoutTests: 31 32 * fast/text/install-font-style-recalc-expected.txt: Added. 33 * fast/text/install-font-style-recalc.html: Added. 34 35 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292072 268f45cc-cd09-0410-ab3c-d52691b4dbfc 36 37 2022-03-29 Myles C. Maxfield <mmaxfield@apple.com> 38 39 [Cocoa] Automatically relayout the page when new fonts are installed 40 https://bugs.webkit.org/show_bug.cgi?id=238483 41 <rdar://problem/80544133> 42 43 Reviewed by Chris Dumez. 44 45 * fast/text/install-font-style-recalc-expected.txt: Added. 46 * fast/text/install-font-style-recalc.html: Added. 47 1 48 2022-04-22 Russell Epstein <repstein@apple.com> 2 49 -
branches/safari-613.2.7.1-branch/LayoutTests/TestExpectations
r293133 r293267 5207 5207 security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html [ Skip ] 5208 5208 userscripts/user-script-plugin-document.html [ Skip ] 5209 5210 # Only some ports automatically relayout if a font is installed while the page is open 5211 fast/text/install-font-style-recalc.html [ Failure ] -
branches/safari-613.2.7.1-branch/LayoutTests/platform/ios/TestExpectations
r293079 r293267 3457 3457 3458 3458 webkit.org/b/159755 fast/text/emoji-num-glyphs.html [ Pass ] 3459 3460 fast/text/install-font-style-recalc.html [ Pass ] -
branches/safari-613.2.7.1-branch/LayoutTests/platform/mac/TestExpectations
r289349 r293267 2430 2430 # This test is specific to Core Text. 2431 2431 fast/text/font-lookup-dot-prefix-case-sensitive.html [ Pass ] 2432 2433 fast/text/install-font-style-recalc.html [ Pass ] -
branches/safari-613.2.7.1-branch/Source/WebCore/ChangeLog
r293261 r293267 1 2022-04-22 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r292072. rdar://problem/80544133 4 5 [Cocoa] Automatically relayout the page when new fonts are installed 6 https://bugs.webkit.org/show_bug.cgi?id=238483 7 <rdar://problem/80544133> 8 9 Reviewed by Chris Dumez. 10 11 Source/WebCore: 12 13 This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a 14 kCTFontManagerRegisteredFontsChangedNotification. 15 16 FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and 17 therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global 18 callback and calls that instead. This callback is set at initialization time. 19 20 Test: fast/text/install-font-style-recalc.html 21 22 * page/Page.cpp: 23 (WebCore::m_attachmentElementClient): 24 * platform/graphics/FontCache.cpp: 25 (WebCore::Function<void): 26 (WebCore::FontCache::registerFontCacheInvalidationCallback): 27 (WebCore::FontCache::invalidateAllFontCaches): 28 * platform/graphics/FontCache.h: 29 30 LayoutTests: 31 32 * fast/text/install-font-style-recalc-expected.txt: Added. 33 * fast/text/install-font-style-recalc.html: Added. 34 35 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292072 268f45cc-cd09-0410-ab3c-d52691b4dbfc 36 37 2022-03-29 Myles C. Maxfield <mmaxfield@apple.com> 38 39 [Cocoa] Automatically relayout the page when new fonts are installed 40 https://bugs.webkit.org/show_bug.cgi?id=238483 41 <rdar://problem/80544133> 42 43 Reviewed by Chris Dumez. 44 45 This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a 46 kCTFontManagerRegisteredFontsChangedNotification. 47 48 FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and 49 therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global 50 callback and calls that instead. This callback is set at initialization time. 51 52 Test: fast/text/install-font-style-recalc.html 53 54 * page/Page.cpp: 55 (WebCore::m_attachmentElementClient): 56 * platform/graphics/FontCache.cpp: 57 (WebCore::Function<void): 58 (WebCore::FontCache::registerFontCacheInvalidationCallback): 59 (WebCore::FontCache::invalidateAllFontCaches): 60 * platform/graphics/FontCache.h: 61 1 62 2022-04-22 Russell Epstein <repstein@apple.com> 2 63 -
branches/safari-613.2.7.1-branch/Source/WebCore/page/Page.cpp
r293133 r293267 384 384 if (m_lowPowerModeNotifier->isLowPowerModeEnabled()) 385 385 m_throttlingReasons.add(ThrottlingReason::LowPowerMode); 386 387 static bool fontCacheInvalidationCallbackRegistered = false; 388 if (!fontCacheInvalidationCallbackRegistered) { 389 FontCache::registerFontCacheInvalidationCallback([] { 390 forEachPage([](auto& page) { 391 page.setNeedsRecalcStyleInAllFrames(); 392 }); 393 }); 394 fontCacheInvalidationCallbackRegistered = true; 395 } 386 396 } 387 397 -
branches/safari-613.2.7.1-branch/Source/WebCore/platform/graphics/FontCache.cpp
r293133 r293267 490 490 } 491 491 492 static Function<void()>& fontCacheInvalidationCallback() 493 { 494 static NeverDestroyed<Function<void()>> callback; 495 return callback.get(); 496 } 497 498 void FontCache::registerFontCacheInvalidationCallback(Function<void()>&& callback) 499 { 500 fontCacheInvalidationCallback() = WTFMove(callback); 501 } 502 492 503 void FontCache::invalidateAllFontCaches() 493 504 { … … 496 507 // FIXME: Invalidate FontCaches in workers too. 497 508 FontCache::forCurrentThread().invalidate(); 509 510 if (fontCacheInvalidationCallback()) 511 fontCacheInvalidationCallback()(); 498 512 } 499 513 -
branches/safari-613.2.7.1-branch/Source/WebCore/platform/graphics/FontCache.h
r293133 r293267 323 323 unsigned short generation() const { return m_generation; } 324 324 WEBCORE_EXPORT void invalidate(); 325 static void registerFontCacheInvalidationCallback(Function<void()>&&); 325 326 WEBCORE_EXPORT static void invalidateAllFontCaches(); 326 327
Note: See TracChangeset
for help on using the changeset viewer.