Allow out-of-standard-gamut colors with float canvases by kainino0x · Pull Request #4526 · gpuweb/gpuweb
The spec previously said that it was undefined behavior to display "out-of-gamut premultiplied RGBA values" (R/G/B > A).
But that definition overlooked some cases. We intended to allow using an rgba16float srgb canvas to display wider-than-srgb colors, but such colors would according to the current definition be "out-of-gamut premultiplied RGBA values" (regardless of whether they're opaque like [1.04, 0, 0, 1] or transparent like [0.52, 0, 0, 0.5]).
This replaces that concept with "out-of-range premultiplied RGBA values", which is when the unpremultiplied equivalent of the color can't be represented in the format used for the color (e.g. premul [0.52, 0, 0, 0.5] in rgba8unorm). I've written it this way because I think it will be valid for #4108 as well if we ever get that [EDIT: fixed link to point to correct issue]. The idea is that as long as the implementation doesn't use any intermediate format that's worse than the canvas format (in either range or precision), the color will be preserved.