If @font-face does not provide an explicit italic/bold variant, regular is used.
authorbashi@chromium.org <bashi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 00:43:27 +0000 (00:43 +0000)
committerbashi@chromium.org <bashi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 00:43:27 +0000 (00:43 +0000)
commite3b4e2802212fb5417040dab0eade5f0a8a41294
tree0b660f19a75fb87e1f954bc3c51ecc0bbd85bd56
parent408fe837fbff26b96b25cc6684b8fa51582cb624
If @font-face does not provide an explicit italic/bold variant, regular is used.
https://bugs.webkit.org/show_bug.cgi?id=34147

Reviewed by Dan Bernstein.

Source/WebCore:

Update @font-face handling code so that it matches @font-face behavior to the current draft of CSS3 Font spec. The original patch was written by yusukes@chromium.org.
- Drops support for "bolder", "lighter", and "all" value. These are no longer allowed.
- Only allows one value for font-style and font-weight.

Tests: fast/css/font-face-synthetic-bold-italic.html
       fast/css/font-face-weight-matching.html

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Removed "all", "lighter", "bolder" handling code.
(WebCore::compareFontFaces):Updated the weight matching algortihm.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Replaced parseFontStyle() call with checking primitive values.
(WebCore::CSSParser::parseFontWeight): Changed to allow only primitive values.
(WebCore::CSSParser::createFontFaceRule): Removed checks for font-weight and font-style.
(WebCore::CSSParser::deleteFontFaceOnlyValues): Ditto.
* css/CSSParser.h: Removed parseFontStyle().

LayoutTests:

Added two tests to make sure font matching algorithm matches the current draft of CSS Fonts Module Level 3, and removed a test which uses obsoleted 'all' value for font-weight and font-style.

* fast/css/font-face-descriptor-multiple-values-parsing-expected.txt: Removed.
* fast/css/font-face-descriptor-multiple-values-parsing.html: Removed.
* fast/css/font-face-synthetic-bold-italic.html: Added.
* fast/css/font-face-weight-matching.html: Added.
* platform/chromium/test_expectations.txt: Needs rebaselines.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/font-face-descriptor-multiple-values-parsing-expected.txt [deleted file]
LayoutTests/fast/css/font-face-descriptor-multiple-values-parsing.html [deleted file]
LayoutTests/fast/css/font-face-synthetic-bold-italic.html [new file with mode: 0644]
LayoutTests/fast/css/font-face-weight-matching.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h