Skip to content

Commit

Permalink
Fix carry-forward of missing components for color mixing
Browse files Browse the repository at this point in the history
Color::CarryForwardAnalogousMissingComponents() was operating on a copy
of the Color, meaning that it was essentially a no-op. With that fixed
it would however also clear any 'none' values that was introduced by the
process of conversion.

Split carry-forward handling to have a step before the conversion that
determines which 'none' values to carry-forward and arrange them for the
interpolation space, and one step after that simply applies the 'none'
values determined by the pre-step.

Fixed: 387132019
Change-Id: I4f678261082984a1002d6bf7db75cc4eeb17a026
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6258092
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1421959}
  • Loading branch information
Fredrik Söderquist authored and chromium-wpt-export-bot committed Feb 19, 2025
1 parent 5b8a095 commit bbb5c43
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions css/css-color/color-mix-missing-components.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>color-mix(): &lt;color>s with missing components</title>
<link rel="help" href="https://drafts.csswg.org/css-color-5/#color-mix">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#interpolation-missing">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<script src="/css/support/color-testcommon.js"></script>
<div id="target"></div>
<script>
fuzzy_test_computed_color(`color-mix(in srgb, oklch(0 none none), white)`, `color(srgb 0.5 0.5 0.5)`);
</script>

0 comments on commit bbb5c43

Please sign in to comment.