[Regression] Webkit "-apple-system" font fallback token handles font weights of PingF...
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2017 00:34:23 +0000 (00:34 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2017 00:34:23 +0000 (00:34 +0000)
commit6b170208cce49f5ed764236a76ed36d2ff0563b2
treeed0f0f0ae12d82a7ad1d98f355612c4bc02f6cd1
parentf34be2bfa2ef0cdffea154b082b84ac2710300c9
[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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
fast/text/system-ui-chinese-bold-fallback-expected.html [new file with mode: 0644]
fast/text/system-ui-chinese-bold-fallback.html [new file with mode: 0644]