PolymerElements / iron-image

Image element with sizing and preloading options
https://www.webcomponents.org/element/PolymerElements/iron-image
37 stars 43 forks source link

Don't break WebP Polyfill #74

Open bobobo1618 opened 8 years ago

bobobo1618 commented 8 years ago

Description

WebP is a great image format but only Chrome natively supports it. A Javascript polyfill exists but (I believe) due to iron-image not populating the img element's src tag, the polyfill doesn't work.

Expected outcome

https://jsfiddle.net/t03yybsm/2/ shows two images on all browsers.

Actual outcome

https://jsfiddle.net/t03yybsm/2/ shows two images on Chrome and one broken image on most other browers.

Live Demo

https://jsfiddle.net/t03yybsm/2/

Steps to reproduce

https://jsfiddle.net/t03yybsm/2/

Browsers Affected

TimvdLippe commented 8 years ago

Hm probably https://github.com/PolymerElements/iron-image/blob/master/iron-image.html#L295 should be .setAttribute("src", src) instead?

bicknellr commented 8 years ago

I think this is going to be difficult to support (without making specific concessions for this polyfill) with the sizing case since this polyfill relies on directly accessing the img. Does it even work with Shadow DOM?

weber-stephen commented 7 years ago

+1