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

Small fixes in amp-anim #10114

Merged
merged 1 commit into from Jun 27, 2017
Merged

Conversation

cramforce
Copy link
Member

  • Don't allocate image in constructor. Wait until build time when it is needed.
  • Assign an actual image in un-layout instead of assigning '' to src which actually tries to load the current document as an image.

- Don't allocate image in constructor. Wait until build time when it is needed.
- Assign an actual image in un-layout instead of assigning `''` to src which actually tries to load the current document as an image.
@cramforce
Copy link
Member Author

to @tiendt

@@ -94,7 +96,8 @@ export class AmpAnim extends AMP.BaseElement {
/** @override */
unlayoutCallback() {
// Release memory held by the image - animations are typically large.
this.img_.src = '';
this.img_.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///' +
'yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the tiniest gif ever?

@cramforce
Copy link
Member Author

@tiendt Would you mind reviewing. Thanks.

@cramforce cramforce merged commit c45ec0b into ampproject:master Jun 27, 2017
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.

None yet

4 participants