Update font selection algorithm to match latest CSS spec
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Sep 2017 19:57:08 +0000 (19:57 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Sep 2017 19:57:08 +0000 (19:57 +0000)
commit030ec9c4d3ca08cbcd70668f1ea456a9afa9c0a7
tree8c8cbfe0e7692a1169812c74c202debd0309e8f4
parent586cf2312bcab03075e9f9489a882adcdc03eede
Update font selection algorithm to match latest CSS spec
https://bugs.webkit.org/show_bug.cgi?id=175236

Reviewed by Darin Adler.

Source/WebCore:

The CSS WG tweaked the generalization of the font selection
algorithm between levels 3 and 4. In particular, the behavior
of weights between 400 and 500 works a little differently.

https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827

Test: fast/text/variations/font-selection-font-weight.html

* platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::weightDistance const):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::lowerWeightSearchThreshold):
(WebCore::upperWeightSearchThreshold):
(WebCore::weightSearchThreshold): Deleted.

LayoutTests:

* fast/text/variations/font-selection-font-weight-expected.html: Added.
* fast/text/variations/font-selection-font-weight.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/variations/font-selection-font-weight-expected.html [new file with mode: 0644]
LayoutTests/fast/text/variations/font-selection-font-weight.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp
Source/WebCore/platform/graphics/FontSelectionAlgorithm.h