Title: [292274] trunk
Revision 292274
Author mmaxfi...@apple.com
Date 2022-04-02 22:39:31 -0700 (Sat, 02 Apr 2022)
Log Message
[Cocoa] Automatically relayout the page when new fonts are installed
https://bugs.webkit.org/show_bug.cgi?id=238483
Reviewed by Chris Dumez.
Source/WebCore:
This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a
kCTFontManagerRegisteredFontsChangedNotification.
FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and
therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global
callback and calls that instead. This callback is set at initialization time.
Test: fast/text/install-font-style-recalc.html
* page/Page.cpp:
(WebCore::m_contentSecurityPolicyModeForExtension):
(WebCore::Page::firstTimeInitialization):
* page/Page.h:
* platform/graphics/FontCache.cpp:
(WebCore::Function
Modified Paths
trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/platform/ios-wk2/TestExpectations
trunk/LayoutTests/platform/mac-wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Page.cpp
trunk/Source/WebCore/page/Page.h
trunk/Source/WebCore/platform/graphics/FontCache.cpp
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Tools/ChangeLog
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Added Paths
trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt
trunk/LayoutTests/fast/text/install-font-style-recalc.html
Diff
Modified: trunk/LayoutTests/ChangeLog (292273 => 292274)
--- trunk/LayoutTests/ChangeLog 2022-04-03 05:24:35 UTC (rev 292273)
+++ trunk/LayoutTests/ChangeLog 2022-04-03 05:39:31 UTC (rev 292274)
@@ -1,3 +1,17 @@
+2022-04-02 Myles C. Maxfield
+
+[Cocoa] Automatically relayout the page when new fonts are installed
+https://bugs.webkit.org/show_bug.cgi?id=238483
+
+
+Reviewed by Chris Dumez.
+
+* TestExpectations:
+* fast/text/install-font-style-recalc-expected.txt: Added.
+* fast/text/install-font-style-recalc.html: Added.
+* platform/ios-wk2/TestExpectations:
+* platform/mac-wk2/TestExpectations:
+
2022-04-02 Alan Bujtas
[Ruby] Remove incorrect implicit integral floor in RenderRubyText::adjustInlineDirectionLineBounds
Modified: trunk/LayoutTests/TestExpectations (292273 => 292274)
--- trunk/LayoutTests/TestExpectations 2022-04-03 05:24:35 UTC (rev 292273)
+++ trunk/LayoutTests/TestExpectations 2022-04-03 05:39:31 UTC (rev 292274)
@@ -5204,3 +5204,6 @@
# Only certain ports have WebGPU implementations.
http/tests/webgpu [ Failure ImageOnlyFailure Pass Timeout ]
+
+# Only some ports automatically relayout if a font is installed while the page is open
+fast/text/install-font-style-recalc.html [ Failure ]
Added: trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt (0 => 292274)
--- trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt 2022-04-03 05:39:31 UTC (rev 292274)
@@ -0,0 +1,11 @@
+This test makes sure that installing a font causes a style recalc. The test only runs in DumpRenderTree/WebKitTestRunner. It passes if the text above is rendered as black boxes (aka in Ahem).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS target.offsetWidth became 200
+PASS The font was used.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt
___
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:keywords
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/LayoutTests/fast/text/install-font-style-recalc.html (0 => 292274)
--- trunk/LayoutTests/fast/text/install-font-style-recalc.html (rev 0)
+++ trunk/LayoutTests/fast/text/install-font-style-recalc.html 2022-04-03 05:39:31 UTC (rev 292274)
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+