Skip to content
Permalink
Browse files
[Regression] Webkit "-apple-system" font fallback token handles font …
…weights of PingFang incorrectly.

https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Reviewed by Jon Lee.

Source/WebCore:

This bug has a fairly insideous cause. In particular, the system font fallback path follows
system conventions, which are not the same as the CSS fallback path. For example, the Chinese
fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
and expected, and we shouldn't synthesize bold in this situation.

Test: fast/text/system-ui-chinese-bold-fallback.html

* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges const):

LayoutTests:

* fast/text/system-ui-chinese-bold-fallback.html:


Canonical link: https://commits.webkit.org/194649@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
litherum committed Oct 18, 2017
1 parent e4f08b1 commit b17a107d56ebf8f6344473290ccc146a31e557e3
Showing 5 changed files with 50 additions and 1 deletion.
@@ -1,3 +1,13 @@
2017-10-17 Myles C. Maxfield <mmaxfield@apple.com>

[Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Reviewed by Jon Lee.

* fast/text/system-ui-chinese-bold-fallback.html:

2017-10-17 Dean Jackson <dino@apple.com>

webgl/1.0.2/conformance/canvas/drawingbuffer-static-canvas-test.html failing
@@ -1,3 +1,24 @@
2017-10-17 Myles C. Maxfield <mmaxfield@apple.com>

[Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Reviewed by Jon Lee.

This bug has a fairly insideous cause. In particular, the system font fallback path follows
system conventions, which are not the same as the CSS fallback path. For example, the Chinese
fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
and expected, and we shouldn't synthesize bold in this situation.

Test: fast/text/system-ui-chinese-bold-fallback.html

* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges const):

2017-10-17 Chelsea Pugh <cpugh@apple.com>

[iOS] Don't turn fields yellow after filling credentials
@@ -60,7 +60,7 @@ FontRanges FontFamilySpecificationCoreText::fontRanges(const FontDescription& fo
bool syntheticBold, syntheticOblique;
std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair();

FontPlatformData fontPlatformData(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
FontPlatformData fontPlatformData(font.get(), size, false, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());

return FontRanges(FontCache::singleton().fontForPlatformData(fontPlatformData));
}
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
This makes sure that drawing Chinese characters in a weight 600 system font doesn't cause synthetic bold.
<div style="font: 600 16px system-ui; font-synthesis: none;">&#x4eca;</div>
</body>
</html>
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
This makes sure that drawing Chinese characters in a weight 600 system font doesn't cause synthetic bold.
<div style="font: 600 16px system-ui;">&#x4eca;</div>
</body>
</html>

0 comments on commit b17a107

Please sign in to comment.