Skip to content
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 rendering tests for font palettes #31044

Merged

Conversation

litherum
Copy link
Contributor

@litherum litherum commented Sep 30, 2021

This is an export of https://bugs.webkit.org/show_bug.cgi?id=230792.

I didn't test the <string> value for base-palette or override-colors
because w3c/csswg-drafts#6627 isn't resolved
yet.

The test font included in this patch doesn't have any named palettes
or colors because I currently don't have any way of testing that
(not even in native code). So I wouldn't have been able to know if
the font was constructed correctly.

There are 2 fonts included in this patch: Ahem-COLR-palettes.ttf
and Ahem-COLR-palettes-no-light-dark.ttf. Ahem-COLR-palettes.ttf is a
COLR font with 64 colored characters, each with 2 component glyphs.
The 2 components hold every combination of 8 colors (to make a total
of 64 colored glyphs). There are also 16 palettes of those 8 colors,
arranged in a rainbow table. Palette 2 is marked as
USABLE_WITH_LIGHT_BACKGROUND and palette 3 is marked as
USABLE_WITH_DARK_BACKGROUND. Ahem-COLR-palettes-no-light-dark.ttf
is much simpler, only has a single color character, and 2 palettes
of 2 colors each, and none of the palettes are marked as
USABLE_WITH_LIGHT_BACKGROUND or USABLE_WITH_DARK_BACKGROUND.

The fonts were generated from
https://github.com/litherum/AhemMaker/tree/COLR-multiple-palettes.

Copy link
Contributor

@drott drott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to add reftest-wait logic that completes on the document.fonts.ready promis resolution for ensuring font loading completes and avoiding flakiness. We did have a problem with that in the past on our bots but I am not 100% sure to what extent that's still the case.

So I wouldn't have been able to know if the font was constructed correctly.

FWIW, checking whether the font is contructed right with a name array can be done with fonttools. But I am not opposed to removing the <string> value from palette selection with <base-palette>.

@litherum
Copy link
Contributor Author

litherum commented Oct 1, 2021

I think reftest-wait makes sense for mutation tests, but for static tests like these, if the test runner doesn't wait for static @font-face fonts to be loaded, we have bigger problems than just these new tests. Tons of tests in WPT use (regular normal vanilla) Ahem, and that Ahem is also loaded as a web font.

@litherum
Copy link
Contributor Author

litherum commented Oct 1, 2021

After talking with @youennf, we think the most straightforward way to make the linter pass is to just rename the new font.

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request Oct 1, 2021
https://bugs.webkit.org/show_bug.cgi?id=230792
<rdar://problem/83530228>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

These are being upstreamed at web-platform-tests/wpt#31044.

* web-platform-tests/css/css-fonts/font-palette-10-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-10.html: Added.
* web-platform-tests/css/css-fonts/font-palette-11-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-11.html: Added.
* web-platform-tests/css/css-fonts/font-palette-12-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-12.html: Added.
* web-platform-tests/css/css-fonts/font-palette-13-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-13.html: Added.
* web-platform-tests/css/css-fonts/font-palette-14-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-14.html: Added.
* web-platform-tests/css/css-fonts/font-palette-15-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-15.html: Added.
* web-platform-tests/css/css-fonts/font-palette-16-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-16.html: Added.
* web-platform-tests/css/css-fonts/font-palette-17-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-17.html: Added.
* web-platform-tests/css/css-fonts/font-palette-18-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-18.html: Added.
* web-platform-tests/css/css-fonts/font-palette-19-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-19.html: Added.
* web-platform-tests/css/css-fonts/font-palette-2-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-2.html: Added.
* web-platform-tests/css/css-fonts/font-palette-20-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-20.html: Added.
* web-platform-tests/css/css-fonts/font-palette-21-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-21.html: Added.
* web-platform-tests/css/css-fonts/font-palette-22-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-22.html: Added.
* web-platform-tests/css/css-fonts/font-palette-23-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-23.html: Added.
* web-platform-tests/css/css-fonts/font-palette-24-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-24.html: Added.
* web-platform-tests/css/css-fonts/font-palette-25-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-25.html: Added.
* web-platform-tests/css/css-fonts/font-palette-26-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-26.html: Added.
* web-platform-tests/css/css-fonts/font-palette-27-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-27.html: Added.
* web-platform-tests/css/css-fonts/font-palette-28-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-28.html: Added.
* web-platform-tests/css/css-fonts/font-palette-29-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-29.html: Added.
* web-platform-tests/css/css-fonts/font-palette-3-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-3.html: Added.
* web-platform-tests/css/css-fonts/font-palette-30-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-30.html: Added.
* web-platform-tests/css/css-fonts/font-palette-31-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-31.html: Added.
* web-platform-tests/css/css-fonts/font-palette-4-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-4.html: Added.
* web-platform-tests/css/css-fonts/font-palette-5-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-5.html: Added.
* web-platform-tests/css/css-fonts/font-palette-6-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-6.html: Added.
* web-platform-tests/css/css-fonts/font-palette-7-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-7.html: Added.
* web-platform-tests/css/css-fonts/font-palette-8-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-8.html: Added.
* web-platform-tests/css/css-fonts/font-palette-9-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-9.html: Added.
* web-platform-tests/css/css-fonts/font-palette-expected.html:
* web-platform-tests/css/css-fonts/font-palette.html:
* web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes-no-light-dark.ttf: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf.
* web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf:

