-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix: audit incorrectly flagging images as above the fold (#12993) #12998
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f657b1f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #12998 will not alter performanceComparing Summary
|
As far as I can tell, the fix implemented in #11617 can't handle all situations (as mentioned in my original issue). However, there were two different fix proposed in #10891:
While the second fix is more complicated than the fix in #11617, but according to my testing, it can also handle the situation which the image is a descendent of a scrolling container other than |
It would be fantastic if you could get a test in for this. I think it's clear that there are edge cases which the other PR didn't catch, which is why an e2e test would be just what's needed. There is already a suite testing the audits, so you could add a case in there: https://github.com/withastro/astro/blob/main/packages/astro/e2e/dev-toolbar-audits.test.js The fixture is here, where you could add something like the page you manually tested with: https://github.com/withastro/astro/blob/main/packages/astro/e2e/fixtures/dev-toolbar |
Thanks for the links! I am happy to write some e2e tests if the team doesn't mind I might need some time to get familiar with playwright. |
No rush. Playwright is pretty nice to work with, so it shouldn't be too hard to get started though. |
I have added some tests:
Please tell me if more edge cases are needed. |
Changes
window.scrollY
window.scrollY
always 0)offsetTop
value of the target element itself and all the offest parent(s)Testing
No tests are added (manual testing is done locally), as I am not familiar with playwright and the fix is trivial. Please help me to add some tests if it is necessary.
Docs
Docs update should not be necessary.