Changeset 292072 in webkit
- Timestamp:
- Mar 29, 2022, 2:49:38 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/text/install-font-style-recalc-expected.txt (added)
-
LayoutTests/fast/text/install-font-style-recalc.html (added)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/Page.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontCache.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/FontCache.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r292069 r292072 1 2022-03-29 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] Automatically relayout the page when new fonts are installed 4 https://bugs.webkit.org/show_bug.cgi?id=238483 5 <rdar://problem/80544133> 6 7 Reviewed by Chris Dumez. 8 9 * fast/text/install-font-style-recalc-expected.txt: Added. 10 * fast/text/install-font-style-recalc.html: Added. 11 1 12 2022-03-29 Arcady Goldmints-Orlov <agoldmints@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r292045 r292072 5209 5209 # Only certain ports have WebGPU implementations. 5210 5210 http/tests/webgpu [ Failure ImageOnlyFailure Pass Timeout ] 5211 5212 # Only some ports automatically relayout if a font is installed while the page is open 5213 fast/text/install-font-style-recalc.html [ Failure ] -
trunk/LayoutTests/platform/ios/TestExpectations
r292061 r292072 3568 3568 # iOS has a WebGPU implementation. 3569 3569 http/tests/webgpu [ Pass ] 3570 3571 fast/text/install-font-style-recalc.html [ Pass ] -
trunk/LayoutTests/platform/mac/TestExpectations
r292052 r292072 2416 2416 # macOS has a WebGPU implementation. 2417 2417 http/tests/webgpu [ Pass ] 2418 2419 fast/text/install-font-style-recalc.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r292067 r292072 1 2022-03-29 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] Automatically relayout the page when new fonts are installed 4 https://bugs.webkit.org/show_bug.cgi?id=238483 5 <rdar://problem/80544133> 6 7 Reviewed by Chris Dumez. 8 9 This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a 10 kCTFontManagerRegisteredFontsChangedNotification. 11 12 FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and 13 therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global 14 callback and calls that instead. This callback is set at initialization time. 15 16 Test: fast/text/install-font-style-recalc.html 17 18 * page/Page.cpp: 19 (WebCore::m_attachmentElementClient): 20 * platform/graphics/FontCache.cpp: 21 (WebCore::Function<void): 22 (WebCore::FontCache::registerFontCacheInvalidationCallback): 23 (WebCore::FontCache::invalidateAllFontCaches): 24 * platform/graphics/FontCache.h: 25 1 26 2022-03-29 Alex Christensen <achristensen@webkit.org> 2 27 -
trunk/Source/WebCore/page/Page.cpp
r291992 r292072 389 389 if (m_lowPowerModeNotifier->isLowPowerModeEnabled()) 390 390 m_throttlingReasons.add(ThrottlingReason::LowPowerMode); 391 392 static bool fontCacheInvalidationCallbackRegistered = false; 393 if (!fontCacheInvalidationCallbackRegistered) { 394 FontCache::registerFontCacheInvalidationCallback([] { 395 forEachPage([](auto& page) { 396 page.setNeedsRecalcStyleInAllFrames(); 397 }); 398 }); 399 fontCacheInvalidationCallbackRegistered = true; 400 } 391 401 } 392 402 -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r290901 r292072 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 -
trunk/Source/WebCore/platform/graphics/FontCache.h
r290901 r292072 329 329 unsigned short generation() const { return m_generation; } 330 330 WEBCORE_EXPORT void invalidate(); 331 static void registerFontCacheInvalidationCallback(Function<void()>&&); 331 332 WEBCORE_EXPORT static void invalidateAllFontCaches(); 332 333
Note:
See TracChangeset
for help on using the changeset viewer.