Parse font-display
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2017 00:03:56 +0000 (00:03 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2017 00:03:56 +0000 (00:03 +0000)
commit5c89beb017f7b6a9c4f668655645d2cdf5a81a41
treed6352bad8ac7eaafce86b79e2f3bec6989ceaede
parent79aec7859d7e1a000e5c5738a89340ec63f62e18
Parse font-display
https://bugs.webkit.org/show_bug.cgi?id=175382

Reviewed by Simon Fraser.

Source/WebCore:

The syntax is very simple: font-display: auto | block | swap | fallback | optional.
So, parsing support is quite straightfoward.

Test: fast/text/font-display/parse.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setLoadingBehavior):
* css/CSSFontFace.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isDescriptorOnly):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceFontDisplay):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* fast/text/font-display/parse-expected.txt: Added.
* fast/text/font-display/parse.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/font-display/parse-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/font-display/parse.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFace.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h