New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts] Add parsing tests for font-palette #30845
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drott
approved these changes
Sep 17, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
webkit-commit-queue
pushed a commit
to WebKit/WebKit
that referenced
this pull request
Sep 22, 2021
https://bugs.webkit.org/show_bug.cgi?id=230394 Reviewed by Simon Fraser. LayoutTests/imported/w3c: This is being upstreamed at web-platform-tests/wpt#30845. * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-computed.html: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-valid.html: Added. * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt: Source/WebCore: This is a pretty straightforward parsing patch. The grammar is just font-palette: none | normal | light | dark | <palette-identifier>. A <palette-identifier> is a <custom-ident>. There is a choice to make about how to represent the parsed data: Option 1: class None {}; class Normal {}; class Light {}; class Dark {}; class Custom { String value; }; using FontPalette = Variant<None, Normal, Light, Dark, Custom>; or, Option 2: struct FontPalette { enum class Type { None, Normal, Light, Dark, Custom } type; String value; }; Upon advice from a trusted colleague, I chose option 2. I'm implementing parsing support for @font-palette-values in https://bugs.webkit.org/show_bug.cgi?id=230337. Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::fontPaletteFromStyle): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontPalette): (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKeyRareData::create): (WebCore::FontDescriptionKeyRareData::featureSettings const): (WebCore::FontDescriptionKeyRareData::variationSettings const): (WebCore::FontDescriptionKeyRareData::fontPalette const): (WebCore::FontDescriptionKeyRareData::operator== const): (WebCore::FontDescriptionKeyRareData::FontDescriptionKeyRareData): (WebCore::add): (WebCore::FontDescriptionKey::FontDescriptionKey): (WebCore::FontDescriptionKey::operator== const): * platform/graphics/FontCascadeDescription.cpp: * platform/graphics/FontCascadeDescription.h: (WebCore::FontCascadeDescription::initialFontPalette): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::FontDescription): * platform/graphics/FontDescription.h: (WebCore::FontDescription::fontPalette const): (WebCore::FontDescription::setFontPalette): (WebCore::FontDescription::operator== const): (WebCore::FontDescription::encode const): (WebCore::FontDescription::decode): * platform/graphics/FontPalette.h: Added. (WebCore::FontPaletteNone::operator== const): (WebCore::FontPaletteNone::operator!= const): (WebCore::add): (WebCore::FontPaletteNormal::operator== const): (WebCore::FontPaletteNormal::operator!= const): (WebCore::FontPaletteLight::operator== const): (WebCore::FontPaletteLight::operator!= const): (WebCore::FontPaletteDark::operator== const): (WebCore::FontPaletteDark::operator!= const): (WebCore::FontPaletteCustom::operator== const): (WebCore::FontPaletteCustom::operator!= const): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertFontPalette): LayoutTests: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt: Canonical link: https://commits.webkit.org/241982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
bertogg
pushed a commit
to Igalia/webkit
that referenced
this pull request
Sep 22, 2021
https://bugs.webkit.org/show_bug.cgi?id=230394 Reviewed by Simon Fraser. LayoutTests/imported/w3c: This is being upstreamed at web-platform-tests/wpt#30845. * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-computed.html: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt: Added. * web-platform-tests/css/css-fonts/parsing/font-palette-valid.html: Added. * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt: Source/WebCore: This is a pretty straightforward parsing patch. The grammar is just font-palette: none | normal | light | dark | <palette-identifier>. A <palette-identifier> is a <custom-ident>. There is a choice to make about how to represent the parsed data: Option 1: class None {}; class Normal {}; class Light {}; class Dark {}; class Custom { String value; }; using FontPalette = Variant<None, Normal, Light, Dark, Custom>; or, Option 2: struct FontPalette { enum class Type { None, Normal, Light, Dark, Custom } type; String value; }; Upon advice from a trusted colleague, I chose option 2. I'm implementing parsing support for @font-palette-values in https://bugs.webkit.org/show_bug.cgi?id=230337. Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::fontPaletteFromStyle): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontPalette): (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKeyRareData::create): (WebCore::FontDescriptionKeyRareData::featureSettings const): (WebCore::FontDescriptionKeyRareData::variationSettings const): (WebCore::FontDescriptionKeyRareData::fontPalette const): (WebCore::FontDescriptionKeyRareData::operator== const): (WebCore::FontDescriptionKeyRareData::FontDescriptionKeyRareData): (WebCore::add): (WebCore::FontDescriptionKey::FontDescriptionKey): (WebCore::FontDescriptionKey::operator== const): * platform/graphics/FontCascadeDescription.cpp: * platform/graphics/FontCascadeDescription.h: (WebCore::FontCascadeDescription::initialFontPalette): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::FontDescription): * platform/graphics/FontDescription.h: (WebCore::FontDescription::fontPalette const): (WebCore::FontDescription::setFontPalette): (WebCore::FontDescription::operator== const): (WebCore::FontDescription::encode const): (WebCore::FontDescription::decode): * platform/graphics/FontPalette.h: Added. (WebCore::FontPaletteNone::operator== const): (WebCore::FontPaletteNone::operator!= const): (WebCore::add): (WebCore::FontPaletteNormal::operator== const): (WebCore::FontPaletteNormal::operator!= const): (WebCore::FontPaletteLight::operator== const): (WebCore::FontPaletteLight::operator!= const): (WebCore::FontPaletteDark::operator== const): (WebCore::FontPaletteDark::operator!= const): (WebCore::FontPaletteCustom::operator== const): (WebCore::FontPaletteCustom::operator!= const): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertFontPalette): LayoutTests: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt: * platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt: * platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@282851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gabisampaio
pushed a commit
to Gabisampaio/wpt
that referenced
this pull request
Nov 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're starting to implement this in WebKit.