haikuwebkit/LayoutTests/css3/font-feature-settings-parsi...

46 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

Parsing CSS3 font-feature-settings property https://bugs.webkit.org/show_bug.cgi?id=63618 Source/WebCore: Introduces CSS3 font-feature-settings property as -webkit-font-feature-settings. This change only contains parsing part. Parsed information are stored in FontDescription class. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. Test: css3/font-feature-settings-parsing.html * CMakeLists.txt: Added FontFeatureValue.{h,cpp} and FontFeatureSettings.{h,cpp}. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added CSSPropertyWebkitFontFeatureSettings. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added parsing code for -webkit-font-feature-settings. (WebCore::CSSParser::parseFontFeatureTag): Added. (WebCore::CSSParser::parseFontFeatureSettings): Added. * css/CSSParser.h: Added parseFontFeatureSettings(). * css/CSSPropertyNames.in: Added -webkit-font-feature-settings. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyDeclarations): Modified a compile assert to follow adding -webkit-font-feature-settings. (WebCore::CSSStyleSelector::applyProperty): Added a case clause for CSSPropertyWebkitFontFeatureSettings. * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue): Added. * css/CSSValueKeywords.in: Added 'on' and 'off' keywords. * css/FontFeatureValue.cpp: Added. (WebCore::FontFeatureValue::FontFeatureValue): (WebCore::FontFeatureValue::value): (WebCore::FontFeatureValue::cssText): * css/FontFeatureValue.h: Added. (WebCore::FontFeatureValue::create): (WebCore::FontFeatureValue::tag): (WebCore::FontFeatureValue::isFontFeatureValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::makeNormalFeatureSettings): Added. * platform/graphics/FontDescription.h: (WebCore::FontDescription::FontDescription): Added m_featureSettings member variable. (WebCore::FontDescription::featureSettings): Added. (WebCore::FontDescription::setFeatureSettings): Added. (WebCore::FontDescription::operator==): Modified to take into account m_featureSettings * platform/graphics/FontFeatureSettings.cpp: Added. (WebCore::FontFeature::FontFeature): (WebCore::FontFeature::operator=): (WebCore::FontFeature::operator==): (WebCore::FontFeatureSettings::FontFeatureSettings): * platform/graphics/FontFeatureSettings.h: Added. (WebCore::FontFeature::tag): (WebCore::FontFeature::value): (WebCore::FontFeatureSettings::create): (WebCore::FontFeatureSettings::append): (WebCore::FontFeatureSettings::size): (WebCore::FontFeatureSettings::operator[]): (WebCore::FontFeatureSettings::at): LayoutTests: Add parsing test case for -webkit-font-feature-settings property. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. * css3/font-feature-settings-parsing-expected.txt: Added. * css3/font-feature-settings-parsing.html: Added. Canonical link: https://commits.webkit.org/81576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-08-05 07:34:58 +00:00
Test parsing of the CSS3 font-feature-settings property.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
- Tests valid inputs.
PASS canonicalize(parseResultOf("valid_normal")) is "normal"
PASS canonicalize(parseResultOf("valid_value_1")) is "\"dlig\""
PASS canonicalize(parseResultOf("valid_value_2")) is "\"swsh\" 2"
PASS canonicalize(parseResultOf("valid_value_on")) is "\"smcp\""
PASS canonicalize(parseResultOf("valid_value_off")) is "\"liga\" 0"
PASS canonicalize(parseResultOf("valid_value_omit")) is "\"c2sc\""
PASS canonicalize(parseResultOf("valid_valuelist")) is "\"hist\", \"tnum\""
PASS canonicalize(parseResultOf("valid_singlequote")) is "\"pkrn\""
PASS canonicalize(parseResultOf("valid_unusual_tag")) is "\"!@#$\""
PASS canonicalize(parseResultOf("valid_tag_space")) is "\"a bc\""
PASS canonicalize(parseResultOf("valid_composite")) is "\"dlig\", \"lig \" 0, \"smcp\""
Parsing CSS3 font-feature-settings property https://bugs.webkit.org/show_bug.cgi?id=63618 Source/WebCore: Introduces CSS3 font-feature-settings property as -webkit-font-feature-settings. This change only contains parsing part. Parsed information are stored in FontDescription class. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. Test: css3/font-feature-settings-parsing.html * CMakeLists.txt: Added FontFeatureValue.{h,cpp} and FontFeatureSettings.{h,cpp}. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added CSSPropertyWebkitFontFeatureSettings. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added parsing code for -webkit-font-feature-settings. (WebCore::CSSParser::parseFontFeatureTag): Added. (WebCore::CSSParser::parseFontFeatureSettings): Added. * css/CSSParser.h: Added parseFontFeatureSettings(). * css/CSSPropertyNames.in: Added -webkit-font-feature-settings. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyDeclarations): Modified a compile assert to follow adding -webkit-font-feature-settings. (WebCore::CSSStyleSelector::applyProperty): Added a case clause for CSSPropertyWebkitFontFeatureSettings. * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue): Added. * css/CSSValueKeywords.in: Added 'on' and 'off' keywords. * css/FontFeatureValue.cpp: Added. (WebCore::FontFeatureValue::FontFeatureValue): (WebCore::FontFeatureValue::value): (WebCore::FontFeatureValue::cssText): * css/FontFeatureValue.h: Added. (WebCore::FontFeatureValue::create): (WebCore::FontFeatureValue::tag): (WebCore::FontFeatureValue::isFontFeatureValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::makeNormalFeatureSettings): Added. * platform/graphics/FontDescription.h: (WebCore::FontDescription::FontDescription): Added m_featureSettings member variable. (WebCore::FontDescription::featureSettings): Added. (WebCore::FontDescription::setFeatureSettings): Added. (WebCore::FontDescription::operator==): Modified to take into account m_featureSettings * platform/graphics/FontFeatureSettings.cpp: Added. (WebCore::FontFeature::FontFeature): (WebCore::FontFeature::operator=): (WebCore::FontFeature::operator==): (WebCore::FontFeatureSettings::FontFeatureSettings): * platform/graphics/FontFeatureSettings.h: Added. (WebCore::FontFeature::tag): (WebCore::FontFeature::value): (WebCore::FontFeatureSettings::create): (WebCore::FontFeatureSettings::append): (WebCore::FontFeatureSettings::size): (WebCore::FontFeatureSettings::operator[]): (WebCore::FontFeatureSettings::at): LayoutTests: Add parsing test case for -webkit-font-feature-settings property. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. * css3/font-feature-settings-parsing-expected.txt: Added. * css3/font-feature-settings-parsing.html: Added. Canonical link: https://commits.webkit.org/81576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-08-05 07:34:58 +00:00
- Tests invalid inputs. Results should be "normal".
PASS parseResultOf("invalid_ident") is "normal"
PASS parseResultOf("invalid_cases") is "normal"
Parsing CSS3 font-feature-settings property https://bugs.webkit.org/show_bug.cgi?id=63618 Source/WebCore: Introduces CSS3 font-feature-settings property as -webkit-font-feature-settings. This change only contains parsing part. Parsed information are stored in FontDescription class. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. Test: css3/font-feature-settings-parsing.html * CMakeLists.txt: Added FontFeatureValue.{h,cpp} and FontFeatureSettings.{h,cpp}. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added CSSPropertyWebkitFontFeatureSettings. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added parsing code for -webkit-font-feature-settings. (WebCore::CSSParser::parseFontFeatureTag): Added. (WebCore::CSSParser::parseFontFeatureSettings): Added. * css/CSSParser.h: Added parseFontFeatureSettings(). * css/CSSPropertyNames.in: Added -webkit-font-feature-settings. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyDeclarations): Modified a compile assert to follow adding -webkit-font-feature-settings. (WebCore::CSSStyleSelector::applyProperty): Added a case clause for CSSPropertyWebkitFontFeatureSettings. * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue): Added. * css/CSSValueKeywords.in: Added 'on' and 'off' keywords. * css/FontFeatureValue.cpp: Added. (WebCore::FontFeatureValue::FontFeatureValue): (WebCore::FontFeatureValue::value): (WebCore::FontFeatureValue::cssText): * css/FontFeatureValue.h: Added. (WebCore::FontFeatureValue::create): (WebCore::FontFeatureValue::tag): (WebCore::FontFeatureValue::isFontFeatureValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::makeNormalFeatureSettings): Added. * platform/graphics/FontDescription.h: (WebCore::FontDescription::FontDescription): Added m_featureSettings member variable. (WebCore::FontDescription::featureSettings): Added. (WebCore::FontDescription::setFeatureSettings): Added. (WebCore::FontDescription::operator==): Modified to take into account m_featureSettings * platform/graphics/FontFeatureSettings.cpp: Added. (WebCore::FontFeature::FontFeature): (WebCore::FontFeature::operator=): (WebCore::FontFeature::operator==): (WebCore::FontFeatureSettings::FontFeatureSettings): * platform/graphics/FontFeatureSettings.h: Added. (WebCore::FontFeature::tag): (WebCore::FontFeature::value): (WebCore::FontFeatureSettings::create): (WebCore::FontFeatureSettings::append): (WebCore::FontFeatureSettings::size): (WebCore::FontFeatureSettings::operator[]): (WebCore::FontFeatureSettings::at): LayoutTests: Add parsing test case for -webkit-font-feature-settings property. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. * css3/font-feature-settings-parsing-expected.txt: Added. * css3/font-feature-settings-parsing.html: Added. Canonical link: https://commits.webkit.org/81576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-08-05 07:34:58 +00:00
PASS parseResultOf("invalid_1") is "normal"
PASS parseResultOf("invalid_off") is "normal"
PASS parseResultOf("invalid_normal_duplicate") is "normal"
PASS parseResultOf("invalid_normal_list") is "normal"
PASS parseResultOf("invalid_longer_ident") is "normal"
PASS parseResultOf("invalid_longer_quote") is "normal"
PASS parseResultOf("invalid_negative") is "normal"
PASS parseResultOf("invalid_float") is "normal"
PASS parseResultOf("invalid_missing_comma") is "normal"
PASS parseResultOf("invalid_missing_comma_ident") is "normal"
PASS parseResultOf("invalid_comma") is "normal"
PASS parseResultOf("invalid_ending_comma") is "normal"
PASS parseResultOf("invalid_beginning_comma") is "normal"
PASS parseResultOf("invalid_on") is "normal"
PASS parseResultOf("invalid_0") is "normal"
- Tests inherit.
PASS canonicalize(parseResultOf("outer")) is "\"dlig\""
PASS canonicalize(parseResultOf("inner")) is "\"dlig\""
Parsing CSS3 font-feature-settings property https://bugs.webkit.org/show_bug.cgi?id=63618 Source/WebCore: Introduces CSS3 font-feature-settings property as -webkit-font-feature-settings. This change only contains parsing part. Parsed information are stored in FontDescription class. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. Test: css3/font-feature-settings-parsing.html * CMakeLists.txt: Added FontFeatureValue.{h,cpp} and FontFeatureSettings.{h,cpp}. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added CSSPropertyWebkitFontFeatureSettings. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added parsing code for -webkit-font-feature-settings. (WebCore::CSSParser::parseFontFeatureTag): Added. (WebCore::CSSParser::parseFontFeatureSettings): Added. * css/CSSParser.h: Added parseFontFeatureSettings(). * css/CSSPropertyNames.in: Added -webkit-font-feature-settings. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyDeclarations): Modified a compile assert to follow adding -webkit-font-feature-settings. (WebCore::CSSStyleSelector::applyProperty): Added a case clause for CSSPropertyWebkitFontFeatureSettings. * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue): Added. * css/CSSValueKeywords.in: Added 'on' and 'off' keywords. * css/FontFeatureValue.cpp: Added. (WebCore::FontFeatureValue::FontFeatureValue): (WebCore::FontFeatureValue::value): (WebCore::FontFeatureValue::cssText): * css/FontFeatureValue.h: Added. (WebCore::FontFeatureValue::create): (WebCore::FontFeatureValue::tag): (WebCore::FontFeatureValue::isFontFeatureValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::makeNormalFeatureSettings): Added. * platform/graphics/FontDescription.h: (WebCore::FontDescription::FontDescription): Added m_featureSettings member variable. (WebCore::FontDescription::featureSettings): Added. (WebCore::FontDescription::setFeatureSettings): Added. (WebCore::FontDescription::operator==): Modified to take into account m_featureSettings * platform/graphics/FontFeatureSettings.cpp: Added. (WebCore::FontFeature::FontFeature): (WebCore::FontFeature::operator=): (WebCore::FontFeature::operator==): (WebCore::FontFeatureSettings::FontFeatureSettings): * platform/graphics/FontFeatureSettings.h: Added. (WebCore::FontFeature::tag): (WebCore::FontFeature::value): (WebCore::FontFeatureSettings::create): (WebCore::FontFeatureSettings::append): (WebCore::FontFeatureSettings::size): (WebCore::FontFeatureSettings::operator[]): (WebCore::FontFeatureSettings::at): LayoutTests: Add parsing test case for -webkit-font-feature-settings property. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. * css3/font-feature-settings-parsing-expected.txt: Added. * css3/font-feature-settings-parsing.html: Added. Canonical link: https://commits.webkit.org/81576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-08-05 07:34:58 +00:00
- Tests @font-face.
PASS canonicalize(fontFaceRuleValid) is "\"liga\""
Parsing CSS3 font-feature-settings property https://bugs.webkit.org/show_bug.cgi?id=63618 Source/WebCore: Introduces CSS3 font-feature-settings property as -webkit-font-feature-settings. This change only contains parsing part. Parsed information are stored in FontDescription class. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. Test: css3/font-feature-settings-parsing.html * CMakeLists.txt: Added FontFeatureValue.{h,cpp} and FontFeatureSettings.{h,cpp}. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added CSSPropertyWebkitFontFeatureSettings. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Added parsing code for -webkit-font-feature-settings. (WebCore::CSSParser::parseFontFeatureTag): Added. (WebCore::CSSParser::parseFontFeatureSettings): Added. * css/CSSParser.h: Added parseFontFeatureSettings(). * css/CSSPropertyNames.in: Added -webkit-font-feature-settings. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyDeclarations): Modified a compile assert to follow adding -webkit-font-feature-settings. (WebCore::CSSStyleSelector::applyProperty): Added a case clause for CSSPropertyWebkitFontFeatureSettings. * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue): Added. * css/CSSValueKeywords.in: Added 'on' and 'off' keywords. * css/FontFeatureValue.cpp: Added. (WebCore::FontFeatureValue::FontFeatureValue): (WebCore::FontFeatureValue::value): (WebCore::FontFeatureValue::cssText): * css/FontFeatureValue.h: Added. (WebCore::FontFeatureValue::create): (WebCore::FontFeatureValue::tag): (WebCore::FontFeatureValue::isFontFeatureValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::makeNormalFeatureSettings): Added. * platform/graphics/FontDescription.h: (WebCore::FontDescription::FontDescription): Added m_featureSettings member variable. (WebCore::FontDescription::featureSettings): Added. (WebCore::FontDescription::setFeatureSettings): Added. (WebCore::FontDescription::operator==): Modified to take into account m_featureSettings * platform/graphics/FontFeatureSettings.cpp: Added. (WebCore::FontFeature::FontFeature): (WebCore::FontFeature::operator=): (WebCore::FontFeature::operator==): (WebCore::FontFeatureSettings::FontFeatureSettings): * platform/graphics/FontFeatureSettings.h: Added. (WebCore::FontFeature::tag): (WebCore::FontFeature::value): (WebCore::FontFeatureSettings::create): (WebCore::FontFeatureSettings::append): (WebCore::FontFeatureSettings::size): (WebCore::FontFeatureSettings::operator[]): (WebCore::FontFeatureSettings::at): LayoutTests: Add parsing test case for -webkit-font-feature-settings property. Patch by Kenichi Ishibashi <bashi@chromium.org> on 2011-08-05 Reviewed by Shinichiro Hamaji. * css3/font-feature-settings-parsing-expected.txt: Added. * css3/font-feature-settings-parsing.html: Added. Canonical link: https://commits.webkit.org/81576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-08-05 07:34:58 +00:00
PASS fontFaceRuleInvalid is ""
PASS successfullyParsed is true
TEST COMPLETE