Changeset 293268 in webkit
- Timestamp:
- Apr 22, 2022, 4:59:56 PM (4 years ago)
- Location:
- branches/safari-613.2.7.1-branch
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
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)
-
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
-
branches/safari-613.2.7.1-branch/LayoutTests/ChangeLog
r293267 r293268 1 2022-04-22 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r292274. 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_contentSecurityPolicyModeForExtension): 24 (WebCore::Page::firstTimeInitialization): 25 * page/Page.h: 26 * platform/graphics/FontCache.cpp: 27 (WebCore::Function<void): 28 (WebCore::FontCache::registerFontCacheInvalidationCallback): 29 (WebCore::FontCache::invalidateAllFontCaches): 30 * platform/graphics/FontCache.h: 31 32 Tools: 33 34 Make TestRunner::dumpResourceLoadStatistics() clear any currently-recorded statistics. 35 This avoids the problem where spurious layouts during the time when the page has been created but 36 before the test has begun record irrelevant statistics. 37 38 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 39 (WTR::InjectedBundle::beginTesting): 40 (WTR::InjectedBundle::clearResourceLoadStatistics): 41 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 42 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 43 (WTR::TestRunner::dumpResourceLoadStatistics): 44 45 LayoutTests: 46 47 * TestExpectations: 48 * fast/text/install-font-style-recalc-expected.txt: Added. 49 * fast/text/install-font-style-recalc.html: Added. 50 * platform/ios-wk2/TestExpectations: 51 * platform/mac-wk2/TestExpectations: 52 53 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292274 268f45cc-cd09-0410-ab3c-d52691b4dbfc 54 55 2022-04-02 Myles C. Maxfield <mmaxfield@apple.com> 56 57 [Cocoa] Automatically relayout the page when new fonts are installed 58 https://bugs.webkit.org/show_bug.cgi?id=238483 59 <rdar://problem/80544133> 60 61 Reviewed by Chris Dumez. 62 63 * TestExpectations: 64 * fast/text/install-font-style-recalc-expected.txt: Added. 65 * fast/text/install-font-style-recalc.html: Added. 66 * platform/ios-wk2/TestExpectations: 67 * platform/mac-wk2/TestExpectations: 68 1 69 2022-04-22 Russell Epstein <repstein@apple.com> 2 70 -
branches/safari-613.2.7.1-branch/LayoutTests/platform/ios-wk2/TestExpectations
r293133 r293268 2212 2212 imported/w3c/web-platform-tests/pointerevents [ Skip ] 2213 2213 pointerevents/mouse [ Failure ] 2214 2215 fast/text/install-font-style-recalc.html [ Pass ] -
branches/safari-613.2.7.1-branch/LayoutTests/platform/mac-wk2/TestExpectations
r293133 r293268 1676 1676 # rdar://86037417 WindowServer returned not alive with context:,unresponsive work processor(s) 1677 1677 [ Monterey+ ] http/tests/model/model-document.html [ Skip ] 1678 1679 fast/text/install-font-style-recalc.html [ Pass ] -
branches/safari-613.2.7.1-branch/Source/WebCore/ChangeLog
r293267 r293268 1 2022-04-22 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r292274. 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_contentSecurityPolicyModeForExtension): 24 (WebCore::Page::firstTimeInitialization): 25 * page/Page.h: 26 * platform/graphics/FontCache.cpp: 27 (WebCore::Function<void): 28 (WebCore::FontCache::registerFontCacheInvalidationCallback): 29 (WebCore::FontCache::invalidateAllFontCaches): 30 * platform/graphics/FontCache.h: 31 32 Tools: 33 34 Make TestRunner::dumpResourceLoadStatistics() clear any currently-recorded statistics. 35 This avoids the problem where spurious layouts during the time when the page has been created but 36 before the test has begun record irrelevant statistics. 37 38 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 39 (WTR::InjectedBundle::beginTesting): 40 (WTR::InjectedBundle::clearResourceLoadStatistics): 41 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 42 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 43 (WTR::TestRunner::dumpResourceLoadStatistics): 44 45 LayoutTests: 46 47 * TestExpectations: 48 * fast/text/install-font-style-recalc-expected.txt: Added. 49 * fast/text/install-font-style-recalc.html: Added. 50 * platform/ios-wk2/TestExpectations: 51 * platform/mac-wk2/TestExpectations: 52 53 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292274 268f45cc-cd09-0410-ab3c-d52691b4dbfc 54 55 2022-04-02 Myles C. Maxfield <mmaxfield@apple.com> 56 57 [Cocoa] Automatically relayout the page when new fonts are installed 58 https://bugs.webkit.org/show_bug.cgi?id=238483 59 <rdar://problem/80544133> 60 61 Reviewed by Chris Dumez. 62 63 This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a 64 kCTFontManagerRegisteredFontsChangedNotification. 65 66 FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and 67 therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global 68 callback and calls that instead. This callback is set at initialization time. 69 70 Test: fast/text/install-font-style-recalc.html 71 72 * page/Page.cpp: 73 (WebCore::m_contentSecurityPolicyModeForExtension): 74 (WebCore::Page::firstTimeInitialization): 75 * page/Page.h: 76 * platform/graphics/FontCache.cpp: 77 (WebCore::Function<void): 78 (WebCore::FontCache::registerFontCacheInvalidationCallback): 79 (WebCore::FontCache::invalidateAllFontCaches): 80 * platform/graphics/FontCache.h: 81 1 82 2022-04-22 Russell Epstein <repstein@apple.com> 2 83 -
branches/safari-613.2.7.1-branch/Source/WebCore/page/Page.cpp
r293267 r293268 350 350 m_visitedLinkStore->addPage(*this); 351 351 352 static bool addedListener;353 if (! addedListener) {354 platformStrategies()->loaderStrategy()->addOnlineStateChangeListener(&networkStateChanged);355 addedListener= true;352 static bool firstTimeInitializationRan = false; 353 if (!firstTimeInitializationRan) { 354 firstTimeInitialization(); 355 firstTimeInitializationRan = true; 356 356 } 357 357 … … 435 435 m_userContentProvider->removePage(*this); 436 436 m_visitedLinkStore->removePage(*this); 437 } 438 439 void Page::firstTimeInitialization() 440 { 441 platformStrategies()->loaderStrategy()->addOnlineStateChangeListener(&networkStateChanged); 442 443 FontCache::registerFontCacheInvalidationCallback([] { 444 forEachPage([](auto& page) { 445 page.setNeedsRecalcStyleInAllFrames(); 446 }); 447 }); 437 448 } 438 449 -
branches/safari-613.2.7.1-branch/Source/WebCore/page/Page.h
r293133 r293268 940 940 void logNavigation(const Navigation&); 941 941 942 static void firstTimeInitialization(); 943 942 944 WEBCORE_EXPORT void initGroup(); 943 945 -
branches/safari-613.2.7.1-branch/Tools/ChangeLog
r293248 r293268 1 2022-04-22 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r292274. 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_contentSecurityPolicyModeForExtension): 24 (WebCore::Page::firstTimeInitialization): 25 * page/Page.h: 26 * platform/graphics/FontCache.cpp: 27 (WebCore::Function<void): 28 (WebCore::FontCache::registerFontCacheInvalidationCallback): 29 (WebCore::FontCache::invalidateAllFontCaches): 30 * platform/graphics/FontCache.h: 31 32 Tools: 33 34 Make TestRunner::dumpResourceLoadStatistics() clear any currently-recorded statistics. 35 This avoids the problem where spurious layouts during the time when the page has been created but 36 before the test has begun record irrelevant statistics. 37 38 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 39 (WTR::InjectedBundle::beginTesting): 40 (WTR::InjectedBundle::clearResourceLoadStatistics): 41 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 42 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 43 (WTR::TestRunner::dumpResourceLoadStatistics): 44 45 LayoutTests: 46 47 * TestExpectations: 48 * fast/text/install-font-style-recalc-expected.txt: Added. 49 * fast/text/install-font-style-recalc.html: Added. 50 * platform/ios-wk2/TestExpectations: 51 * platform/mac-wk2/TestExpectations: 52 53 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292274 268f45cc-cd09-0410-ab3c-d52691b4dbfc 54 55 2022-04-02 Myles C. Maxfield <mmaxfield@apple.com> 56 57 [Cocoa] Automatically relayout the page when new fonts are installed 58 https://bugs.webkit.org/show_bug.cgi?id=238483 59 <rdar://problem/80544133> 60 61 Reviewed by Chris Dumez. 62 63 Make TestRunner::dumpResourceLoadStatistics() clear any currently-recorded statistics. 64 This avoids the problem where spurious layouts during the time when the page has been created but 65 before the test has begun record irrelevant statistics. 66 67 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 68 (WTR::InjectedBundle::beginTesting): 69 (WTR::InjectedBundle::clearResourceLoadStatistics): 70 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 71 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 72 (WTR::TestRunner::dumpResourceLoadStatistics): 73 1 74 2022-04-22 Russell Epstein <repstein@apple.com> 2 75 -
branches/safari-613.2.7.1-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r293133 r293268 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 -
branches/safari-613.2.7.1-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
r293133 r293268 149 149 size_t userScriptInjectedCount() const { return m_userScriptInjectedCount; } 150 150 151 void clearResourceLoadStatistics(); 152 151 153 private: 152 154 InjectedBundle() = default; -
branches/safari-613.2.7.1-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r293133 r293268 1334 1334 void TestRunner::dumpResourceLoadStatistics() 1335 1335 { 1336 InjectedBundle::singleton().clearResourceLoadStatistics(); 1336 1337 postSynchronousPageMessage("dumpResourceLoadStatistics"); 1337 1338 }
Note:
See TracChangeset
for help on using the changeset viewer.