Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support media attribute for hero image preloading #805

Merged
merged 3 commits into from
May 29, 2020

Conversation

sebastianbenz
Copy link
Collaborator

No description provided.

@sebastianbenz sebastianbenz changed the title Image optimization docs Support media attribute for hero image preloading May 28, 2020
}
if (
node.tagName === 'script' &&
hasAttribute(node, 'template') &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason to check for its existence? if it doesn't, the next line would just be against undefined, right?

seems like it could be terse-d up into

return node.tagName === 'template' || node.tageName === 'script' && node.attribs.template === 'amp-mustache'

or even

return node.tagName === 'template' || node.attribs.template === 'amp-mustache'

no worries either way

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

attribs might be undefined

@patrickkettner
Copy link
Collaborator

lgtm

@sebastianbenz sebastianbenz merged commit 1cc8d66 into master May 29, 2020
@sebastianbenz sebastianbenz deleted the image-optimization-docs branch May 29, 2020 08:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants