<rdar://problem/10674686> Implement the font-kerning CSS property
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2012 08:38:29 +0000 (08:38 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2012 08:38:29 +0000 (08:38 +0000)
commitac641b4057ab9707b4516d7f01f501ae38f3736b
tree077f93925f20271117397d16778f9d5d04dfc728
parent15252aad7887a8589007b0fd97df483e6620d9be
<rdar://problem/10674686> Implement the font-kerning CSS property
https://bugs.webkit.org/show_bug.cgi?id=76033

Reviewed by Darin Adler.

Source/WebCore:

Tests: fast/text/font-kerning-expected.html
       fast/text/font-kerning.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added code to handle
font-kerning.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Ditto.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mapping from FontDescription::Kerning.
(WebCore::CSSPrimitiveValue::operator FontDescription::Kerning): Added mapping to
FontDescription::Kerning.
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Added font-kerning to the set of inherited
properties.
* css/CSSPropertyNames.in: Added -webkit-font-kerning.
* css/CSSStyleApplyProperty.cpp:
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): Added a handler for font-kerning.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyDeclaration): Updated for the number of properties that
affect the font.
* platform/graphics/Font.h:
(WebCore::Font::typesettingFeatures): Changed to enable kerning if font-kerning is set to
normal, disable it if font-kerning is set to none, and leave it to the default (determined
by the text-rendering property) if font-kerning is set to auto.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription): Added a Kerning enum.
(WebCore::FontDescription::kerning): Added this getter.
(WebCore::FontDescription::setKerning): Added this setter.
(WebCore::FontDescription::operator==): Updated to compare the m_kerning member.

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/text/font-kerning-expected.html: Added.
* fast/text/font-kerning.html: Added.
* platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt:
* platform/gtk/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/qt/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/text/font-kerning-expected.html [new file with mode: 0644]
LayoutTests/fast/text/font-kerning.html [new file with mode: 0644]
LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt
LayoutTests/platform/gtk/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/platform/qt/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontDescription.h