css/css-color/animation/color-composition.html expects colors to add, which css-values-4 defines as not additive

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
css, html, javascript, playwright
Domain
testing, web-dev

Research direction

Start with css/css-color/animation/color-composition.html and compare its ten expected values with CSS Values 4 §§8.1.1 and 3, which the issue cites. Update the eight expectations that conflict with the specification; the two at progress 1 already agree. Check the test’s expected results against the listed compositions and progress values.

Written by the indexing model from the issue text.

Description

css/css-color/animation/color-composition.html expects a color keyframe composited by add to sum its channels with the underlying color: underlying rgb(50, 50, 50), from add rgb(10, 10, 10) to replace rgb(30, 30, 30), at 0 it expects rgb(60, 60, 60).

CSS Values 4, §8.1.1 Combination of <color>, reads "The <color> type is not additive.", as resolved in w3c/csswg-drafts#8576, and §3 reads "If a value type does not define a specific procedure for addition or is defined as not additive, its addition operation is simply Vresult = VB." So the add keyframe is its own color, and at 0 the result is rgb(10, 10, 10). Eight of the test's ten expectations differ; the two at progress 1 agree.

Steps to reproduce

Reproducer: https://gist.github.com/YevheniiKotyrlo/896f743fce1115cd6c42e8a0b9fff489

git clone https://gist.github.com/896f743fce1115cd6c42e8a0b9fff489.git wpt-color-composition
cd wpt-color-composition
sh ./run.sh

run.sh installs Playwright and runs repro.mjs, which reads §8.1.1 and §3 from the css-values-4 Editor's Draft and color-composition.html from wpt master, gives each expectation the value css-values-4 defines, and runs the same compositions in Chromium, Firefox and WebKit the way interpolation-testcommon.js does for Web Animations. It exits 1 while css-values-4 makes <color> not additive and the test expects a sum.

Expected

Each expectation is the add keyframe's own color interpolated to the replace keyframe's:

  • underlying rgb(50, 50, 50), from add rgb(10, 10, 10) to replace rgb(30, 30, 30): at 0, 0.2, 1.2 and 1.5, rgb(10, 10, 10), rgb(14, 14, 14), rgb(34, 34, 34) and rgb(40, 40, 40)
  • underlying rgb(60, 60, 60), from add rgb(0, 0, 0) to replace rgb(50, 50, 50): at 0, 0.5, 1.2 and 1.5, rgb(0, 0, 0), rgb(25, 25, 25), rgb(60, 60, 60) and rgb(75, 75, 75)

The two expectations at progress 1 stay as they are.

Actual

On Windows 11 with Node 26.12.1 and Playwright 1.65.0:

css-values-4 at revision 6f177f4c13fbc3153474b66e88c25cf58ce5cfdd; color-composition.html from web-platform-tests/wpt@d4265db9011a846e8bd2b9911dc13159ae1f4a49 (master)
  css-values-4 §8.1.1 Combination of <color>: "The <color> type is not additive."
  css-values-4 §3 addition: "If a value type does not define a specific procedure for addition or is defined as not additive, its addition operation is simply Vresult = VB."
  underlying rgb(50, 50, 50), from add rgb(10, 10, 10) to replace rgb(30, 30, 30):
    at 0: the test expects rgb(60, 60, 60), css-values-4 gives rgb(10, 10, 10)  <- differs
    at 0.2: the test expects rgb(54, 54, 54), css-values-4 gives rgb(14, 14, 14)  <- differs
    at 1: the test expects rgb(30, 30, 30), css-values-4 gives rgb(30, 30, 30)
    at 1.2: the test expects rgb(24, 24, 24), css-values-4 gives rgb(34, 34, 34)  <- differs
    at 1.5: the test expects rgb(15, 15, 15), css-values-4 gives rgb(40, 40, 40)  <- differs
  underlying rgb(60, 60, 60), from add rgb(0, 0, 0) to replace rgb(50, 50, 50):
    at 0: the test expects rgb(60, 60, 60), css-values-4 gives rgb(0, 0, 0)  <- differs
    at 0.5: the test expects rgb(55, 55, 55), css-values-4 gives rgb(25, 25, 25)  <- differs
    at 1: the test expects rgb(50, 50, 50), css-values-4 gives rgb(50, 50, 50)
    at 1.2: the test expects rgb(48, 48, 48), css-values-4 gives rgb(60, 60, 60)  <- differs
    at 1.5: the test expects rgb(45, 45, 45), css-values-4 gives rgb(75, 75, 75)  <- differs

Chromium 158.0.8127.18, Firefox 159.0 and WebKit 27.2 each give the test's sums:

chromium 158.0.8127.18:
  underlying rgb(50, 50, 50): 0 -> rgb(60, 60, 60); 0.2 -> rgb(54, 54, 54); 1 -> rgb(30, 30, 30); 1.2 -> rgb(24, 24, 24); 1.5 -> rgb(15, 15, 15)
  underlying rgb(60, 60, 60): 0 -> rgb(60, 60, 60); 0.5 -> rgb(55, 55, 55); 1 -> rgb(50, 50, 50); 1.2 -> rgb(48, 48, 48); 1.5 -> rgb(45, 45, 45)
[…]

SUMMARY: css-values-4 makes <color> not additive (addition is Vresult = VB), and 8 of the 10 expectations of color-composition.html expect the add keyframe's colour summed with the underlying one
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.