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

New Trait for decoding attribute in images #3796

Merged
merged 4 commits into from Feb 3, 2024

Conversation

pmoreno-rodriguez
Copy link
Contributor

The decoding property of the HTMLImageElement interface provides a hint to the browser as to how it should decode the image. More specifically, whether it should wait for the image to be decoded before presenting other content updates or not.
With this trait you can add the decoding attribute to load images in an easy way. It basically works the same way as the 'loading' attribute (see Grav Docs), with async, sync and auto options. More info in Mozilla.org

Copy link
Member

@rhukster rhukster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lacking the additional default in system/config/system.yaml for the images.defaults.decoding value is not provided in the PR. Also with this additional property, there should be a correspoding entry in the system/blueprints/config/system.yaml blueprint.

Thanks!

…onfig/system.yaml for the images.defaults.decoding value
@pmoreno-rodriguez
Copy link
Contributor Author

Sorry for the oversight. Shortly, I will make the pull request from the admin plugin with the translations corresponding to the 'decoding' trait.

@rhukster
Copy link
Member

rhukster commented Feb 2, 2024

As yoiuy can see the latest commit is now showing a bunch of failed tests. I think its becaues you the code is ALWAYS adding 'encoding="auto"' to every single link, even if you don't provide an encoding option.

@pmoreno-rodriguez
Copy link
Contributor Author

Thank you very much for your help. Now the 'decoding' attribute behaves the same as 'loading' and I hope there is no problem.

@rhukster rhukster merged commit ad8b1b7 into getgrav:develop Feb 3, 2024
6 checks passed
@rhukster
Copy link
Member

rhukster commented Feb 3, 2024

Looks good thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants