GoogleChrome / GoogleChrome/lighthouse
add `viewport` audit as perf diagnostic for FID
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 20
Description
Double tap to zoom has a significant impact on FID since the browser waits for 300ms after a touch to see if a second one is coming before responding. DTZ occurrences were reduced in 2013 when [an explicit mobile meta viewport disabled the 300ms delay](https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away) and then again in Chrome 91 (in May 2021) when [DTZ was disabled with any mobile-equivalent meta viewport](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/speed/metrics_changelog/2021_05_fid.md) as well. This check is now roughly equivalent to our `viewport` audit.
However, there are still a decent number of sites out there that aren't setting a mobile viewport, have terrible FID as a result, and Lighthouse has no knowledge of this happening because input isn't simulated and the DTZ delay comes from the browser, not from main thread blocking.
From the July 2021 HTTP Archive run, roughly 2M out of 7M sites had both a LH perf score without error _and_ CrUX URL-level CWV data. 10% of sites in that group failed `viewport`, and the large majority of them had excellent TBT but 250ms-300ms FID via CrUX (2.5-3x the 100ms "good" threshold).
These sites tend to be simpler and score well on LCP and CLS both in LH and CrUX, as well as on TBT. As a result, sites without a mobile viewport actually **make up roughly half of the sites that score 90+ in Lighthouse but fail one of the three CWV** (FID, in this case). It's possible a decent number of these sites are older and were never updated to work well on phones and the owners will never see the advice, but adding `viewport` as an diagnostic is also an easy way to remove this Lighthouse FID blindspot.
~Possible~ actions (complete in #12972)
- [x] Add `viewport` to diagnostics
- [x] Possibly add DTZ/FID explanation to audit description
- [x] Add `viewport` to `tbtRelevantAudits` so it's filtered there
one question: is it weird to have a TBT-relevant audit when it's actually FID-relevant and TBT may be super green?
----
**edit**: in discussion we agreed to do roughly all 3 checkboxes.
- [ ] we also discussed making this affect perf score. we see 3 possible ways that could happen:
1. Add to perf score (10% as an example)
1. adjust TBT to include viewport signal
1. add metric that includes this, like max-potential-fid, etc.
Contributor guide
Assessment
This issue has not been assessed yet.