Problem/Motivation
The loading attribute is rendered regardless the native lazy-loading is selected or not.
Steps to reproduce
Review rendered HTML. Observe loading=“lazy” attribute.
Proposed resolution
Render the attribute only when native lazy-loading is selected.
Comments
Comment #4
osmanComment #5
osmanWith this update now, the image and iframe markups respect the "Prefer native lazy-loading" option more accurately.
When "Prefer native lazy-loading" option is selected, only a
loading=“lazy”attribute is added to the image and iframe tags; no lazysizes javascript library is loaded.When that option is not checked, the
loading=“lazy”attribute is no longer added. All necessary attribute changes are done on the server-side.The changes apply to both image fields, and text-formats.