-
Notifications
You must be signed in to change notification settings - Fork 6
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
Picture elements are captured, including art direction #208
Conversation
… and puts the archived URL on its img tag
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
…have multiple potential image URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with a few notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎆🎇🌠👍🏻
Issue: #AP-3783
What Changed
We now properly snapshot
<picture>
elements.Background
A
<picture>
element can have multipleOur solution
Similar to @tevanoff's img srcset fix, we'll see if any of the
<picture>
's<source>
or<img>
tags' srcset or src properties match an an item in our asset map. If so, we'll blow away all the<source>
s of the<picture>
tag and modify the existing<img>
tag with the src set to the archived resource.We take care not to modify other attributes of the
<img>
tag, (likeclass
), as we don't want to affect the original styling of the picture.How to test
We only need to manually test Cypress for mobile screens:
<picture>
element with multiple<source>
s that have differing image URLs -- one for desktop, one for mobile (see here for example HTML, but better if you write your own)The automated tests cover the rest:
<picture>
elements', well, pictures, as well as get the right one in the right circumstance