Implement font-optical-sizing
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Mar 2017 19:01:54 +0000 (19:01 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Mar 2017 19:01:54 +0000 (19:01 +0000)
commit7eb86e9993b3490bb3a49b1acdadd17d90c52d6a
tree2f83beca11fef5efca73efd8afb66d0226fc60d2
parentc6f5ac57fff46dd14fa251ae4ebfa2381d056c33
Implement font-optical-sizing
https://bugs.webkit.org/show_bug.cgi?id=168895

Reviewed by Dean Jackson.

Source/WebCore:

Upon advice from Microsoft, the only input to optical sizing is just the
font-size computed value. It is implemented by setting the 'opsz' font
variation axis. Because the propery has such a simple grammar, the
implementation is quite straightforward.

Test: fast/text/variations/optical-sizing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontOpticalSizing):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::opticalSizing):
(WebCore::FontDescription::setOpticalSizing):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialOpticalSizing):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/text/TextFlags.h:

LayoutTests:

* fast/text/variations/optical-sizing-expected.txt: Added.
* fast/text/variations/optical-sizing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/variations/optical-sizing-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/variations/optical-sizing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebCore/platform/text/TextFlags.h
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js