Source/WebCore:

The spec was changed in
w3c/csswg-drafts@1c74611
to add this functionality. Luckily, the additional functionality doesn't
require any Core Text change.

The old grammar was "<<integer [0, ∞]>> | <<string>>". The new grammar is
"light | dark | <<integer [0, ∞]>> | <<string>>". Before "light" and
"dark" existed, we were representing this by Variant<int64_t, AtomString>. Now that
"light" and "dark" exist, this is being expanded so the form

struct FontPaletteIndex {
    enum class Type {
        Light,
        Dark,
        Integer,
        String
    } type;
    unsigned integer;
    AtomString string;
};

This seems to be in accordance with WebKit style, instead of doing something like
class FontPaletteLight { }; class FontPaletteDark { };
using FontPaletteIndex = Variant<FontPaletteLight, FontPaletteDark, unsigned, AtomString>;

Tests: imported/w3c/web-platform-tests/css/css-fonts/font-palette-10.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-11.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-12.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-13.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-14.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-15.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-16.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-17.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-18.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-19.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-2.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-20.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-21.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-22.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-23.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-24.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-25.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-26.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-27.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-28.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-29.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-3.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-30.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-31.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-4.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-5.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-6.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-7.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-8.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-9.html

* css/CSSFontPaletteValuesRule.cpp:
(WebCore::CSSFontPaletteValuesRule::basePalette const):
(WebCore::CSSFontPaletteValuesRule::cssText const):
* css/StyleRule.cpp:
(WebCore::StyleRuleFontPaletteValues::StyleRuleFontPaletteValues):
* css/StyleRule.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontPaletteValuesRule):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasePaletteDescriptor):
* platform/graphics/FontPaletteValues.h:
(WebCore::FontPaletteIndex::FontPaletteIndex):
(WebCore::FontPaletteIndex::operator bool const):
(WebCore::FontPaletteIndex::operator== const):
(WebCore::FontPaletteIndex::operator!= const):
(WebCore::add):
(WebCore::FontPaletteValues::FontPaletteValues):
(WebCore::FontPaletteValues::basePalette const):
(WebCore::FontPaletteValues::operator bool const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::addLightPalette):
(WebCore::addDarkPalette):
(WebCore::addAttributesForCustomFontPalettes):
(WebCore::addAttributesForFontPalettes):

Canonical link: https://commits.webkit.org/242402@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cwiiis pushed a commit to Cwiiis/webkit-deprecated that referenced this pull request Oct 4, 2021
https://bugs.webkit.org/show_bug.cgi?id=230792
<rdar://problem/83530228>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

These are being upstreamed at web-platform-tests/wpt#31044.

