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

LCP experiment uses currentSrc instead of src attribute, breaking it on sites that use srcset #2423

Closed
scottjehl opened this issue Oct 5, 2022 · 0 comments
Assignees
Labels
Type: Bug An issue or pull request relating to a bug in WebPageTest

Comments

@scottjehl
Copy link
Contributor

issues is here:
https://github.com/WPO-Foundation/webpagetest/blob/master/www/experiments/lcp.inc#L38-L39

This is better

$lcpSource = isset($lcp['element']['src']) ? $lcp['element']['src'] : $lcp['element']['currentSrc'];
$lcpFullSource = isset($lcp['element']['currentSrc']) ? $lcp['element']['currentSrc'] : $lcp['element']['src'];

This way, src gets passed to the form input value that looks for src, and fullsrc displays in the UI for familiarity with the LCP image as its displayed.

@scottjehl scottjehl added the Type: Bug An issue or pull request relating to a bug in WebPageTest label Oct 5, 2022
@scottjehl scottjehl self-assigned this Oct 5, 2022
@tkadlec tkadlec closed this as completed in 089befb Oct 5, 2022
tkadlec added a commit that referenced this issue Oct 5, 2022
fixes #2423 - LCP image src passed properly when srcset is in play
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug An issue or pull request relating to a bug in WebPageTest
Projects
None yet
Development

No branches or pull requests

1 participant