In WebKit's implementation of CSS filters invert() and opacity(), FEComponentTransfer is used and the transfer function is surprisingly to table, instead of linear. Looking at the CSS spec, https://drafts.fxtf.org/filter-effects/#invertEquivalent invert() and opacity() is implemented using "table" with just 2 values, which is equivalent to using a linear function. I propose to change the implementation of invert() and opacity() to use linear transfer function as well for simplicity and clarity.
<rdar://problem/67887069>
Created attachment 407421 [details] Patch
Comment on attachment 407421 [details] Patch Does this have any effect on performance?
(In reply to Darin Adler from comment #3) > Comment on attachment 407421 [details] > Patch > > Does this have any effect on performance? No, not that I know of. By looking at the code, FEComponentTransfer eventually converts linear, discrete table transfer functions to a hash map that maps each R,G,B values to a new value by applying the transfer function. So I don't expect this patch to cause any performance hit at all
Committed r266266: <https://trac.webkit.org/changeset/266266> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407421 [details].