* web-platform-tests/css/css-fonts/font-palette-10-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-10.html: Added.
* web-platform-tests/css/css-fonts/font-palette-11-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-11.html: Added.
* web-platform-tests/css/css-fonts/font-palette-12-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-12.html: Added.
* web-platform-tests/css/css-fonts/font-palette-13-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-13.html: Added.
* web-platform-tests/css/css-fonts/font-palette-14-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-14.html: Added.
* web-platform-tests/css/css-fonts/font-palette-15-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-15.html: Added.
* web-platform-tests/css/css-fonts/font-palette-16-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-16.html: Added.
* web-platform-tests/css/css-fonts/font-palette-17-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-17.html: Added.
* web-platform-tests/css/css-fonts/font-palette-18-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-18.html: Added.
* web-platform-tests/css/css-fonts/font-palette-19-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-19.html: Added.
* web-platform-tests/css/css-fonts/font-palette-2-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-2.html: Added.
* web-platform-tests/css/css-fonts/font-palette-20-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-20.html: Added.
* web-platform-tests/css/css-fonts/font-palette-21-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-21.html: Added.
* web-platform-tests/css/css-fonts/font-palette-22-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-22.html: Added.
* web-platform-tests/css/css-fonts/font-palette-23-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-23.html: Added.
* web-platform-tests/css/css-fonts/font-palette-24-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-24.html: Added.
* web-platform-tests/css/css-fonts/font-palette-25-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-25.html: Added.
* web-platform-tests/css/css-fonts/font-palette-26-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-26.html: Added.
* web-platform-tests/css/css-fonts/font-palette-27-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-27.html: Added.
* web-platform-tests/css/css-fonts/font-palette-28-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-28.html: Added.
* web-platform-tests/css/css-fonts/font-palette-29-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-29.html: Added.
* web-platform-tests/css/css-fonts/font-palette-3-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-3.html: Added.
* web-platform-tests/css/css-fonts/font-palette-30-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-30.html: Added.
* web-platform-tests/css/css-fonts/font-palette-31-expected.html: Added.
* web-platform-tests/css/css-fonts/font-palette-31.html: Added.
* web-platform-tests/css/css-fonts/font-palette-4-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-4.html: Added.
* web-platform-tests/css/css-fonts/font-palette-5-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-5.html: Added.
* web-platform-tests/css/css-fonts/font-palette-6-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-6.html: Added.
* web-platform-tests/css/css-fonts/font-palette-7-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-7.html: Added.
* web-platform-tests/css/css-fonts/font-palette-8-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-8.html: Added.
* web-platform-tests/css/css-fonts/font-palette-9-expected-mismatch.html: Added.
* web-platform-tests/css/css-fonts/font-palette-9.html: Added.
* web-platform-tests/css/css-fonts/font-palette-expected.html:
* web-platform-tests/css/css-fonts/font-palette.html:
* web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes-no-light-dark.ttf: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf.
* web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf:

Source/WebCore:

The spec was changed in
w3c/csswg-drafts@1c74611
to add this functionality. Luckily, the additional functionality doesn't
require any Core Text change.

The old grammar was "<<integer [0, ∞]>> | <<string>>". The new grammar is
"light | dark | <<integer [0, ∞]>> | <<string>>". Before "light" and
"dark" existed, we were representing this by Variant<int64_t, AtomString>. Now that
"light" and "dark" exist, this is being expanded so the form

struct FontPaletteIndex {
    enum class Type {
        Light,
        Dark,
        Integer,
        String
    } type;
    unsigned integer;
    AtomString string;
};

This seems to be in accordance with WebKit style, instead of doing something like
class FontPaletteLight { }; class FontPaletteDark { };
using FontPaletteIndex = Variant<FontPaletteLight, FontPaletteDark, unsigned, AtomString>;

Tests: imported/w3c/web-platform-tests/css/css-fonts/font-palette-10.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-11.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-12.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-13.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-14.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-15.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-16.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-17.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-18.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-19.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-2.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-20.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-21.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-22.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-23.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-24.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-25.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-26.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-27.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-28.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-29.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-3.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-30.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-31.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-4.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-5.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-6.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-7.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-8.html
       imported/w3c/web-platform-tests/css/css-fonts/font-palette-9.html

