css-fonts/parsing/palette-mix-computed.html expects a palette-mix() of one palette to keep its function, where css-fonts-4 simplifies it to that palette

Open Beginner friendly
#65,844 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
css, html, javascript
Domain
testing

Research direction

Read css/css-fonts/parsing/palette-mix-computed.html, especially the subtests on lines 23 and 75. Compare their expected computed values with the font-palette computed value rule linked in the issue. Update those two expectations to light and dark, then confirm the other subtests, including the leftover cases on lines 76 and 81, remain unchanged.

Written by the indexing model from the issue text.

Description

css/css-fonts/parsing/palette-mix-computed.html has two subtests, lines 23 and 75, that expect a palette-mix() naming one palette in every item to compute with the function kept:

test_computed_value(`font-palette`, `palette-mix(in oklab, light 30%, light)`,  `palette-mix(light 30%, light 70%)`);
test_computed_value(`font-palette`, `palette-mix(in srgb, dark)`,                                         `palette-mix(in srgb, dark)`);

css-fonts-4 gives font-palette the computed value "specified keyword, identifier or <palette-mix()> function. <palette-mix()> must be simplified to a single keyword or identifier if resulting palette is equivalent." Line 23 mixes light with itself at 30% and 70%, and line 75's lone dark takes 100%. Neither leaves a leftover to scale the alpha, so the resulting palettes are light and dark. Line 23 expected light until #62491.

Chromium computes line 23 to light, keeps the function for a mix of one palette whose leftover scales the alpha, and does not parse a one-item mix. The WebKit build Playwright ships keeps the function for both lines, as the test expects.

Steps to reproduce

Reproducer: https://gist.github.com/YevheniiKotyrlo/3d4ae5966738d71897faa05d8d3949ed

git clone https://gist.github.com/3d4ae5966738d71897faa05d8d3949ed.git wpt-palette-mix-one-palette
cd wpt-palette-mix-one-palette
sh ./run.sh

run.sh installs Playwright and runs repro.mjs, which reads the sentence above from csswg-drafts main and the test from wpt master, and lists each subtest whose specified mix names one palette in every item, with percentages that normalize to no leftover, and whose expected value keeps palette-mix(). It then prints the computed font-palette that Chromium, Firefox and WebKit give each listed value and two controls. It exits 1 while the sentence stands and a subtest is listed, and 0 once none is.

Expected
  • line 23: palette-mix(in oklab, light 30%, light) → light
  • line 75: palette-mix(in srgb, dark) → dark

The other subtests stay as they are, including the one-palette mixes with a leftover on lines 76 and 81 (palette-mix(in srgb, dark 50%), palette-mix(in srgb, dark 0%)).

Actual

On Windows 11 with Node 26.12.1 and Playwright 1.65.1:

node v26.12.1 on win32 10.0.26300
css-fonts-4 from w3c/csswg-drafts@7027ab6fdf3c98d9c44666820041cb075b0e28dd; the test from web-platform-tests/wpt@d12cfe94330c3f1ba505475f7361edd9a9b3e2ce
  css-fonts-4 font-palette computed value: "<palette-mix()> must be simplified to a single keyword or identifier if resulting palette is equivalent." stands
  44 subtest lines; those expecting a mix of one palette, with no leftover, to keep its function:
  line 23: palette-mix(in oklab, light 30%, light) -> palette-mix(light 30%, light 70%)
  line 75: palette-mix(in srgb, dark) -> palette-mix(in srgb, dark)
playwright 1.65.1; computed font-palette of each value in each engine:
  chromium 159.0.8154.6:
    palette-mix(in oklab, light 30%, light) -> "light"
    palette-mix(in srgb, dark) -> not supported
    palette-mix(in oklab, light 30%, dark) -> "palette-mix(in oklab, light 30%, dark 70%)"
    palette-mix(in srgb, light 30%, light 30%) -> "palette-mix(in srgb, light 30%, light 30%)"
  firefox 159.0:
    palette-mix(in oklab, light 30%, light) -> not supported
    palette-mix(in srgb, dark) -> not supported
    palette-mix(in oklab, light 30%, dark) -> not supported
    palette-mix(in srgb, light 30%, light 30%) -> not supported
  webkit 27.2:
    palette-mix(in oklab, light 30%, light) -> "palette-mix(light 30%, light 70%)"
    palette-mix(in srgb, dark) -> "palette-mix(in srgb, dark)"
    palette-mix(in oklab, light 30%, dark) -> "palette-mix(light 30%, dark 70%)"
    palette-mix(in srgb, light 30%, light 30%) -> "palette-mix(in srgb, light 30%, light 30%)"

SUMMARY: css-fonts-4 simplifies an equivalent palette-mix() to its palette, and line 23 (light), line 75 (dark) expect the function kept; exit 1
Dominant language
HTML
Stars
6.3k
Forks
4.1k
Avg merge
17h 20m
Merged PRs (30d)
841

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-platform-tests/wpt

All issues in web-platform-tests/wpt

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.