Skip to content

Support media attribute for hero image preloading#805

Merged
sebastianbenz merged 3 commits intomasterfrom
image-optimization-docs
May 29, 2020
Merged

Support media attribute for hero image preloading#805
sebastianbenz merged 3 commits intomasterfrom
image-optimization-docs

Conversation

@sebastianbenz
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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.

3 participants