Bug 129565

Summary: Remove filterRes parameter from filters
Product: WebKit Reporter: Adenilson Cavalcanti Silva <savagobr>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, ews-watchlist, felix.hassert+webkit, ideami, krit, rniwa, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 68469    
Attachments:
Description Flags
test-page to show effect of filterRes on retina clients
none
Patch
none
Archive of layout-test-results from ews100 for mac-sierra
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Archive of layout-test-results from ews202 for win-future
none
Archive of layout-test-results from ews116 for mac-sierra
none
Archive of layout-test-results from ews121 for ios-simulator-wk2
none
Archive of layout-test-results from ews113 for mac-sierra
none
Archive of layout-test-results from ews123 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews202 for win-future
none
Archive of layout-test-results from ews121 for ios-simulator-wk2
none
Patch none

Description Adenilson Cavalcanti Silva 2014-03-01 17:27:23 PST
It seems that filterRes is deprecated in the spec (http://dev.w3.org/fxtf/filters/). Quote: "... filterRes attribute was removed from the specification. See SVG 1.1 specification for the definition". Finally FF has removed it already.

It makes sense to remove this feature.
Comment 1 Dirk Schulze 2014-03-02 08:35:35 PST
*** Bug 124914 has been marked as a duplicate of this bug. ***
Comment 2 Felix Hassert 2015-12-08 09:24:58 PST
I stumbled upon very similar problems with SVG Filters that are rendered in Safari in viewport pixels, disregarding device pixels on 'retina' devices. This was reported in Bug 124914 and in a somewhat related discussion in Bug 93471.

I am also using filterRes to get sharp images on retina images. I have a test-page attached.

The HTML is:

<img src="filtered.svg" width="400">

and filtered.svg has a width of 800px for clients with DPR=2. as soon as a filter is used in the SVG it appears blurry in the browser.

i can fix that by repeating the (desired) dimensions as filterRes in the svg:

<svg ....  width="800" height="531" ...>
.. 
  <filter filterRes="800 531" id="noop">
...

I don't know of any other workaround to make filters apply on a canvas regarding the dpr. If there is a better and more compliant way, please let me know.

However, as long as I need this workaround, I would like to discourage you to drop filterRes.

That said, I think that it is a bug in webkit, that the actual canvas size for filters is (presumably) derived from the targeted viewport area. Other browsers (Chrome and Firefox) that have already dropped filterRes support do not show this behavior. Please use the attached test-page svg-filter.tgz to verify it.
Comment 3 Felix Hassert 2015-12-08 09:27:34 PST
Created attachment 266897 [details]
test-page to show effect of filterRes on retina clients
Comment 4 Radar WebKit Bug Importer 2018-09-23 10:22:56 PDT
<rdar://problem/44714340>
Comment 5 Simon Fraser (smfr) 2018-09-23 10:47:51 PDT
Created attachment 350573 [details]
Patch
Comment 6 EWS Watchlist 2018-09-23 11:54:16 PDT Comment hidden (obsolete)
Comment 7 EWS Watchlist 2018-09-23 11:54:18 PDT Comment hidden (obsolete)
Comment 8 EWS Watchlist 2018-09-23 12:06:23 PDT Comment hidden (obsolete)
Comment 9 EWS Watchlist 2018-09-23 12:06:25 PDT Comment hidden (obsolete)
Comment 10 EWS Watchlist 2018-09-23 12:30:02 PDT Comment hidden (obsolete)
Comment 11 EWS Watchlist 2018-09-23 12:30:14 PDT Comment hidden (obsolete)
Comment 12 EWS Watchlist 2018-09-23 12:49:35 PDT Comment hidden (obsolete)
Comment 13 EWS Watchlist 2018-09-23 12:49:36 PDT Comment hidden (obsolete)
Comment 14 EWS Watchlist 2018-09-23 12:53:20 PDT Comment hidden (obsolete)
Comment 15 EWS Watchlist 2018-09-23 12:53:22 PDT Comment hidden (obsolete)
Comment 16 EWS Watchlist 2018-09-23 14:46:06 PDT Comment hidden (obsolete)
Comment 17 EWS Watchlist 2018-09-23 14:46:08 PDT Comment hidden (obsolete)
Comment 18 EWS Watchlist 2018-09-23 15:35:33 PDT Comment hidden (obsolete)
Comment 19 EWS Watchlist 2018-09-23 15:35:35 PDT Comment hidden (obsolete)
Comment 20 Simon Fraser (smfr) 2018-09-23 20:18:58 PDT
Created attachment 350601 [details]
Patch
Comment 21 EWS Watchlist 2018-09-23 22:03:02 PDT Comment hidden (obsolete)
Comment 22 EWS Watchlist 2018-09-23 22:03:14 PDT Comment hidden (obsolete)
Comment 23 EWS Watchlist 2018-09-23 22:24:57 PDT Comment hidden (obsolete)
Comment 24 EWS Watchlist 2018-09-23 22:24:59 PDT Comment hidden (obsolete)
Comment 25 Simon Fraser (smfr) 2018-09-23 22:31:22 PDT
Created attachment 350608 [details]
Patch
Comment 26 WebKit Commit Bot 2018-09-24 17:40:22 PDT
Comment on attachment 350608 [details]
Patch

Clearing flags on attachment: 350608

Committed r236447: <https://trac.webkit.org/changeset/236447>
Comment 27 WebKit Commit Bot 2018-09-24 17:40:24 PDT
All reviewed patches have been landed.  Closing bug.