* css/CSSFontPaletteValuesRule.cpp:
(WebCore::CSSFontPaletteValuesRule::basePalette const):
(WebCore::CSSFontPaletteValuesRule::cssText const):
* css/StyleRule.cpp:
(WebCore::StyleRuleFontPaletteValues::StyleRuleFontPaletteValues):
* css/StyleRule.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontPaletteValuesRule):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasePaletteDescriptor):
* platform/graphics/FontPaletteValues.h:
(WebCore::FontPaletteIndex::FontPaletteIndex):
(WebCore::FontPaletteIndex::operator bool const):
(WebCore::FontPaletteIndex::operator== const):
(WebCore::FontPaletteIndex::operator!= const):
(WebCore::add):
(WebCore::FontPaletteValues::FontPaletteValues):
(WebCore::FontPaletteValues::basePalette const):
(WebCore::FontPaletteValues::operator bool const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::addLightPalette):
(WebCore::addDarkPalette):
(WebCore::addAttributesForCustomFontPalettes):
(WebCore::addAttributesForFontPalettes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@283398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This is an export of https://bugs.webkit.org/show_bug.cgi?id=230792.

I didn't test the <string> value for base-palette or override-colors
because w3c/csswg-drafts#6627 isn't resolved
yet.

The test font included in this patch doesn't have any named palettes
or colors because I currently don't have any way of testing that
(not even in native code). So I wouldn't have been able to know if
the font was constructed correctly.

There are 2 fonts included in this patch: COLR-palettes-test-font.ttf
and COLR-palettes-test-font-no-light-dark.ttf. COLR-palettes-test-font.ttf
is a COLR font with 64 colored characters, each with 2 component glyphs.
The 2 components hold every combination of 8 colors (to make a total
of 64 colored glyphs). There are also 16 palettes of those 8 colors,
arranged in a rainbow table. Palette 2 is marked as
USABLE_WITH_LIGHT_BACKGROUND and palette 3 is marked as
USABLE_WITH_DARK_BACKGROUND. COLR-palettes-test-font-no-light-dark.ttf
is much simpler, only has a single color character, and 2 palettes of 2
colors each, and none of the palettes are marked as
USABLE_WITH_LIGHT_BACKGROUND or USABLE_WITH_DARK_BACKGROUND.

The fonts were generated from
https://github.com/litherum/AhemMaker/tree/COLR-multiple-palettes.
@litherum litherum merged commit 2471734 into web-platform-tests:master Oct 5, 2021
@litherum litherum deleted the palette-rendering-tests branch October 5, 2021 03:32
webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request Oct 5, 2021
https://bugs.webkit.org/show_bug.cgi?id=231208

Unreviewed.

Update the WPT tests according to
web-platform-tests/wpt#31044.

* web-platform-tests/css/css-fonts/animations/font-palette-animation-2-expected.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-2.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-3-expected-mismatch.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-3.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-expected.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation.html:
* web-platform-tests/css/css-fonts/font-palette-10-expected.html:
* web-platform-tests/css/css-fonts/font-palette-10.html:
* web-platform-tests/css/css-fonts/font-palette-11-expected.html:
* web-platform-tests/css/css-fonts/font-palette-11.html:
* web-platform-tests/css/css-fonts/font-palette-12-expected.html:
* web-platform-tests/css/css-fonts/font-palette-12.html:
* web-platform-tests/css/css-fonts/font-palette-13-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-13.html:
* web-platform-tests/css/css-fonts/font-palette-14-expected.html:
* web-platform-tests/css/css-fonts/font-palette-14.html:
* web-platform-tests/css/css-fonts/font-palette-15-expected.html:
* web-platform-tests/css/css-fonts/font-palette-15.html:
* web-platform-tests/css/css-fonts/font-palette-16-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-16.html:
* web-platform-tests/css/css-fonts/font-palette-17-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-17.html:
* web-platform-tests/css/css-fonts/font-palette-18-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-18.html:
* web-platform-tests/css/css-fonts/font-palette-19-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-19.html:
* web-platform-tests/css/css-fonts/font-palette-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-2.html:
* web-platform-tests/css/css-fonts/font-palette-20-expected.html:
* web-platform-tests/css/css-fonts/font-palette-20.html:
* web-platform-tests/css/css-fonts/font-palette-21-expected.html:
* web-platform-tests/css/css-fonts/font-palette-21.html:
* web-platform-tests/css/css-fonts/font-palette-22-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-22.html:
* web-platform-tests/css/css-fonts/font-palette-23-expected.html:
* web-platform-tests/css/css-fonts/font-palette-23.html:
* web-platform-tests/css/css-fonts/font-palette-24-expected.html:
* web-platform-tests/css/css-fonts/font-palette-24.html:
* web-platform-tests/css/css-fonts/font-palette-25-expected.html:
* web-platform-tests/css/css-fonts/font-palette-25.html:
* web-platform-tests/css/css-fonts/font-palette-26-expected.html:
* web-platform-tests/css/css-fonts/font-palette-26.html:
* web-platform-tests/css/css-fonts/font-palette-27-expected.html:
* web-platform-tests/css/css-fonts/font-palette-27.html:
* web-platform-tests/css/css-fonts/font-palette-28-expected.html:
* web-platform-tests/css/css-fonts/font-palette-28.html:
* web-platform-tests/css/css-fonts/font-palette-29-expected.html:
* web-platform-tests/css/css-fonts/font-palette-29.html:
* web-platform-tests/css/css-fonts/font-palette-3-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-3.html:
* web-platform-tests/css/css-fonts/font-palette-30-expected.html:
* web-platform-tests/css/css-fonts/font-palette-30.html:
* web-platform-tests/css/css-fonts/font-palette-31-expected.html:
* web-platform-tests/css/css-fonts/font-palette-31.html:
* web-platform-tests/css/css-fonts/font-palette-4-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-4.html:
* web-platform-tests/css/css-fonts/font-palette-5-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-5.html:
* web-platform-tests/css/css-fonts/font-palette-6-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-6.html:
* web-platform-tests/css/css-fonts/font-palette-7-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-7.html:
* web-platform-tests/css/css-fonts/font-palette-8-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-8.html:
* web-platform-tests/css/css-fonts/font-palette-9-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-9.html:
* web-platform-tests/css/css-fonts/font-palette-add-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-add-2.html:
* web-platform-tests/css/css-fonts/font-palette-add-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-add.html:
* web-platform-tests/css/css-fonts/font-palette-empty-font-family-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-empty-font-family.html:
* web-platform-tests/css/css-fonts/font-palette-expected.html:
* web-platform-tests/css/css-fonts/font-palette-modify-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-modify-2.html:
* web-platform-tests/css/css-fonts/font-palette-modify-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-modify.html:
* web-platform-tests/css/css-fonts/font-palette-remove-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-remove-2.html:
* web-platform-tests/css/css-fonts/font-palette-remove-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-remove.html:
* web-platform-tests/css/css-fonts/font-palette.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-2-expected.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-2.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-expected-mismatch.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-2-expected.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-2.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-expected-mismatch.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete.html:
* web-platform-tests/css/css-fonts/resources/COLR-palettes-test-font-no-light-dark.ttf: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes-no-light-dark.ttf.
* web-platform-tests/css/css-fonts/resources/COLR-palettes-test-font.ttf: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf.

Canonical link: https://commits.webkit.org/242499@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cwiiis pushed a commit to Cwiiis/webkit-deprecated that referenced this pull request Oct 5, 2021
https://bugs.webkit.org/show_bug.cgi?id=231208

Unreviewed.

Update the WPT tests according to
web-platform-tests/wpt#31044.

* web-platform-tests/css/css-fonts/animations/font-palette-animation-2-expected.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-2.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-3-expected-mismatch.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-3.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation-expected.html:
* web-platform-tests/css/css-fonts/animations/font-palette-animation.html:
* web-platform-tests/css/css-fonts/font-palette-10-expected.html:
* web-platform-tests/css/css-fonts/font-palette-10.html:
* web-platform-tests/css/css-fonts/font-palette-11-expected.html:
* web-platform-tests/css/css-fonts/font-palette-11.html:
* web-platform-tests/css/css-fonts/font-palette-12-expected.html:
* web-platform-tests/css/css-fonts/font-palette-12.html:
* web-platform-tests/css/css-fonts/font-palette-13-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-13.html:
* web-platform-tests/css/css-fonts/font-palette-14-expected.html:
* web-platform-tests/css/css-fonts/font-palette-14.html:
* web-platform-tests/css/css-fonts/font-palette-15-expected.html:
* web-platform-tests/css/css-fonts/font-palette-15.html:
* web-platform-tests/css/css-fonts/font-palette-16-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-16.html:
* web-platform-tests/css/css-fonts/font-palette-17-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-17.html:
* web-platform-tests/css/css-fonts/font-palette-18-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-18.html:
* web-platform-tests/css/css-fonts/font-palette-19-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-19.html:
* web-platform-tests/css/css-fonts/font-palette-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-2.html:
* web-platform-tests/css/css-fonts/font-palette-20-expected.html:
* web-platform-tests/css/css-fonts/font-palette-20.html:
* web-platform-tests/css/css-fonts/font-palette-21-expected.html:
* web-platform-tests/css/css-fonts/font-palette-21.html:
* web-platform-tests/css/css-fonts/font-palette-22-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-22.html:
* web-platform-tests/css/css-fonts/font-palette-23-expected.html:
* web-platform-tests/css/css-fonts/font-palette-23.html:
* web-platform-tests/css/css-fonts/font-palette-24-expected.html:
* web-platform-tests/css/css-fonts/font-palette-24.html:
* web-platform-tests/css/css-fonts/font-palette-25-expected.html:
* web-platform-tests/css/css-fonts/font-palette-25.html:
* web-platform-tests/css/css-fonts/font-palette-26-expected.html:
* web-platform-tests/css/css-fonts/font-palette-26.html:
* web-platform-tests/css/css-fonts/font-palette-27-expected.html:
* web-platform-tests/css/css-fonts/font-palette-27.html:
* web-platform-tests/css/css-fonts/font-palette-28-expected.html:
* web-platform-tests/css/css-fonts/font-palette-28.html:
* web-platform-tests/css/css-fonts/font-palette-29-expected.html:
* web-platform-tests/css/css-fonts/font-palette-29.html:
* web-platform-tests/css/css-fonts/font-palette-3-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-3.html:
* web-platform-tests/css/css-fonts/font-palette-30-expected.html:
* web-platform-tests/css/css-fonts/font-palette-30.html:
* web-platform-tests/css/css-fonts/font-palette-31-expected.html:
* web-platform-tests/css/css-fonts/font-palette-31.html:
* web-platform-tests/css/css-fonts/font-palette-4-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-4.html:
* web-platform-tests/css/css-fonts/font-palette-5-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-5.html:
* web-platform-tests/css/css-fonts/font-palette-6-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-6.html:
* web-platform-tests/css/css-fonts/font-palette-7-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-7.html:
* web-platform-tests/css/css-fonts/font-palette-8-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-8.html:
* web-platform-tests/css/css-fonts/font-palette-9-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-9.html:
* web-platform-tests/css/css-fonts/font-palette-add-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-add-2.html:
* web-platform-tests/css/css-fonts/font-palette-add-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-add.html:
* web-platform-tests/css/css-fonts/font-palette-empty-font-family-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-empty-font-family.html:
* web-platform-tests/css/css-fonts/font-palette-expected.html:
* web-platform-tests/css/css-fonts/font-palette-modify-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-modify-2.html:
* web-platform-tests/css/css-fonts/font-palette-modify-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-modify.html:
* web-platform-tests/css/css-fonts/font-palette-remove-2-expected.html:
* web-platform-tests/css/css-fonts/font-palette-remove-2.html:
* web-platform-tests/css/css-fonts/font-palette-remove-expected-mismatch.html:
* web-platform-tests/css/css-fonts/font-palette-remove.html:
* web-platform-tests/css/css-fonts/font-palette.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-2-expected.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-2.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add-expected-mismatch.html:
* web-platform-tests/css/css-fonts/palette-values-rule-add.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-2-expected.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-2.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete-expected-mismatch.html:
* web-platform-tests/css/css-fonts/palette-values-rule-delete.html:
* web-platform-tests/css/css-fonts/resources/COLR-palettes-test-font-no-light-dark.ttf: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes-no-light-dark.ttf.
* web-platform-tests/css/css-fonts/resources/COLR-palettes-test-font.ttf: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/resources/Ahem-COLR-palettes.ttf.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@283534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gabisampaio pushed a commit to Gabisampaio/wpt that referenced this pull request Nov 18, 2021
…#31044)

This is an export of https://bugs.webkit.org/show_bug.cgi?id=230792.

I didn't test the <string> value for base-palette or override-colors
because w3c/csswg-drafts#6627 isn't resolved
yet.

The test font included in this patch doesn't have any named palettes
or colors because I currently don't have any way of testing that
(not even in native code). So I wouldn't have been able to know if
the font was constructed correctly.

There are 2 fonts included in this patch: COLR-palettes-test-font.ttf
and COLR-palettes-test-font-no-light-dark.ttf. COLR-palettes-test-font.ttf
is a COLR font with 64 colored characters, each with 2 component glyphs.
The 2 components hold every combination of 8 colors (to make a total
of 64 colored glyphs). There are also 16 palettes of those 8 colors,
arranged in a rainbow table. Palette 2 is marked as
USABLE_WITH_LIGHT_BACKGROUND and palette 3 is marked as
USABLE_WITH_DARK_BACKGROUND. COLR-palettes-test-font-no-light-dark.ttf
is much simpler, only has a single color character, and 2 palettes of 2
colors each, and none of the palettes are marked as
USABLE_WITH_LIGHT_BACKGROUND or USABLE_WITH_DARK_BACKGROUND.

The fonts were generated from
https://github.com/litherum/AhemMaker/tree/COLR-multiple-palettes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants