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

✨Get placeholder background from placeholder srcs #20563

Merged
merged 4 commits into from
Jan 29, 2019

Conversation

alanorozco
Copy link
Member

To account for the entire poster image API surface and cases where placeholder is dynamically set, e.g. amp-youtube.

if (element.hasAttribute(poster)) {
return element.getAttribute(poster);
}
const imgEl = element.querySelector(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is img[placeholder] possible?

amp-img[placeholder], [placeholder] amp-img may cover more cases in case they wrap it in a div for some reason.

Copy link
Member Author

@alanorozco alanorozco Jan 28, 2019

Choose a reason for hiding this comment

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

Anything is possible 💫.

Added [placeholder] amp-img.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lol, there used to be a TODO there to switch to amp-img, oh well. :)

skipForSlot('uses `placeholder` img', () => {
const html = htmlFor(env.win.document);
const el = html`<amp-video>
<img src=foo.png placeholder>
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto above, I didn't think this is valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not valid AMPHTML but generated by the runtime.

@alanorozco alanorozco merged commit bbc3638 into ampproject:master Jan 29, 2019
@alanorozco alanorozco deleted the placeholder-img branch January 29, 2019 01:54
jsalgueiro added a commit to jsalgueiro/amphtml that referenced this pull request Jan 29, 2019
* commit '273e1fe2ff7719bf555c9614afe19e14231e4dae':
  Changes to make carousel v2 work with lightbox gallery. (ampproject#20558)
  ✅ Additional carousel v2 end to end tests (ampproject#20522)
  ✨Get placeholder background from `placeholder` srcs (ampproject#20563)
  🐛Reparent placeholder to account for incorrect positioning (ampproject#20562)
  Fix amp-sidebar keyboard event forwarding (ampproject#20557)
  📖 Update `amp-video-docking` CSS reference (ampproject#20571)
  ✅Validate `dock` for `amp-youtube` (ampproject#20554)
  ✅Validate `dock` for `amp-brightcove` (ampproject#20567)
  ✅Add overflow prevention test (ampproject#20546)
  ✅Fix amp-date-display flakes (ampproject#20568)
  temporarily disable saucelabs because of flakiness (ampproject#20566)
  Fix closing the page attachment through popping the history state. (ampproject#20443)
  ✨Add AMP layer to E2E tests (ampproject#20502)
  add avenues for CLA help (ampproject#20521)
  provide more details on design reviews (ampproject#20533)
  🗑️ Remove `video-dock` experiment guard. (ampproject#20413)
  ♻️ amp-recaptcha-input: Allow passing the recaptcha API url from the frame (ampproject#20539)
  🐛 Fix amp-list documentation (ampproject#20553)
  launch amp-list-viewport-resize to 75% in prod (ampproject#20552)
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
To account for the entire poster image API surface and cases where placeholder is dynamically set, e.g. `amp-youtube`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants