Title: [272652] trunk
Revision
272652
Author
mmaxfi...@apple.com
Date
2021-02-10 07:44:08 -0800 (Wed, 10 Feb 2021)

Log Message

REGRESSION(r263255): Text styles without an explicit language tag do not honor the system language
https://bugs.webkit.org/show_bug.cgi?id=221598
<rdar://problem/69194294>

Reviewed by Zalan Bujtas.

Source/WebCore:

The distinction between NULL and CFSTR("") strikes again!

Test: fast/text/international/system-language/jp-circled.html

* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createTextStyleFont):

LayoutTests:

* fast/text/international/system-language/jp-circled-expected-mismatch.html: Added.
* fast/text/international/system-language/jp-circled.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (272651 => 272652)


--- trunk/LayoutTests/ChangeLog	2021-02-10 15:19:02 UTC (rev 272651)
+++ trunk/LayoutTests/ChangeLog	2021-02-10 15:44:08 UTC (rev 272652)
@@ -1,3 +1,14 @@
+2021-02-10  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r263255): Text styles without an explicit language tag do not honor the system language
+        https://bugs.webkit.org/show_bug.cgi?id=221598
+        <rdar://problem/69194294>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/international/system-language/jp-circled-expected-mismatch.html: Added.
+        * fast/text/international/system-language/jp-circled.html: Added.
+
 2021-02-10  Manuel Rego Casasnovas  <r...@igalia.com>
 
         Add support for modifier keys in test_driver.send_keys()

Added: trunk/LayoutTests/fast/text/international/system-language/jp-circled-expected-mismatch.html (0 => 272652)


--- trunk/LayoutTests/fast/text/international/system-language/jp-circled-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/international/system-language/jp-circled-expected-mismatch.html	2021-02-10 15:44:08 UTC (rev 272652)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div style="font: -apple-system-body; font-size: 100px;">&#x2460;</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/international/system-language/jp-circled.html (0 => 272652)


--- trunk/LayoutTests/fast/text/international/system-language/jp-circled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/international/system-language/jp-circled.html	2021-02-10 15:44:08 UTC (rev 272652)
@@ -0,0 +1,8 @@
+<!DOCTYPE html><!-- webkit-test-runner [ language=ja ] -->
+<html>
+<head>
+</head>
+<body>
+<div style="font: -apple-system-body; font-size: 100px;">&#x2460;</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (272651 => 272652)


--- trunk/Source/WebCore/ChangeLog	2021-02-10 15:19:02 UTC (rev 272651)
+++ trunk/Source/WebCore/ChangeLog	2021-02-10 15:44:08 UTC (rev 272652)
@@ -1,3 +1,18 @@
+2021-02-10  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r263255): Text styles without an explicit language tag do not honor the system language
+        https://bugs.webkit.org/show_bug.cgi?id=221598
+        <rdar://problem/69194294>
+
+        Reviewed by Zalan Bujtas.
+
+        The distinction between NULL and CFSTR("") strikes again!
+
+        Test: fast/text/international/system-language/jp-circled.html
+
+        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
+        (WebCore::SystemFontDatabaseCoreText::createTextStyleFont):
+
 2021-02-10  Zalan Bujtas  <za...@apple.com>
 
         [LFC][IFC] Pass in sane content width values to InlineContentBreaker

Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp (272651 => 272652)


--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2021-02-10 15:19:02 UTC (rev 272651)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2021-02-10 15:44:08 UTC (rev 272652)
@@ -80,7 +80,8 @@
 
 RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createTextStyleFont(const CascadeListParameters& parameters)
 {
-    auto descriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeCocoa::singleton().contentSizeCategory(), parameters.locale.string().createCFString().get()));
+    RetainPtr<CFStringRef> localeString = parameters.locale.isEmpty() ? nullptr : parameters.locale.string().createCFString();
+    auto descriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeCocoa::singleton().contentSizeCategory(), localeString.get()));
     // FIXME: Use createFontByApplyingWeightWidthItalicsAndFallbackBehavior().
     CTFontSymbolicTraits traits = (parameters.weight >= kCTFontWeightSemibold ? kCTFontTraitBold : 0)
 #if HAVE(LEVEL_2_SYSTEM_FONT_WIDTH_VALUES) || HAVE(LEVEL_3_SYSTEM_FONT_WIDTH_VALUES)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to