Skip to content
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

Add support for HTML5 <picture> tag #59

Open
jan-san opened this issue Jul 31, 2019 · 0 comments
Open

Add support for HTML5 <picture> tag #59

jan-san opened this issue Jul 31, 2019 · 0 comments
Labels
enhancement topic:frontend Issues related to the frontend code topic:img Issues related to the lazy loading of img tags

Comments

@jan-san
Copy link
Collaborator

jan-san commented Jul 31, 2019

The plugin currently processes <picture> tags incompletely.

For example, the following code:

<picture>
  <source srcset="img.png.webp" type="image/webp">
  <source srcset="img.png">
  <img src="img.png" srcset="img.png">
</picture>

...is transformed to:

<picture class="lazy lazy-hidden" data-lazy-type="image">
  <source data-lazy-srcset="img.png.webp" type="image/webp">
  <source data-lazy-srcset="img.png">
  <img data-lazy-src="img.png" class="lazy lazy-hidden" data-lazy-type="image" srcset="img.png">
</picture>

...which becomes the following after activation in the browser:

<picture class="lazy" data-lazy-type="image" src="null">
  <source data-lazy-srcset="img.png.webp" type="image/webp">
  <source data-lazy-srcset="img.png">
  <img data-lazy-src="img.png" class="lazy lazy-loaded" data-lazy-type="image" srcset="img.png" src="img.png">
</picture>

This essentially reduces the functionality of the <picture> tag to a basic <img>.

@jan-san jan-san added bug topic:img Issues related to the lazy loading of img tags topic:frontend Issues related to the frontend code enhancement and removed bug labels Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement topic:frontend Issues related to the frontend code topic:img Issues related to the lazy loading of img tags
Projects
None yet
Development

No branches or pull requests

1 participant