font variation properties don't need to accept numbers
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Mar 2017 17:50:33 +0000 (17:50 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Mar 2017 17:50:33 +0000 (17:50 +0000)
commitf2637ece0a9c1f317dc349deb38eff15da087016
treeafb8e8f3d783d4fbafe86c5a9d97d7d1178d111c
parentc093b40a440e606f47b14208aac705f43ef45061
font variation properties don't need to accept numbers
https://bugs.webkit.org/show_bug.cgi?id=169357

Reviewed by Antti Koivisto.

Source/WebCore:

The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
font-style, and font-stretch. The changes are that font-style and
font-stretch no longer accept raw numbers, and the @font-face descriptor
ranges are now separated by spaces instead of slashes.

Tests: fast/text/font-selection-font-face-parse.html
       fast/text/font-selection-font-loading-api-parse.html
       fast/text/font-stretch-parse.html
       fast/text/font-style-parse.html
       fast/text/variations/font-selection-properties.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::fontWeightFromStyle):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::fontStretchFromStyle):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
* css/CSSComputedStyleDeclaration.h:
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
(WebCore::rangeIsSingleValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStretchFromValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):

LayoutTests:

* fast/text/font-selection-font-face-parse-expected.txt:
* fast/text/font-selection-font-face-parse.html:
* fast/text/font-selection-font-loading-api-parse-expected.txt:
* fast/text/font-selection-font-loading-api-parse.html:
* fast/text/font-stretch-parse-expected.txt:
* fast/text/font-stretch-parse.html:
* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* fast/text/variations/font-selection-properties.html:
* platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/font-selection-font-face-parse-expected.txt
LayoutTests/fast/text/font-selection-font-face-parse.html
LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt
LayoutTests/fast/text/font-selection-font-loading-api-parse.html
LayoutTests/fast/text/font-stretch-parse-expected.txt
LayoutTests/fast/text/font-stretch-parse.html
LayoutTests/fast/text/font-style-parse-expected.txt
LayoutTests/fast/text/font-style-parse.html
LayoutTests/fast/text/variations/font-selection-properties.html
LayoutTests/platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.h
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSPropertyParser.cpp