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

Find asset paths in picture source srcsets #176

Merged
merged 1 commit into from Aug 13, 2020
Merged

Find asset paths in picture source srcsets #176

merged 1 commit into from Aug 13, 2020

Conversation

lencioni
Copy link
Contributor

We received a report of a confusing Happo report. Looking at the source
of the "after" version, the problematic part seemed to be related to a
<picture> element with nested <source> elements that used srcset.
After downloading the assets zip file for this report, we noticed that
the assets for these images were not included. I suspected that this was
related to our asset finding code, which we confirmed by pushing up a
change that included regular <img> tags with the same assets, which
ended up fixing the confusing report.

To fix this bug, we can include these elements in our srcset extraction
query selector. Since <source> is used for <picture>, <video>, and
<audio>, I scoped the selector to source elements that descend from
picture elements to avoid also grabbing audio and video files, which I
think we do not want in these bundles.

We received a report of a confusing Happo report. Looking at the source
of the "after" version, the problematic part seemed to be related to a
`<picture>` element with nested `<source>` elements that used `srcset`.
After downloading the assets zip file for this report, we noticed that
the assets for these images were not included. I suspected that this was
related to our asset finding code, which we confirmed by pushing up a
change that included regular `<img>` tags with the same assets, which
ended up fixing the confusing report.

To fix this bug, we can include these elements in our srcset extraction
query selector. Since `<source>` is used for `<picture>`, `<video>`, and
`<audio>`, I scoped the selector to source elements that descend from
picture elements to avoid also grabbing audio and video files, which I
think we do not want in these bundles.
@lencioni lencioni requested a review from trotzig August 12, 2020 21:21
Copy link
Contributor

@trotzig trotzig left a comment

Choose a reason for hiding this comment

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

Looks good -- Thanks!

@trotzig trotzig merged commit 3729646 into master Aug 13, 2020
@trotzig trotzig deleted the source-srcset branch August 13, 2020 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants