[iOS] Cannot italicize or bold text rendered with text styles
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jun 2017 02:46:11 +0000 (02:46 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jun 2017 02:46:11 +0000 (02:46 +0000)
commitd1403a8b41a028ee775374d20e806977a9787d4e
tree9afe3515a0a044b1f6267734170f425fb46160f0
parentb69094d79b5127a9de92aec4cef48c5ea3f6b724
[iOS] Cannot italicize or bold text rendered with text styles
https://bugs.webkit.org/show_bug.cgi?id=173634

Reviewed by Darin Adler.

Source/WebCore:

r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
This patch migrates the named text styles to this new codepath.

Test: fast/text/ipad/bold-tall-body-text-style.html

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::convertArray):
(WebCore::convertArray):
(WebCore::makeNeverDestroyed):
(WebCore::isUIFontTextStyle):
(WebCore::systemFontParameters):
(WebCore::FontCascadeDescription::effectiveFamilyCount):
(WebCore::FontCascadeDescription::effectiveFamilyAt):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal): Deleted.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html: Added.
* fast/text/ipad/bold-tall-body-text-style.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html [new file with mode: 0644]
LayoutTests/fast/text/ipad/bold-tall-body-text-style.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm