From 3d75d4b03578984f602a38b2265e3c79b4697848 Mon Sep 17 00:00:00 2001 From: aFarkas Date: Mon, 24 Nov 2014 22:09:37 +0100 Subject: [PATCH] allow getting `srcset` in Safari using the data-pfsrcset attribute. --- src/picturefill.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/picturefill.js b/src/picturefill.js index ea044192..d1b24376 100644 --- a/src/picturefill.js +++ b/src/picturefill.js @@ -313,7 +313,8 @@ pf.dodgeSrcset = function( img ) { if ( img.srcset ) { img[ pf.ns ].srcset = img.srcset; - img.removeAttribute( "srcset" ); + img.srcset = ""; + img.setAttribute( "data-pfsrcset", img[ pf.ns ].srcset ); } };