Skip to content

Allow loading attribute for <img> tag #22802

@flaksp

Description

@flaksp

When using loading attribute on <img> tag AMP validator fails with following message:

The attribute 'loading' may not appear in tag 'img'. (see https://amp.dev/documentation/components/amp-img)

Code:

<amp-img src="https://example.com/image.png" alt="Example" layout="fill">
  <noscript>
    <img src="https://example.com/image.png" alt="Example" loading="lazy">
  </noscript>
</amp-img>

I use <noscript> as fallback for users with disabled JavaScript and some kind of crawlers who can't execute <amp-img> element (as described in docs example: https://amp.dev/documentation/examples/components/amp-img/#no-script)

This issue may be relevant to #21982 and probably #21497.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions