ApoorvSaxena / lozad.js Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation W3C #157
Comments
|
This should be in the docs imo as people will not realise it's not w3c valid in this way (obviously should be checking anyway), but: lozad.js will overwrite an existing src attribute, so, you can preset it with an inline data uri. As an example: Would be helpful if a library of various inline data images like this existed. |
|
Turns out you can get w3c errors still if you use the
|
|
This is something else that #144 would fix I believe |
|
Hah, just fixed with: const observer = lozad('.lozad', {
loaded: (el) => {
el.setAttribute('sizes', el.dataset.sizes);
el.removeAttribute('data-sizes');
},
});Should be built in though, if you can do the same with |
|
@joepagan This probably fixes the issue with W3C validator. But in a quick test, only Chrome and Firefox downloaded the correct sizes for images. Other browsers like IE and Safari were ignoring the sizes attribute when it’s updated in the |
|
Well, what I suggested is just a temp work around, I think lozad should deal with this really. Maybe a more suitable fix is to leave the sizes attribute on the element |
|
Any news on this? it has been a while and there is still no fix |
|
hey @ApoorvSaxena please assign this issue to me |
|
+1 |


Expected Behavior
Running validator https://validator.w3.org on basic
<picture>elements as per setup config should not result in errors.Current Behavior
Currently when running validator on:
Validator will give error:
Element img is missing required attribute src.Possible Solution
Setting up
<nosript>tag with<img src=(...)>results inElement noscript not allowed as child of element picture in this context.When adding
<img src=(...)>tag without<noscript>surrounding it, html parser will simply output 2 images...Steps to Reproduce (for bugs)
Run validator on any website with lozad setup
Context
Trying to get a clean sheet from validator.
The text was updated successfully, but these errors were encountered: