Changeset 292274 in webkit
- Timestamp:
- Apr 2, 2022, 10:39:31 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 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-wk2/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/Page.cpp (modified) (2 diffs)
-
Source/WebCore/page/Page.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontCache.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/FontCache.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (modified) (2 diffs)
-
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r292270 r292274 1 2022-04-02 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 * TestExpectations: 10 * fast/text/install-font-style-recalc-expected.txt: Added. 11 * fast/text/install-font-style-recalc.html: Added. 12 * platform/ios-wk2/TestExpectations: 13 * platform/mac-wk2/TestExpectations: 14 1 15 2022-04-02 Alan Bujtas <zalan@apple.com> 2 16 -
trunk/LayoutTests/TestExpectations
r292270 r292274 5205 5205 # Only certain ports have WebGPU implementations. 5206 5206 http/tests/webgpu [ Failure ImageOnlyFailure Pass Timeout ] 5207 5208 # Only some ports automatically relayout if a font is installed while the page is open 5209 fast/text/install-font-style-recalc.html [ Failure ] -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r292250 r292274 2253 2253 2254 2254 webkit.org/b/238634 media/video-object-fit.html [ ImageOnlyFailure ] 2255 2256 fast/text/install-font-style-recalc.html [ Pass ] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r292246 r292274 1703 1703 webkit.org/b/233621 http/tests/webgpu [ Skip ] 1704 1704 1705 webkit.org/b/238641fast/text/install-font-style-recalc.html [ Pass ]1705 fast/text/install-font-style-recalc.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r292273 r292274 1 2022-04-02 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_contentSecurityPolicyModeForExtension): 20 (WebCore::Page::firstTimeInitialization): 21 * page/Page.h: 22 * platform/graphics/FontCache.cpp: 23 (WebCore::Function<void): 24 (WebCore::FontCache::registerFontCacheInvalidationCallback): 25 (WebCore::FontCache::invalidateAllFontCaches): 26 * platform/graphics/FontCache.h: 27 1 28 2022-04-02 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebCore/page/Page.cpp
r292264 r292274 357 357 m_visitedLinkStore->addPage(*this); 358 358 359 static bool addedListener;360 if (! addedListener) {361 platformStrategies()->loaderStrategy()->addOnlineStateChangeListener(&networkStateChanged);362 addedListener= true;359 static bool firstTimeInitializationRan = false; 360 if (!firstTimeInitializationRan) { 361 firstTimeInitialization(); 362 firstTimeInitializationRan = true; 363 363 } 364 364 … … 432 432 m_userContentProvider->removePage(*this); 433 433 m_visitedLinkStore->removePage(*this); 434 } 435 436 void Page::firstTimeInitialization() 437 { 438 platformStrategies()->loaderStrategy()->addOnlineStateChangeListener(&networkStateChanged); 439 440 FontCache::registerFontCacheInvalidationCallback([] { 441 forEachPage([](auto& page) { 442 page.setNeedsRecalcStyleInAllFrames(); 443 }); 444 }); 434 445 } 435 446 -
trunk/Source/WebCore/page/Page.h
r292264 r292274 968 968 void logNavigation(const Navigation&); 969 969 970 static void firstTimeInitialization(); 971 970 972 WEBCORE_EXPORT void initGroup(); 971 973 -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r292245 r292274 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
r292245 r292274 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 -
trunk/Tools/ChangeLog
r292271 r292274 1 2022-04-02 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 Make TestRunner::dumpResourceLoadStatistics() clear any currently-recorded statistics. 10 This avoids the problem where spurious layouts during the time when the page has been created but 11 before the test has begun record irrelevant statistics. 12 13 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 14 (WTR::InjectedBundle::beginTesting): 15 (WTR::InjectedBundle::clearResourceLoadStatistics): 16 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 17 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 18 (WTR::TestRunner::dumpResourceLoadStatistics): 19 1 20 2022-04-02 Andres Gonzalez <andresg_22@apple.com> 2 21 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r292251 r292274 544 544 WKBundlePageClearApplicationCache(page()->page()); 545 545 WKBundleResetOriginAccessAllowLists(m_bundle.get()); 546 WKBundleClearResourceLoadStatistics(m_bundle.get());546 clearResourceLoadStatistics(); 547 547 548 548 // [WK2] REGRESSION(r128623): It made layout tests extremely slow … … 575 575 576 576 m_state = Idle; 577 } 578 579 void InjectedBundle::clearResourceLoadStatistics() 580 { 581 WKBundleClearResourceLoadStatistics(m_bundle.get()); 577 582 } 578 583 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
r292251 r292274 151 151 size_t userScriptInjectedCount() const { return m_userScriptInjectedCount; } 152 152 153 void clearResourceLoadStatistics(); 154 153 155 private: 154 156 InjectedBundle() = default; -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r291737 r292274 1347 1347 void TestRunner::dumpResourceLoadStatistics() 1348 1348 { 1349 InjectedBundle::singleton().clearResourceLoadStatistics(); 1349 1350 postSynchronousPageMessage("dumpResourceLoadStatistics"); 1350 1351 }
Note:
See TracChangeset
for help on using the changeset viewer.