-
Notifications
You must be signed in to change notification settings - Fork 215
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
Fallback value for src attribute if not set #6700
Conversation
Fallback value for src attribute if not set
This PR solves the reported issue on the template shared in the GH issue: No more fatal error and I can see the preload applied as on 3.16:
Two tests are failing for the following reasons, in
@Tabrisrp @Khadreal Can you confirm if this is a wanted change to populate both now? I feel like this is just something that was missed and that we don't need to populate both. In which case, the tests are wrong and should be adapted. Otherwise, we just need to re-add the part I removed:
WDYT? |
Each array item of a I think we're packing too much into the |
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 will stop sending the deprecated coverage status from June 5th, 2024. Learn more Footnotes
|
This template http://mathieu.e2e.rocketlabsqa.ovh/lcp_no_dimensions_picture has the following markup |
Rocket-E2E results:
|
http://mathieu.e2e.rocketlabsqa.ovh/lcp_no_dimensions_picture/ No more Fatal. Preload tag as described by Mai has a known issue on develop already
http://mathieu.e2e.rocketlabsqa.ovh/lcp_6599_template2/ lcp_bg_responsive_webkit_template/
http://mathieu.e2e.rocketlabsqa.ovh/lcp_bg_responsive_imgset_template/ https://new.rocketlabsqa.ovh/lcp_specialchar2/ lcp_relative_url_withspecialchar_template |
// Returned objects must always have a src. | ||
// It is used when applying the front-end optimization. | ||
if ( ! isset( $object->src ) ) { | ||
$object->src = ''; | ||
} |
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.
This is not entirely true, bg-img
and bg-img-set
don't use src
on the main object.
While that doesn't break anything, I think it's good to have it noted somewhere.
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.
You are absolutely right @Tabrisrp. Thanks for for pointing it out. I adapted the comment. WDYT?
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.
yes looks good to me
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.
Doesn't look good to the linter :'( On it
Remove duplicated code
Fallback value for src attribute if not set
Description
Fixes #6699
Documentation
User documentation
Prevents Fatal error on LCP/ATF optimization of picture and img-srcset
Technical documentation
Remove duplicated code
Fallback value for src attribute if not set
Type of change
Delete options that are not relevant.
New dependencies
NA
Risks
NA
Checklists
Feature validation
Documentation
Code style
Observability
Risks