Bug 220576

Summary: REGRESSION(r262893): feComponentTransfer is not rendered correctly on Retina display
Product: WebKit Reporter: Xidorn Quan <xidorn-webkit>
Component: SVGAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, kondapallykalyan, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=212649
Attachments:
Description Flags
testcase
none
reduced test case
none
more reduced test case
none
Patch
simon.fraser: review+
Patch
none
Patch none

Description Xidorn Quan 2021-01-12 20:20:24 PST
Created attachment 417504 [details]
testcase

Steps to reproduce:
1. open the testcase
2. click the "Set filter" button

Expected result:
The image becomes blurred.

Actual result:
The image is blurred, but also stretched a bit.

(I've observed even worse distortion when more complicated filters are added.)

I've tested Firefox and Chrome, and neither of them has this problem.

After some diagnose, I think this is because `feComponentTransfer` doesn't work correctly when the SVG is not somehow rendered. This behavior can be easily reproduced if the SVG element is `display: none`. (Note that Firefox shows nothing when SVG element is `display: none` though, not sure whose behavior is correct here.)

That makes me think that the distorted state being persisted is probably related to bug 99996 that even if the SVG element is correctly rendered, the filter result is not updated accordingly.
Comment 1 Simon Fraser (smfr) 2021-01-13 11:55:08 PST
The stretching seems to be related to Retina scaling (but only vertically?)
Comment 2 Radar WebKit Bug Importer 2021-01-13 11:55:18 PST
<rdar://problem/73160574>
Comment 3 Said Abou-Hallawa 2021-01-26 09:12:48 PST
Created attachment 418428 [details]
reduced test case

The stretching bug can occur with just static pages, i.e. no DOM change is needed to reproduce the bug.
Comment 4 Said Abou-Hallawa 2021-01-28 14:59:12 PST
This is a regression of r262893.
Comment 5 Said Abou-Hallawa 2021-01-28 15:05:24 PST
Created attachment 418673 [details]
more reduced test case
Comment 6 Said Abou-Hallawa 2021-01-28 18:19:02 PST
Created attachment 418688 [details]
Patch
Comment 7 Simon Fraser (smfr) 2021-01-28 18:58:35 PST
Comment on attachment 418688 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418688&action=review

> LayoutTests/fast/hidpi/filters-component-transfer-expected.html:7
> +        filter: url("#a");

You can remove this here.
Comment 8 Said Abou-Hallawa 2021-01-28 19:36:02 PST
Created attachment 418699 [details]
Patch
Comment 9 Said Abou-Hallawa 2021-01-28 19:37:24 PST
Created attachment 418700 [details]
Patch
Comment 10 EWS 2021-01-29 06:53:37 PST
Committed r272059: <https://trac.webkit.org/changeset/272059>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418700 [details].