<rdar://problem/10679035> Implement font-variant-ligatures: {no-}common-ligatures
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2012 04:10:01 +0000 (04:10 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2012 04:10:01 +0000 (04:10 +0000)
commit8750641a92f65ad90dcba1a715b9c2a29f474392
tree6ae9719a5ded44bdd25ed8cc998dc89e5f20b5aa
parent5b40b41bcbdb3f5e10f249cde413ef7c7eb2009f
<rdar://problem/10679035> Implement font-variant-ligatures: {no-}common-ligatures
https://bugs.webkit.org/show_bug.cgi?id=76103

Reviewed by Sam Weinig.

Source/WebCore:

Tests: fast/css/parsing-font-variant-ligatures.html
       fast/text/font-variant-ligatures-expected.html
       fast/text/font-variant-ligatures.html

Added support for all font-variant-ligatures values in the style system and in
FontDescription, and made the {no-}common-ligatures value keywords control basic ligatures.
The {no-}{discretionary,historical}-ligatures keywords have no effect on rendering at this
time.

font-variant-ligatures was not made part of the font shorthand property.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added code to handle
font-variant-ligatures.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Added code to handle font-variant-ligatures.
(WebCore::CSSParser::parseFontVariantLigatures): Added. Parses font-variant-ligatures.
* css/CSSParser.h:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Added font-variant-ligatures to the set of
inherited properties.
* css/CSSPropertyNames.in: Added -webkit-font-variant-ligatures.
* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyFontVariantLigatures::applyInheritValue): Added. Copies
{common,discretionary,historical}LigaturesState from the parent style font description.
(WebCore::ApplyPropertyFontVariantLigatures::applyInitialValue): Added. Sets
{common,discretionary,historical}LigaturesState to normal.
(WebCore::ApplyPropertyFontVariantLigatures::applyValue): Added.
(WebCore::ApplyPropertyFontVariantLigatures::createHandler): Added.
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): Added a handler for
font-variant-ligatures.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyDeclaration): Updated for the number of properties that
affect the font.
(WebCore::CSSStyleSelector::applyProperty): Added CSSPropertyWebkitFontVariantLigatures to
the switch statement, which needs to list all values in SVG-disabled builds.
* css/CSSValueKeywords.in: Added the value keywords
{no-}{common,discretionary,historical}-ligatures.
* platform/graphics/Font.h:
(WebCore::Font::typesettingFeatures): Changed to enable ligatures if common ligatures are
enabled in the font description, disable them if they are disabled, and leave them to the
default (determined by the text-rendering property) if they are in the normal state.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription): Added initializers.
(WebCore::FontDescription::commonLigaturesState): Added this accessor.
(WebCore::FontDescription::discretionaryLigaturesState): Ditto.
(WebCore::FontDescription::historicalLigaturesState): Ditto.
(WebCore::FontDescription::setCommonLigaturesState): Ditto.
(WebCore::FontDescription::setDiscretionaryLigaturesState): Ditto.
(WebCore::FontDescription::setHistoricalLigaturesState): Ditto.
(WebCore::FontDescription::operator==): Updated to compare the ligatures state members.

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/parsing-font-variant-ligatures.html: Added.
* fast/text/font-variant-ligatures-expected.html: Added.
* fast/text/font-variant-ligatures.html: Added.
* platform/chromium-mac-snowleopard/svg/css/getComputedStyle-basic-expected.txt:
* platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt:
* 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@104786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/fast/css/parsing-font-variant-ligatures.html [new file with mode: 0644]
LayoutTests/fast/text/font-variant-ligatures-expected.html [new file with mode: 0644]
LayoutTests/fast/text/font-variant-ligatures.html [new file with mode: 0644]
LayoutTests/platform/chromium-mac-snowleopard/svg/css/getComputedStyle-basic-expected.txt
LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt
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
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontDescription.h