Title: [295250] trunk
Revision
295250
Author
mmaxfi...@apple.com
Date
2022-06-03 16:45:34 -0700 (Fri, 03 Jun 2022)

Log Message

[Cocoa] Mail compose doesn't use Bulgarian letter forms when the system language is set to Bulgarian
https://bugs.webkit.org/show_bug.cgi?id=241253
<rdar://problem/94295531>

Reviewed by Cameron McCormack.

Mail compose doesn't set `lang`, which causes us to have a null locale string.
String::createCFString() transforms a null string to CFSTR(""), which indicates to Core Text
that it shouldn't use the shaping from the system language. Instead, if the locale string
is null, we should give Core Text a null locale string, so they use the correct shaping.

* LayoutTests/TestExpectations:
* LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html: Added.
* LayoutTests/fast/text/bulgarian-system-language-shaping.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:
(WebCore::Font::applyTransforms const):

Canonical link: https://commits.webkit.org/251298@main

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/TestExpectations (295249 => 295250)


--- trunk/LayoutTests/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -5291,3 +5291,6 @@
 
 # Image controls menu is mac only.
 fast/attachment/attachment-image-controls-basic.html [ Skip ]
+
+# This test requires a system font that has Bulgarian-specific shaping.
+fast/text/bulgarian-system-language-shaping.html [ ImageOnlyFailure ]

Added: trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html (0 => 295250)


--- trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html	2022-06-03 23:45:34 UTC (rev 295250)
@@ -0,0 +1,8 @@
+<!DOCTYPE html><!-- webkit-test-runner [ language=ru ] -->
+<html>
+<head>
+</head>
+<body>
+<div style="font: 48px system-ui;">&#x0433;&#x0433;&#x0433;&#x0433;</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html (0 => 295250)


--- trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html	2022-06-03 23:45:34 UTC (rev 295250)
@@ -0,0 +1,8 @@
+<!DOCTYPE html><!-- webkit-test-runner [ language=bg ] -->
+<html>
+<head>
+</head>
+<body>
+<div style="font: 48px system-ui;">&#x0433;&#x0433;&#x0433;&#x0433;</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios/TestExpectations (295249 => 295250)


--- trunk/LayoutTests/platform/ios/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -3648,4 +3648,6 @@
 webkit.org/b/241048 imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video.html [ Failure ] 
 webkit.org/b/241048 imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-video.html [ Failure ] 
 
-webkit.org/b/241205 fast/forms/textfield-outline.html [ Pass Failure ]
\ No newline at end of file
+webkit.org/b/241205 fast/forms/textfield-outline.html [ Pass Failure ]
+
+fast/text/bulgarian-system-language-shaping.html [ Pass ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (295249 => 295250)


--- trunk/LayoutTests/platform/mac/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -2302,3 +2302,5 @@
 webkit.org/b/227845 [ Debug ] webaudio/audioworket-out-of-memory.html [ Pass Timeout DumpJSConsoleLogInStdErr ]
 
 webkit.org/b/240989 http/tests/media/hls/hls-webvtt-flashing.html [ Pass Failure ]
+
+[ Monterey+ ] fast/text/bulgarian-system-language-shaping.html [ Pass ]

Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp (295249 => 295250)


--- trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2022-06-03 23:45:34 UTC (rev 295250)
@@ -619,7 +619,7 @@
 
     auto substring = text.substring(beginningStringIndex);
     auto upconvertedCharacters = substring.upconvertedCharacters();
-    auto localeString = LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString();
+    auto localeString = locale.isNull() ? nullptr : LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString();
     auto numberOfInputGlyphs = glyphBuffer.size() - beginningGlyphIndex;
     // FIXME: Enable kerning for single glyphs when rdar://82195405 is fixed
     CTFontShapeOptions options = kCTFontShapeWithClusterComposition
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to