[w3c/payment-handler] "Convert image objects" trashes all images (#235)

The "Convert image objects" algorithm mindlessly trashes all image objects passed into instruments if one fails to validate based on type or URL. That's wrong for a number of reasons:

 1. Browsers support different formats AND that list can change over time. So, Chrome supports Webp, and Firefox doesn't... Edge supports JPEG-XR, but neither Chrome or Firefox do... etc.  
 1. It's impossible to determine the type until you actually sniff it. A developer could exclude the type, or serve the wrong type. Because `type` becomes a vector to invalidate the whole icons array, then it's pointless to include it - because even if all but one of your values are good, then they all get trashed.

The above also applies to `src` checks. It's pointless to resolve those URLs when you are storing them - because, again, a browser might support a new protocol tomorrow (e.g., "super-image://foo/bar.gif").  
    




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-handler/issues/235

Received on Tuesday, 28 November 2017 03:58:01 UTC