[fxtf-drafts] [filter-effects] feComponentTransfer type="table" has undefined behavior when only one table value is given (#336)

karip has just created a new issue for https://github.com/w3c/fxtf-drafts:

== [filter-effects] feComponentTransfer type="table" has undefined behavior when only one table value is given ==
The specification doesn't say how to process `feComponentTransfer` when its child [feFuncR/feFuncG/feFuncB](https://drafts.fxtf.org/filter-effects/#feFuncRElement) is in the table mode and has only one table value:

    <feComponentTransfer>
      <feFuncR type="table" tableValues="1"/>
      <feFuncG type="table" tableValues="0"/>
      <feFuncB type="table" tableValues="0"/>
    </feComponentTransfer>

For instance, this formula in the spec cannot be calculated when there is only one
value (it assumes vk+1): `C' = vk + (C - k/n)*n * (vk+1 - vk)`.

As a result, browser implementations don't match. Firefox uses an identity transfer function. Chrome and Safari process the color transfer as if the type is switched to "discrete".

I propose to define it the same way as Chrome and Safari process it. So, if only one value is given, then the component transfer should always use that value. That would make the table type similar to the discrete type.

Here's a [CodePen example](https://codepen.io/anon/pen/NmPqXa?editors=1000) of the situation. The discrete type looks the same on all browsers, but the table type looks different on Firefox and Chrome / Safari.


Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/336 using your GitHub account

Received on Monday, 1 April 2019 11:37:24 UTC