Add decoding=async attribute to images by default#1853
Add decoding=async attribute to images by default#1853westonruter wants to merge 1 commit intoWordPress:trunkfrom
Conversation
| } | ||
| } | ||
|
|
||
| $attr['decoding'] = 'async'; |
There was a problem hiding this comment.
I suppose the question will be whether this should have a filter like lazy-loading does via wp_lazy_loading_enabled(). Should there be a wp_async_decoding_enabled() function and filter passed the same args?
There was a problem hiding this comment.
In contrast with lazy-loading in which lazy is omitted for images likely to be in the first viewport, the decoding=async attribute would still be added to all images.
|
Have done the tests and covered the potential caveats I could think about, and this is passing with flying colors, as the lab+local tests have contradicted some of the conclusions I've drawn after reading the specifications. Full result of the research posted on Trac : TL;DR: |
|
Closing in favor of #2409 |
Note that most of the test changes are to make testing work on more environments, specifically where the wp-content directory is not in the standard location.
Trac ticket: https://core.trac.wordpress.org/ticket/53232
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.