Lofesa commented on issue #1899: data-srcset in img and amp-img
URL: 
https://github.com/apache/incubator-pagespeed-mod/pull/1899#issuecomment-503581800
 
 
   > 
   > 
   > Lofesa, are you able to run the integration tests locally? WDYT of adding 
a unit-test as well?
   
   I have it run in production [here](https://intersindicalrm.org/).
   You can see data-srcset and amp-img srcset got rewrited. (the amp version is 
url/?amp).
   
   > 
   > I noticed also that you have a test for "data-srcset" but I don't see a 
config update to look for that attribute (e.g. with UrlValuedAttribute) nor do 
I see that attribute as an html standard on a web search. It does look like 
it's used as an ad-hoc placeholder in some JS libraries, but I don't know if we 
should hard-code for that. It probably doesn't do any harm, but I just wanted 
to bring that up. Thoughts?
   
   My approach to this is: If you have a image element ( such as 
UrlValuedAttribute amp-img src image) this element maybe (or not) to have a 
srcset or a data-srcset, if it have it must be rewrittten.
   I think that data-srcset is a standard "de facto", some JS libraries and 
other tools use it to lazyload images , in fact pagespeed uses other attribute 
to lazyload images that is less ussed. Why don´t help people that use 
data-srcset to get their images optimized?
   With a long look, all this should be reconsidered, as soon browsers will use 
the attribute loading = "lazy" to lazyload images (In fact the lazysizes 
library has now an option to don´t fire if the attribute is set and the 
brownser can lazyload images)
   Then the lazyload_images filter (as well all these JS libraries and tools) 
will be unnecessary, limiting itself to adding said attribute to the images f 
it is not added by the default by  CMS or other web development tools.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to