Skip to content

Support some new img attributes for those within noscript.#23765

Merged
sparhami merged 2 commits intoampproject:masterfrom
sparhami:img_loading
Aug 9, 2019
Merged

Support some new img attributes for those within noscript.#23765
sparhami merged 2 commits intoampproject:masterfrom
sparhami:img_loading

Conversation

@sparhami
Copy link
Copy Markdown

@sparhami sparhami commented Aug 7, 2019

These attributes help to get some of the nice features of AMP (layout
stability, async loading) when scripts are not enabled for browsers that support them.

We might consider allowing <img intrinsicsize="blah x blah" loading="lazy">
as an alternative to <amp-img> in the future if polyfilling the attributes is
feasible.

Closes #22802

These attributes help to get some of the nice features of AMP (layout
stability, async loading) when scripts are not enabled.

We might consider allowing `<img intrinsicsize="blah x blah" loading="lazy">`
as an alternative to `<amp-img>` in the future if polyfilling the attributes is
feasible.
@sparhami sparhami requested a review from Gregable August 7, 2019 00:56
}
attrs: { name: "importance" } # Not yet part of the html spec
attrs: { name: "intrinsicsize" } # Not yet part of the html spec
attrs: { name: "loading" } # Not yet part of the html spec
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please leave 2 spaces between code and comment on same line

@sparhami sparhami merged commit ed4b970 into ampproject:master Aug 9, 2019
@twifkak
Copy link
Copy Markdown
Member

twifkak commented Aug 9, 2019

@kristoferbaxter this may be relevant to your interests

@kristoferbaxter
Copy link
Copy Markdown
Contributor

Adding notes here for each of these attributes.

  1. importance -> https://wicg.github.io/priority-hints/
  2. intrinsicsize -> https://github.com/WICG/intrinsicsize-attribute
  3. loading -> https://github.com/scott-little/lazyload

Gregable pushed a commit that referenced this pull request Aug 16, 2019
* cl/262591581 Revision bump for #23840

* cl/262631527 Revision bump for #23765

* cl/263233041 data-ampdevmode. Avoid using non-data attributes on non-custom elements.

* cl/263556980 Allow nonce on `<link rel=stylesheet>`.

* cl/263618983 Revision bump for #23775

* cl/263623541 Revision bump for #23873

* cl/263628558 Revision bump for #23866

* cl/263637721 Revision bump for #23867

* cl/263656022 Revision bump for #23967

* fix reverse sync

* fix reverse sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow loading attribute for <img> tag

5 participants